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
0733b593
Commit
0733b593
authored
Jul 07, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修复 LCUS1 无法报警
2.添加 全局报警 可以从 左下角的 【枫莱尔】 进入
parent
54881a0a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
27 deletions
+78
-27
WarningMenu.cs
...LY.Thick.Base/FLY.Thick.Base.UI/CustomMenu/WarningMenu.cs
+42
-0
UcSectionError.xaml
....Base/FLY.Thick.Base.UI/CustomSection/UcSectionError.xaml
+3
-1
LCUS1_dependOn.cs
...Y.Thick.Base/FLY.Thick.Base.UI/DependOn/LCUS1_dependOn.cs
+1
-22
FLY.Thick.Base.UI.csproj
...FLY.Thick.Base/FLY.Thick.Base.UI/FLY.Thick.Base.UI.csproj
+1
-0
OnInitError.cs
...ct.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitError.cs
+4
-0
OnInitWarnings.cs
...FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitWarnings.cs
+27
-4
No files found.
Project.FLY.Thick.Base/FLY.Thick.Base.UI/CustomMenu/WarningMenu.cs
0 → 100644
View file @
0733b593
using
MultiLayout.UiModule
;
using
GalaSoft.MvvmLight.Command
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Input
;
using
System.Windows.Media
;
using
System.Windows.Navigation
;
using
FLY.Thick.Base.UI
;
using
Unity
;
using
MultiLayout
;
namespace
FLY.Thick.Base.UI.CustomMenu
{
public
class
WarningMenu
:
IMenu
{
public
string
Title
=>
"全局报警"
;
public
Brush
Brush
{
get
;
set
;
}
IUnityContainer
container
;
public
WarningMenu
(
IUnityContainer
container
)
{
this
.
container
=
container
;
Brush
=
Brushes
.
Red
;
}
public
void
OnClick
()
{
var
p
=
this
.
container
.
Resolve
<
PgErrorsTable
>();
FlyLayoutManager
.
NavigationService
.
Navigate
(
p
);
}
}
}
Project.FLY.Thick.Base/FLY.Thick.Base.UI/CustomSection/UcSectionError.xaml
View file @
0733b593
...
...
@@ -94,7 +94,9 @@
</StackPanel>
</StackPanel>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" Text="{Binding LCUS1.ErrMsg}" />
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Unit}" >
状态:<Run Text="{Binding LCUS1.ErrMsg,Mode=OneWay}"/>
</TextBlock>
</StackPanel>
</GroupBox>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/DependOn/LCUS1_dependOn.cs
View file @
0733b593
...
...
@@ -10,33 +10,12 @@ namespace FLY.Thick.Base.UI
public
class
LCUS1_dependOn
:
LCUS1
{
ParamDictionary
paramDictionary
;
FLY
.
OBJComponents
.
IService
.
IWarningSystem2Service
warningService
;
public
LCUS1_dependOn
(
ParamDictionary
paramDictionary
,
FLY
.
OBJComponents
.
IService
.
IWarningSystem2Service
warningService
)
ParamDictionary
paramDictionary
)
{
this
.
paramDictionary
=
paramDictionary
;
this
.
warningService
=
warningService
;
//绑定 this.PortName 与 this.paramDictionary.LCUS1_PortName
this
.
paramDictionary
.
SetBinding
(
this
,
nameof
(
PortName
),
ParamDistItemKeys
.
LCUS1_PortName
,
"COM1"
);
this
.
warningService
.
PropertyChanged
+=
(
s
,
e
)
=>
{
if
(
e
.
PropertyName
==
nameof
(
this
.
warningService
.
IsRinging
))
{
if
(
this
.
paramDictionary
.
GetValue
(
ParamDistItemKeys
.
LCUS1_Enable
,
false
))
{
if
(
this
.
warningService
.
IsRinging
)
{
On
();
}
else
{
Off
();
}
}
}
};
}
}
}
Project.FLY.Thick.Base/FLY.Thick.Base.UI/FLY.Thick.Base.UI.csproj
View file @
0733b593
...
...
@@ -123,6 +123,7 @@
<Compile
Include=
"CtMicroGage\CtMircoGageVmUt.cs"
/>
<Compile
Include=
"CustomMenu\AdrMenu.cs"
/>
<Compile
Include=
"CustomMenu\CustomMenu.cs"
/>
<Compile
Include=
"CustomMenu\WarningMenu.cs"
/>
<Compile
Include=
"CustomMenu\PwMenu.cs"
/>
<Compile
Include=
"CustomSection\UcSectionScanGraph.xaml.cs"
>
<DependentUpon>
UcSectionScanGraph.xaml
</DependentUpon>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitError.cs
View file @
0733b593
...
...
@@ -37,6 +37,7 @@ namespace FLY.Thick.Base.UI.OnInit
this
.
container
=
container
;
this
.
paramDictionary
=
paramDictionary
;
this
.
warningService
=
warningService
;
}
public
void
OnInit
()
{
...
...
@@ -45,7 +46,10 @@ namespace FLY.Thick.Base.UI.OnInit
warningService
.
PropertyChanged
+=
WarningService_PropertyChanged
;
updateErrCodesOfTip
();
}
private
void
WarningService_PropertyChanged
(
object
sender
,
System
.
ComponentModel
.
PropertyChangedEventArgs
e
)
{
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/OnInit/OnInitWarnings.cs
View file @
0733b593
...
...
@@ -28,18 +28,22 @@ namespace FLY.Thick.Base.UI.OnInit
FlyLayoutManager
flyLayoutManager
;
DispatcherTimer
timer_error
;
int
reason_list_index
=
-
1
;
ParamDictionary
paramDictionary
;
LCUS1
lcus1
;
public
OnInitWarnings
(
IUnityContainer
container
,
FlyLayoutManager
flyLayoutManager
,
WarningSystemManager
warningSystemManager
,
ParamDictionary
paramDictionary
,
LCUS1
lcus1
,
int
lv
=
1
)
{
Level
=
lv
;
this
.
container
=
container
;
this
.
flyLayoutManager
=
flyLayoutManager
;
this
.
warningSystemManager
=
warningSystemManager
;
this
.
lcus1
=
lcus1
;
this
.
paramDictionary
=
paramDictionary
;
if
(
warningSystemManager
.
Warnings
.
Count
()
==
0
)
return
;
...
...
@@ -64,6 +68,21 @@ namespace FLY.Thick.Base.UI.OnInit
UpdateError
();
};
UpdateError
();
warningSystemManager
.
PropertyChanged
+=
(
s
,
e
)
=>
{
if
(
e
.
PropertyName
==
nameof
(
warningSystemManager
.
IsRinging
))
{
if
(
this
.
paramDictionary
.
GetValue
(
ParamDistItemKeys
.
LCUS1_Enable
,
false
))
{
if
(
warningSystemManager
.
IsRinging
)
lcus1
.
On
();
else
lcus1
.
Off
();
}
}
};
}
private
void
WarningSystemManager_PropertyChanged
(
object
sender
,
PropertyChangedEventArgs
e
)
...
...
@@ -107,7 +126,7 @@ namespace FLY.Thick.Base.UI.OnInit
public
List
<
ErrorWithName
>
Errors
{
get
;
private
set
;
}
=
new
List
<
ErrorWithName
>();
public
bool
IsRinging
{
get
;
set
;
}
[
InjectionMethod
]
public
void
Init
(
IUnityContainer
container
)
{
...
...
@@ -119,6 +138,7 @@ namespace FLY.Thick.Base.UI.OnInit
//获取全部报警管理器
Warnings
=
warning_container
.
ResolveAll
<
WarningSystem2ServiceClientWithName
>().
ToList
();
IsRinging
=
Warnings
.
Any
(
w
=>
w
.
IsRinging
);
foreach
(
var
warning
in
Warnings
)
{
...
...
@@ -129,10 +149,13 @@ namespace FLY.Thick.Base.UI.OnInit
private
void
WarningService_PropertyChanged
(
object
sender
,
System
.
ComponentModel
.
PropertyChangedEventArgs
e
)
{
if
((
e
.
PropertyName
==
nameof
(
WarningSystem2ServiceClientWithName
.
ReasonList
))
||(
e
.
PropertyName
==
nameof
(
WarningSystem2ServiceClientWithName
.
IsConnected
)))
||
(
e
.
PropertyName
==
nameof
(
WarningSystem2ServiceClientWithName
.
IsConnected
)))
{
updateErrors
();
}
else
if
(
e
.
PropertyName
==
nameof
(
WarningSystem2ServiceClientWithName
.
IsRinging
))
{
IsRinging
=
Warnings
.
Any
(
w
=>
w
.
IsRinging
);
}
}
void
updateErrors
()
...
...
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