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
303cad43
Commit
303cad43
authored
May 30, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Plain Diff
合并
parents
4b40027b
21ae28ec
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
33 deletions
+33
-33
PLCProxySystemServiceClient.cs
...nents/OBJComponents/Client/PLCProxySystemServiceClient.cs
+1
-1
FlyData_WarningHistory.cs
...Components/OBJComponents/Common/FlyData_WarningHistory.cs
+2
-3
ErrorConf.cs
Project.FLY.OBJComponents/OBJComponents/Server/ErrorConf.cs
+16
-11
PLCProxySystem.cs
....FLY.OBJComponents/OBJComponents/Server/PLCProxySystem.cs
+13
-7
PgErrorTable2.xaml
...Y.Thick.Base/FLY.Thick.Base.UI/PgError/PgErrorTable2.xaml
+1
-11
No files found.
Project.FLY.OBJComponents/OBJComponents/Client/PLCProxySystemServiceClient.cs
View file @
303cad43
...
@@ -120,7 +120,7 @@ namespace FLY.OBJComponents.Client
...
@@ -120,7 +120,7 @@ namespace FLY.OBJComponents.Client
public
string
[]
GetSyncPropNames
()
public
string
[]
GetSyncPropNames
()
{
{
return
new
string
[]
{
return
new
string
[]
{
"IsConnectedWithPLC"
nameof
(
IsConnectedWithPLC
)
};
};
}
}
...
...
Project.FLY.OBJComponents/OBJComponents/Common/FlyData_WarningHistory.cs
View file @
303cad43
...
@@ -108,9 +108,8 @@ namespace FLY.OBJComponents.Common
...
@@ -108,9 +108,8 @@ namespace FLY.OBJComponents.Common
/// </summary>
/// </summary>
public
struct
ERRNO
public
struct
ERRNO
{
{
public
byte
Code
;
public
UInt16
Code
;
public
string
Descrption
;
public
string
Descrption
;
public
bool
OffIsError
;
}
}
public
static
class
PlcErrNos
public
static
class
PlcErrNos
...
@@ -118,6 +117,6 @@ namespace FLY.OBJComponents.Common
...
@@ -118,6 +117,6 @@ namespace FLY.OBJComponents.Common
/// <summary>
/// <summary>
/// PLC连接断开
/// PLC连接断开
/// </summary>
/// </summary>
public
static
ERRNO
ERRNO_PLC_DISCONNECTED
=
new
ERRNO
()
{
Code
=
25
5
,
Descrption
=
"PLC连接断开"
};
public
static
ERRNO
ERRNO_PLC_DISCONNECTED
=
new
ERRNO
()
{
Code
=
6553
5
,
Descrption
=
"PLC连接断开"
};
}
}
}
}
Project.FLY.OBJComponents/OBJComponents/Server/ErrorConf.cs
View file @
303cad43
...
@@ -20,13 +20,13 @@ namespace FLY.OBJComponents.Server
...
@@ -20,13 +20,13 @@ namespace FLY.OBJComponents.Server
/// <summary>
/// <summary>
/// 需要设置
/// 需要设置
/// </summary>
/// </summary>
IPLCProxySystemService
PLCos
;
PLCProxySystem
PLCos
;
/// <summary>
/// <summary>
/// 报警系统
/// 报警系统
/// </summary>
/// </summary>
WarningSystem
mWarning
;
WarningSystem
mWarning
;
public
byte
ErrCode
=
0
;
public
byte
ErrCode
=
0
;
public
ErrorConf
(
IPLCProxySystemService
PLCos
,
WarningSystem
mWarning
,
string
plcName
)
public
ErrorConf
(
PLCProxySystem
PLCos
,
WarningSystem
mWarning
,
string
plcName
)
{
{
this
.
PLCos
=
PLCos
;
this
.
PLCos
=
PLCos
;
this
.
mWarning
=
mWarning
;
this
.
mWarning
=
mWarning
;
...
@@ -98,22 +98,27 @@ namespace FLY.OBJComponents.Server
...
@@ -98,22 +98,27 @@ namespace FLY.OBJComponents.Server
}
}
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
//连接断开事件
//连接断开事件
, 3秒查一次,不能有复位的机会
FObjBase
.
PollModule
.
Current
.
Poll_Config
(
PollModule
.
POLL_CONFIG
.
ADD
,
FObjBase
.
PollModule
.
Current
.
Poll_Config
(
PollModule
.
POLL_CONFIG
.
ADD
,
()
=>
()
=>
{
{
Misc
.
BindingOperations
.
SetBinding
(
PLCos
,
nameof
(
PLCos
.
IsConnectedWithPLC
),
()
=>
for
(
int
i
=
0
;
i
<
PLCos
.
PLCs
.
Count
();
i
++)
{
{
bool
b
=
!
PLCos
.
IsConnectedWithPLC
;
bool
b
=
!
PLCos
.
PLCs
[
i
].
Client
.
IsConnected
;
ERR_STATE
state
=
b
?
ERR_STATE
.
ON
:
ERR_STATE
.
OFF
;
ERR_STATE
state
=
b
?
ERR_STATE
.
ON
:
ERR_STATE
.
OFF
;
ERRNO
errno
=
PlcErrNos
.
ERRNO_PLC_DISCONNECTED
;
ERRNO
errno
=
PlcErrNos
.
ERRNO_PLC_DISCONNECTED
;
byte
errcode
=
errno
.
Code
;
UInt16
errcode
=
(
UInt16
)(
errno
.
Code
-
i
);
string
description
=
$"
{
plcName
}
"
+
errno
.
Descrption
;
string
description
;
if
(
PLCos
.
PLCs
.
Count
()
>
1
)
description
=
$"
{
plcName
}
No.
{
i
+
1
}
"
+
errno
.
Descrption
;
else
description
=
$"
{
plcName
}
"
+
errno
.
Descrption
;
mWarning
.
Add
(
errcode
,
description
,
state
);
mWarning
.
Add
(
errcode
,
description
,
state
);
});
}
},
TimeSpan
.
FromSeconds
(
3
),
true
,
false
,
this
,
MARKNO_DELAY_ISCONNECTED
,
true
);
},
TimeSpan
.
FromSeconds
(
3
),
true
,
false
,
this
,
MARKNO_DELAY_ISCONNECTED
,
false
);
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
//启动定时器,每1秒查报警,防止 以为报警复位了,但其实还在报警
//启动定时器,每1秒查报警,防止 以为报警复位了,但其实还在报警
...
@@ -149,7 +154,7 @@ namespace FLY.OBJComponents.Server
...
@@ -149,7 +154,7 @@ namespace FLY.OBJComponents.Server
public
void
ResetError
(
INotifyPropertyChanged
sender
)
public
void
ResetError
(
INotifyPropertyChanged
sender
)
{
{
var
type
=
sender
.
GetType
();
var
type
=
sender
.
GetType
();
foreach
(
var
ei
in
obj_error
[
sender
as
INotifyPropertyChanged
].
error_property
)
foreach
(
var
ei
in
obj_error
[
sender
].
error_property
)
{
{
var
property
=
type
.
GetProperty
(
ei
.
property
);
var
property
=
type
.
GetProperty
(
ei
.
property
);
property
.
SetValue
(
sender
,
false
);
property
.
SetValue
(
sender
,
false
);
...
...
Project.FLY.OBJComponents/OBJComponents/Server/PLCProxySystem.cs
View file @
303cad43
...
@@ -110,13 +110,19 @@ namespace FLY.OBJComponents.Server
...
@@ -110,13 +110,19 @@ namespace FLY.OBJComponents.Server
plc
.
NameDataChanged
+=
Plc_NameDataChanged
;
plc
.
NameDataChanged
+=
Plc_NameDataChanged
;
}
}
Misc
.
BindingOperations
.
SetBinding
(
PLCs
[
0
].
Client
,
"IsConnected"
,
()
=>
//任何一个PLC断开,也会显示连接断开
IsConnectedWithPLC
=
PLCs
.
All
(
plc
=>
plc
.
Client
.
IsConnected
);
foreach
(
var
plc
in
PLCs
)
{
{
IsConnectedWithPLC
=
PLCs
[
0
].
Client
.
IsConnected
;
plc
.
Client
.
PropertyChanged
+=
(
s
,
e
)
=>
//if (!IsConnectedWithPLC)
{
// ClearPlan();
if
(
e
.
PropertyName
==
nameof
(
Modbus
.
WithThread
.
ClientTCP
.
IsConnected
))
{
});
IsConnectedWithPLC
=
PLCs
.
All
(
p
=>
p
.
Client
.
IsConnected
);
}
};
}
foreach
(
var
obj
in
ObjNames
.
Values
)
foreach
(
var
obj
in
ObjNames
.
Values
)
{
{
...
@@ -357,7 +363,7 @@ namespace FLY.OBJComponents.Server
...
@@ -357,7 +363,7 @@ namespace FLY.OBJComponents.Server
public
string
[]
GetSyncPropNames
()
public
string
[]
GetSyncPropNames
()
{
{
return
new
string
[]
{
"IsConnectedWithPLC"
};
return
new
string
[]
{
nameof
(
IsConnectedWithPLC
)
};
}
}
public
string
[]
GetNoSyncPropNames
()
public
string
[]
GetNoSyncPropNames
()
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgError/PgErrorTable2.xaml
View file @
303cad43
...
@@ -75,17 +75,7 @@
...
@@ -75,17 +75,7 @@
</StackPanel>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" >
<Button Style="{StaticResource buttonStyle}" Click="button_silence_click" Foreground="#FFEE3232">
<StackPanel >
<Grid Style="{StaticResource GridStyle_ButtonShadow}">
<Ellipse Style="{StaticResource backPackStyle}" Fill="White"/>
<iconPacks:PackIconMaterial Kind="VolumeMute" Style="{StaticResource iconPackStyle}" />
</Grid>
<TextBlock Text="消音" Style="{StaticResource titlePackStyle}"/>
</StackPanel>
</Button>
</StackPanel>
</Grid>
</Grid>
...
...
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