Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
Thick-Common
Commits
03f200e5
Commit
03f200e5
authored
Mar 24, 2020
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 定点图配置添加密码
2. 报警大提示框,改为扫描报警大提示框
parent
5d631bd5
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
69 deletions
+64
-69
UcSectionError.xaml
....Base/FLY.Thick.Base.UI/CustomSection/UcSectionError.xaml
+7
-11
UcSectionError.xaml.cs
...se/FLY.Thick.Base.UI/CustomSection/UcSectionError.xaml.cs
+9
-9
UcSingleStateTab.xaml
...ase/FLY.Thick.Base.UI/CustomSection/UcSingleStateTab.xaml
+15
-9
OnInitError.cs
...ct.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitError.cs
+29
-39
ParamDistItemKeys.cs
...ect.FLY.Thick.Base/FLY.Thick.Base.UI/ParamDistItemKeys.cs
+1
-1
FixGraphConfig.xaml.cs
...LY.Thick.Base.UI/UiModule/FixGraph/FixGraphConfig.xaml.cs
+3
-0
No files found.
Project.FLY.Thick.Base/FLY.Thick.Base.UI/CustomSection/UcSectionError.xaml
View file @
03f200e5
...
...
@@ -72,11 +72,11 @@
</GroupBox.Header>
<StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Margin="
5
">
<StackPanel Margin="
{StaticResource ControlMargin}
">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="使能" />
<ToggleButton Style="{StaticResource ToggleButtonStyle1}" HorizontalAlignment="Left" IsChecked="{Binding EnableLCUS1}" />
</StackPanel>
<StackPanel Margin="
5
">
<StackPanel Margin="
{StaticResource ControlMargin}
">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="串口地址" />
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding LCUS1_PortName}" HorizontalAlignment="Left" Tag="Full"/>
...
...
@@ -100,17 +100,13 @@
</GroupBox>
<GroupBox Style="{x:Null}" Margin="5">
<GroupBox.Header>
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="大屏报警" VerticalAlignment="Bottom"/>
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeader}" Text="大屏
显示扫描
报警" VerticalAlignment="Bottom"/>
</GroupBox.Header>
<StackPanel Orientation="Horizontal" x:Name="spErrCodes">
<StackPanel Margin="5">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="出错码" />
<TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="格式为:11,12" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding ErrCodesOfTip}" MinWidth="300" HorizontalAlignment="Left" Tag="Full"/>
<StackPanel Margin="{StaticResource ControlMargin}">
<StackPanel Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource TextBlockStyle_FieldHeaderEditable}" Text="使能" />
<ToggleButton Style="{StaticResource ToggleButtonStyle1}" HorizontalAlignment="Left" IsChecked="{Binding EnableScanErrBigTip}" />
</StackPanel>
</StackPanel>
</StackPanel>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/CustomSection/UcSectionError.xaml.cs
View file @
03f200e5
...
...
@@ -52,9 +52,9 @@ namespace FLY.Thick.Base.UI.CustomSection
public
int
WarningDurationSec
{
get
;
set
;
}
/// <summary>
///
显示报警信息的 报警编号
///
大屏幕提示扫描报警
/// </summary>
public
string
ErrCodesOf
Tip
{
get
;
set
;
}
public
bool
EnableScanErrBig
Tip
{
get
;
set
;
}
/// <summary>
/// USB 继电器 串口地址
...
...
@@ -96,21 +96,21 @@ namespace FLY.Thick.Base.UI.CustomSection
WarningTipPath
=
this
.
paramDictionary
.
GetValue
(
ParamDistItemKeys
.
WarningTipPath
,
""
);
var
v
=
this
.
paramDictionary
.
GetValue
<
int
>(
ParamDistItemKeys
.
WarningDurationSec
);
WarningDurationSec
=
this
.
paramDictionary
.
GetValue
(
ParamDistItemKeys
.
WarningDurationSec
,
5
);
E
rrCodesOfTip
=
this
.
paramDictionary
.
GetValue
(
ParamDistItemKeys
.
ErrCodesOfTip
,
"11,12"
);
E
nableScanErrBigTip
=
this
.
paramDictionary
.
GetValue
(
ParamDistItemKeys
.
EnableScanErrBigTip
,
false
);
LCUS1_PortName
=
this
.
paramDictionary
.
GetValue
(
ParamDistItemKeys
.
LCUS1_PortName
,
"COM1"
);
EnableLCUS1
=
this
.
paramDictionary
.
GetValue
(
ParamDistItemKeys
.
EnableLCUS1
,
false
);
this
.
PropertyChanged
+=
(
s
,
e
)
=>
{
if
(
e
.
PropertyName
==
ParamDistItemKeys
.
WarningTipPath
)
if
(
e
.
PropertyName
==
"WarningTipPath"
)
this
.
paramDictionary
.
SetValue
(
ParamDistItemKeys
.
WarningTipPath
,
WarningTipPath
);
else
if
(
e
.
PropertyName
==
ParamDistItemKeys
.
WarningDurationSec
)
else
if
(
e
.
PropertyName
==
"WarningDurationSec"
)
this
.
paramDictionary
.
SetValue
(
ParamDistItemKeys
.
WarningDurationSec
,
WarningDurationSec
);
else
if
(
e
.
PropertyName
==
ParamDistItemKeys
.
ErrCodesOfTip
)
this
.
paramDictionary
.
SetValue
(
ParamDistItemKeys
.
E
rrCodesOfTip
,
ErrCodesOf
Tip
);
else
if
(
e
.
PropertyName
==
ParamDistItemKeys
.
LCUS1_PortName
)
else
if
(
e
.
PropertyName
==
"EnableScanErrBigTip"
)
this
.
paramDictionary
.
SetValue
(
ParamDistItemKeys
.
E
nableScanErrBigTip
,
EnableScanErrBig
Tip
);
else
if
(
e
.
PropertyName
==
"LCUS1_PortName"
)
this
.
paramDictionary
.
SetValue
(
ParamDistItemKeys
.
LCUS1_PortName
,
LCUS1_PortName
);
else
if
(
e
.
PropertyName
==
ParamDistItemKeys
.
EnableLCUS1
)
else
if
(
e
.
PropertyName
==
"EnableLCUS1"
)
this
.
paramDictionary
.
SetValue
(
ParamDistItemKeys
.
EnableLCUS1
,
EnableLCUS1
);
};
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/CustomSection/UcSingleStateTab.xaml
View file @
03f200e5
...
...
@@ -20,13 +20,14 @@
<StackPanel.Resources>
<Style x:Key="TextBlockStyle_GridFieldHeader" TargetType="TextBlock" BasedOn="{StaticResource TextBlockStyle_FieldHeaderEditable}">
<Setter Property="Width" Value="100"/>
<Setter Property="Margin" Value="1,0"/>
<Setter Property="Margin" Value="1
.5
,0"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="{StaticResource Color_theme_activity}"/>
</Style>
<Style x:Key="TextBlockStyle_GridFieldContent" TargetType="TextBlock" BasedOn="{StaticResource TextBlockStyle_FieldContent}">
<Setter Property="Width" Value="100"/>
<Setter Property="Margin" Value="1,0"/>
<Setter Property="Margin" Value="1.5,0"/>
<Setter Property="Background" Value="White"/>
</Style>
<Style x:Key="ComboBoxStyle_GridFieldContent" TargetType="ComboBox" >
<Setter Property="Width" Value="100"/>
...
...
@@ -34,7 +35,7 @@
<Setter Property="FontSize" Value="25"/>
</Style>
</StackPanel.Resources>
<StackPanel Orientation="Horizontal" Margin="3">
<StackPanel Orientation="Horizontal" Margin="3
,1.5
">
<TextBlock Style="{StaticResource TextBlockStyle_GridFieldHeader}"
Text="状态" />
<TextBlock Style="{StaticResource TextBlockStyle_GridFieldHeader}"
...
...
@@ -48,13 +49,18 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="3">
<StackPanel>
<StackPanel Orientation="Horizontal" Margin="3,1.5">
<TextBlock Style="{StaticResource TextBlockStyle_GridFieldContent}" Text="{Binding ControllerState}"/>
<TextBlock Style="{StaticResource TextBlockStyle_GridFieldContent}" Text="{Binding Header}"/>
<Button Style="{StaticResource ButtonStyle_icon}" Click="button_del_Click" Tag="{Binding .
}">
<Button Style="{StaticResource ButtonStyle_icon}" Click="button_del_Click" Tag="{Binding .}" Foreground="{StaticResource ValidationBrush5
}">
<iconPacks:PackIconMaterial Kind="CloseCircle"/>
</Button>
</StackPanel>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitError.cs
View file @
03f200e5
...
...
@@ -10,6 +10,7 @@ using System.Threading;
using
System.Threading.Tasks
;
using
FLY.Thick.Base.UI
;
using
Unity
;
using
FLY.Thick.Base.Common
;
namespace
FLY.Thick.Base.UI.OnInit
{
...
...
@@ -24,6 +25,8 @@ namespace FLY.Thick.Base.UI.OnInit
ParamDictionary
paramDictionary
;
IUnityContainer
container
;
bool
enableScanErrBigTip
;
int
warningTipId
=-
1
;
public
int
Level
{
get
;
}
public
OnInitError
(
IUnityContainer
container
,
...
...
@@ -43,76 +46,63 @@ namespace FLY.Thick.Base.UI.OnInit
paramDictionary
.
ValueChanged
+=
ParamDictionary_ValueChanged
;
warningReasonWindow
.
Record
.
CollectionChanged
+=
Record_CollectionChanged
;
updateErrCodesOfTip
();
}
private
void
ParamDictionary_ValueChanged
(
object
sender
,
ParamDictionaryValueChangedEventArgs
e
)
{
if
(
e
.
Key
==
ParamDistItemKeys
.
E
rrCodesOf
Tip
)
if
(
e
.
Key
==
ParamDistItemKeys
.
E
nableScanErrBig
Tip
)
{
updateErrCodesOfTip
();
}
}
List
<
int
>
errCodes
=
new
List
<
int
>();
void
updateErrCodesOfTip
()
{
errCodes
.
Clear
();
string
str
=
paramDictionary
.
GetValue
<
string
>(
ParamDistItemKeys
.
ErrCodesOfTip
);
if
(
string
.
IsNullOrEmpty
(
str
))
return
;
enableScanErrBigTip
=
paramDictionary
.
GetValue
<
bool
>(
ParamDistItemKeys
.
EnableScanErrBigTip
,
false
);
int
[]
codes
=
null
;
try
{
codes
=
Newtonsoft
.
Json
.
JsonConvert
.
DeserializeObject
<
int
[
]>
(
$"[
{
str
}
]"
);
}
catch
(
Exception
ex
)
{
return
;
}
if
(
codes
==
null
)
return
;
if
(
codes
.
Count
()
==
0
)
return
;
errCodes
.
AddRange
(
codes
);
}
private
void
Record_CollectionChanged
(
object
sender
,
System
.
Collections
.
Specialized
.
NotifyCollectionChangedEventArgs
e
)
{
if
(
errCodes
.
Count
()
==
0
)
if
(
!
enableScanErrBigTip
)
return
;
FObjBase
.
PollModule
.
Current
.
Poll_JustOnce
(
new
FObjBase
.
PollModule
.
PollHandler
(
delegate
()
{
List
<
int
>
errCodes
=
new
List
<
int
>
{
ERRNOs
.
SCAN_ERRNO_OVERCTRL
.
Code
,
ERRNOs
.
SCAN_ERRNO_OVERTOL
.
Code
};
var
record
=
warningReasonWindow
.
Record
;
//判断当前报警是否包含 errCodes
var
rs
=
from
r
in
record
where
errCodes
.
Contains
(
r
.
ErrCode
)
select
r
;
if
(
rs
.
Count
()
==
0
)
{
//没有一个需要报警
FLY
.
ControlLibrary
.
Window_WarningTip
.
Stop
();
}
else
if
(
rs
.
Count
()
==
0
)
{
//不需要提示
if
(
warningTipId
!=
-
1
)
{
//需要把之前的报警关闭
FLY
.
ControlLibrary
.
Window_WarningTip
.
Stop
(
warningTipId
);
warningTipId
=
-
1
;
}
}
else
{
int
errcode
=
rs
.
First
().
ErrCode
;
string
msg
=
rs
.
First
().
Description
;
string
path
=
paramDictionary
.
GetValue
<
string
>(
ParamDistItemKeys
.
WarningTipPath
);
//报警!!!!!!!!
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
//记录打开的报警提示框Id,用于以后关闭
warningTipId
=
FLY
.
ControlLibrary
.
Window_WarningTip
.
Show
(
$"编码=
{
errcode
}
"
,
msg
,
TimeSpan
.
MaxValue
,
path
,
warningService
.
Reset
);
}
}),
this
,
MARKNO_WARNING_RING
);
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/ParamDistItemKeys.cs
View file @
03f200e5
...
...
@@ -13,7 +13,7 @@ namespace FLY.Thick.Base.UI
public
const
string
Language
=
"Language"
;
public
const
string
WarningTipPath
=
"WarningTipPath"
;
public
const
string
WarningDurationSec
=
"WarningDurationSec"
;
public
const
string
E
rrCodesOfTip
=
"ErrCodesOf
Tip"
;
public
const
string
E
nableScanErrBigTip
=
"EnableScanErrBig
Tip"
;
public
const
string
LCUS1_PortName
=
"LCUS1_PortName"
;
public
const
string
EnableLCUS1
=
"EnableLCUS1"
;
public
const
string
WindowSize
=
"WindowSize"
;
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/UiModule/FixGraph/FixGraphConfig.xaml.cs
View file @
03f200e5
...
...
@@ -148,6 +148,9 @@ namespace FLY.Thick.Base.UI.UiModule
private
void
button_save_Click
(
object
sender
,
RoutedEventArgs
e
)
{
if
(!
WdPassword
.
Authorize
(
"GraphConfig"
))
return
;
graphparam_clone
.
CopyTo
(
mGraphParam
);
FixGraphParams
.
Current
.
Save
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment