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
b35abc60
Commit
b35abc60
authored
Jul 07, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'remotes/origin/dev7.0-blowing' into dev7.0-filmCasting
parents
0733b593
2e998d28
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
113 deletions
+133
-113
FlyData_WarningHistory.cs
...Components/OBJComponents/Common/FlyData_WarningHistory.cs
+4
-2
ErrorConf.cs
Project.FLY.OBJComponents/OBJComponents/Server/ErrorConf.cs
+1
-1
WdIOTip.xaml.cs
....FLY.Thick.Base/FLY.Thick.Base.UI/PgError/WdIOTip.xaml.cs
+82
-65
FlyAdIoDefineServiceClient.cs
....Base/FLY.Thick.Base/Client/FlyAdIoDefineServiceClient.cs
+0
-36
FlyADIODefine.cs
...ect.FLY.Thick.Base/FLY.Thick.Base/Common/FlyADIODefine.cs
+29
-8
IFlyAdIoDefineService.cs
...ick.Base/FLY.Thick.Base/IService/IFlyAdIoDefineService.cs
+17
-1
No files found.
Project.FLY.OBJComponents/OBJComponents/Common/FlyData_WarningHistory.cs
View file @
b35abc60
...
...
@@ -112,11 +112,13 @@ namespace FLY.OBJComponents.Common
public
string
Descrption
;
}
public
static
class
PlcErrNos
public
class
PlcErrNos
{
public
static
PlcErrNos
Instance
{
get
;
}
=
new
PlcErrNos
();
/// <summary>
/// PLC连接断开
/// </summary>
public
static
ERRNO
ERRNO_PLC_DISCONNECTED
=
new
ERRNO
()
{
Code
=
65535
,
Descrption
=
"PLC连接断开"
};
public
ERRNO
ERRNO_PLC_DISCONNECTED
=
new
ERRNO
()
{
Code
=
65535
,
Descrption
=
"PLC连接断开"
};
}
}
Project.FLY.OBJComponents/OBJComponents/Server/ErrorConf.cs
View file @
b35abc60
...
...
@@ -107,7 +107,7 @@ namespace FLY.OBJComponents.Server
bool
b
=
!
PLCos
.
PLCs
[
i
].
Client
.
IsConnected
;
ERR_STATE
state
=
b
?
ERR_STATE
.
ON
:
ERR_STATE
.
OFF
;
ERRNO
errno
=
PlcErrNos
.
ERRNO_PLC_DISCONNECTED
;
ERRNO
errno
=
PlcErrNos
.
Instance
.
ERRNO_PLC_DISCONNECTED
;
UInt16
errcode
=
(
UInt16
)(
errno
.
Code
-
i
);
string
description
;
if
(
PLCos
.
PLCs
.
Count
()
>
1
)
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgError/WdIOTip.xaml.cs
View file @
b35abc60
using
FLY.Thick.Base.IService
;
using
FLY.Thick.Base.Common
;
using
FLY.Thick.Base.IService
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.ObjectModel
;
...
...
@@ -33,7 +34,7 @@ namespace FLY.Thick.Base.UI
public
void
Init
(
IFlyAdIoDefineService
iODefineService
,
ITDGageService
gageService
)
{
viewModel
=
new
WdIoTipVm
();
viewModel
.
Init
(
iODefineService
,
gageService
);
viewModel
.
Init
(
iODefineService
,
gageService
.
DynArea
);
this
.
DataContext
=
viewModel
;
}
...
...
@@ -53,18 +54,18 @@ namespace FLY.Thick.Base.UI
}
public
void
Init
(
IFlyAdIoDefineService
iODefineService
,
ITDGageService
gageService
)
public
void
Init
(
IFlyAdIoDefineService
iODefineService
,
DynArea
dynArea
)
{
this
.
dynArea
=
gageService
.
D
ynArea
;
this
.
dynArea
=
d
ynArea
;
this
.
iODefineService
=
iODefineService
;
for
(
int
i
=
0
;
i
<
1
6
;
i
++)
{
for
(
int
i
=
0
;
i
<
1
2
;
i
++)
{
IStatus
.
Add
(
new
FlyAdIoStatus
()
{
Number
=
$"i
{
i
+
1
}
"
});
};
for
(
int
i
=
0
;
i
<
8
;
i
++)
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
OStatus
.
Add
(
new
FlyAdIoStatus
()
{
...
...
@@ -86,23 +87,25 @@ namespace FLY.Thick.Base.UI
update
();
}
Misc
.
BindingOperations
.
SetBinding
(
dynArea
,
nameof
(
dynArea
.
IStatus
),
()
=>
Misc
.
BindingOperations
.
SetBinding
(
dynArea
,
nameof
(
dynArea
.
IStatus
),
updateIsOn_In
);
Misc
.
BindingOperations
.
SetBinding
(
dynArea
,
nameof
(
dynArea
.
OStatus
),
updateIsOn_Out
);
}
void
updateIsOn_In
()
{
for
(
int
i
=
0
;
i
<
IStatus
.
Count
();
i
++)
{
for
(
int
i
=
0
;
i
<
IStatus
.
Count
();
i
++)
{
IStatus
[
i
].
IsOn
=
!
Misc
.
MyBase
.
CHECKBIT
(
dynArea
.
IStatus
,
i
);
}
});
Misc
.
BindingOperations
.
SetBinding
(
dynArea
,
nameof
(
dynArea
.
OStatus
),
()
=>
}
void
updateIsOn_Out
()
{
for
(
int
i
=
0
;
i
<
OStatus
.
Count
();
i
++)
{
OStatus
[
i
].
IsOn
=
!
Misc
.
MyBase
.
CHECKBIT
(
dynArea
.
OStatus
,
i
);
}
});
}
private
void
Client_PropertyChanged
(
object
sender
,
System
.
ComponentModel
.
PropertyChangedEventArgs
e
)
{
var
client
=
this
.
iODefineService
as
FObjBase
.
FObjServiceClient
;
...
...
@@ -119,53 +122,73 @@ namespace FLY.Thick.Base.UI
{
iODefineService
.
GetIODefine
((
asyncContext
,
retData
)
=>
{
var
reponse
=
retData
as
List
<
IODefine
>
;
if
(
reponse
==
null
||
reponse
.
Count
()
==
0
)
var
reponse
=
retData
as
IODefineCollection
;
if
(
reponse
==
null
)
{
return
;
string
[]
istatus_desps
=
new
string
[
IStatus
.
Count
()];
string
[]
ostatus_desps
=
new
string
[
OStatus
.
Count
()];
for
(
int
i
=
0
;
i
<
reponse
.
Count
();
i
++)
{
var
ioDefine
=
reponse
[
i
];
if
(
ioDefine
.
IoType
==
IODefine
.
IOTYPE
.
Input
)
{
if
(
ioDefine
.
Index
<
istatus_desps
.
Count
())
{
istatus_desps
[
ioDefine
.
Index
]
=
ioDefine
.
Description
;
}
var
list
=
reponse
.
List
;
if
(
list
==
null
||
list
.
Count
()
==
0
)
return
;
update
(
IODefine
.
IOTYPE
.
Input
,
IStatus
,
reponse
.
InCount
,
list
);
update
(
IODefine
.
IOTYPE
.
Output
,
OStatus
,
reponse
.
OutCount
,
list
);
updateIsOn_In
();
updateIsOn_Out
();
},
this
);
}
else
{
if
(
ioDefine
.
Index
<
ostatus_desps
.
Count
())
void
update
(
IODefine
.
IOTYPE
ioType
,
ObservableCollection
<
FlyAdIoStatus
>
ioStatus
,
int
ioCnt
,
List
<
IODefine
>
list
)
{
//补够数量
if
(
ioStatus
.
Count
()
!=
ioCnt
&&
ioCnt
>
0
)
{
while
(
ioStatus
.
Count
()
>
ioCnt
)
{
ostatus_desps
[
ioDefine
.
Index
]
=
ioDefine
.
Description
;
ioStatus
.
RemoveAt
(
ioStatus
.
Count
()
-
1
)
;
}
while
(
ioStatus
.
Count
()
<
ioCnt
)
{
int
i
=
ioStatus
.
Count
();
ioStatus
.
Add
(
new
FlyAdIoStatus
()
{
Number
=
$"i
{
i
+
1
}
"
});
}
}
for
(
int
i
=
0
;
i
<
istatus_desps
.
Count
();
i
++)
{
if
(
string
.
IsNullOrEmpty
(
istatus_desps
[
i
]))
//获取中文
string
[]
iostatus_desps
=
new
string
[
ioCnt
];
for
(
int
i
=
0
;
i
<
list
.
Count
();
i
++)
{
IStatus
[
i
].
Desp
=
""
;
}
else
var
ioDefine
=
list
[
i
];
if
(
ioDefine
.
IoType
==
ioType
)
{
IStatus
[
i
].
Desp
=
istatus_desps
[
i
];
if
(
ioDefine
.
Index
<
iostatus_desps
.
Count
())
{
iostatus_desps
[
ioDefine
.
Index
]
=
ioDefine
.
Description
;
}
}
}
for
(
int
i
=
0
;
i
<
ostatus_desps
.
Count
();
i
++)
//填入
for
(
int
i
=
0
;
i
<
iostatus_desps
.
Count
();
i
++)
{
if
(
string
.
IsNullOrEmpty
(
ostatus_desps
[
i
]))
if
(
string
.
IsNullOrEmpty
(
i
ostatus_desps
[
i
]))
{
O
Status
[
i
].
Desp
=
""
;
io
Status
[
i
].
Desp
=
""
;
}
else
{
OStatus
[
i
].
Desp
=
ostatus_desps
[
i
];
ioStatus
[
i
].
Desp
=
i
ostatus_desps
[
i
];
}
}
},
this
);
}
}
public
class
FlyAdIoStatus
:
INotifyPropertyChanged
{
...
...
@@ -188,25 +211,19 @@ namespace FLY.Thick.Base.UI
}
public
class
WdIoTipVmUt
:
INotifyPropertyChanged
public
class
WdIoTipVmUt
:
WdIoTipVm
{
public
event
PropertyChangedEventHandler
PropertyChanged
;
public
ObservableCollection
<
FlyAdIoStatus
>
IStatus
{
get
;
}
=
new
ObservableCollection
<
FlyAdIoStatus
>();
public
ObservableCollection
<
FlyAdIoStatus
>
OStatus
{
get
;
}
=
new
ObservableCollection
<
FlyAdIoStatus
>();
public
WdIoTipVmUt
()
{
for
(
int
i
=
0
;
i
<
1
6
;
i
++)
for
(
int
i
=
0
;
i
<
1
2
;
i
++)
{
IStatus
.
Add
(
new
FlyAdIoStatus
()
{
Number
=
$"i
{
i
+
1
}
"
});
};
for
(
int
i
=
0
;
i
<
8
;
i
++)
for
(
int
i
=
0
;
i
<
4
;
i
++)
{
OStatus
.
Add
(
new
FlyAdIoStatus
()
{
...
...
Project.FLY.Thick.Base/FLY.Thick.Base/Client/FlyAdIoDefineServiceClient.cs
View file @
b35abc60
...
...
@@ -33,45 +33,9 @@ namespace FLY.Thick.Base.Client
/// </summary>
/// <param name="asyncDelegate"></param>
/// <param name="asyncContext"></param>
[
Call
(
typeof
(
List
<
IODefine
>))]
public
void
GetIODefine
(
AsyncCBHandler
asyncDelegate
,
object
asyncContext
)
{
Call
(
nameof
(
GetIODefine
),
null
,
asyncDelegate
,
asyncContext
);
}
}
/// <summary>
/// 输入输出口描述
/// </summary>
public
class
IODefine
{
/// <summary>
/// 输入口?输出口?
/// </summary>
public
enum
IOTYPE
{
/// <summary>
/// 输入口
/// </summary>
Input
,
/// <summary>
/// 输出口
/// </summary>
Output
};
/// <summary>
/// 输入口?输出口?
/// </summary>
public
IOTYPE
IoType
;
/// <summary>
/// 序号,从0开始排列
/// </summary>
public
int
Index
;
/// <summary>
/// 功能表述
/// </summary>
public
string
Description
;
}
}
Project.FLY.Thick.Base/FLY.Thick.Base/Common/FlyADIODefine.cs
View file @
b35abc60
...
...
@@ -12,7 +12,15 @@ namespace FLY.Thick.Base.Common
/// </summary>
public
class
FlyADIODefine
:
IFlyAdIoDefineService
{
public
static
FlyADIODefine
Instance
{
get
;
}
=
new
FlyADIODefine
();
protected
static
FlyADIODefine
instance
;
public
static
void
SetInstance
(
FlyADIODefine
flyADIODefine
)
{
instance
=
flyADIODefine
;
}
/// <summary>
/// 子类 需要 重新 把子类对象 赋值给 Instance, 确保整个环境只用一个版本的 单例
/// </summary>
public
static
FlyADIODefine
Instance
=>
instance
;
#
region
输入口
/// <summary>
...
...
@@ -114,13 +122,15 @@ namespace FLY.Thick.Base.Common
#
endregion
private
int
version
=
2
;
/// <summary>
/// 根据AD盒的版本,设置
/// </summary>
/// <param name="version"></param>
public
virtual
void
SerVersion
(
int
version
)
{
if
(
version
==
3
)
this
.
version
=
version
;
if
(
this
.
version
==
3
)
{
InNo_Org
=
13
-
1
;
InNo_Limit_Forw
=
14
-
1
;
...
...
@@ -181,8 +191,19 @@ namespace FLY.Thick.Base.Common
public
void
GetIODefine
(
AsyncCBHandler
asyncDelegate
,
object
asyncContext
)
{
//获取全部带 Description 的属性,且名字 InNo_XXX 或 OutNo_XXX
IODefineCollection
reponse
=
new
IODefineCollection
();
List
<
IODefine
>
reponse
=
new
List
<
IODefine
>();
List
<
IODefine
>
list
=
new
List
<
IODefine
>();
reponse
.
List
=
list
;
if
(
version
==
3
)
{
reponse
.
InCount
=
16
;
reponse
.
OutCount
=
8
;
}
else
{
reponse
.
InCount
=
12
;
reponse
.
OutCount
=
4
;
}
var
inputPropertyNames
=
GetInputPropertyNames
();
var
outputPropertyNames
=
GetOutputPropertyNames
();
...
...
@@ -209,7 +230,7 @@ namespace FLY.Thick.Base.Common
Index
=
index
,
Description
=
desp
};
reponse
.
Add
(
iodefine
);
list
.
Add
(
iodefine
);
}
foreach
(
var
propertyName
in
outputPropertyNames
)
...
...
@@ -232,10 +253,10 @@ namespace FLY.Thick.Base.Common
Index
=
index
,
Description
=
desp
};
reponse
.
Add
(
iodefine
);
list
.
Add
(
iodefine
);
}
asyncDelegate
?.
Invoke
(
asyncContext
,
reponse
);
asyncDelegate
?.
Invoke
(
asyncContext
,
list
);
}
}
}
Project.FLY.Thick.Base/FLY.Thick.Base/IService/IFlyAdIoDefineService.cs
View file @
b35abc60
...
...
@@ -18,10 +18,26 @@ namespace FLY.Thick.Base.IService
/// </summary>
/// <param name="asyncDelegate"></param>
/// <param name="asyncContext"></param>
[
Call
(
typeof
(
List
<
IODefine
>
))]
[
Call
(
typeof
(
IODefineCollection
))]
void
GetIODefine
(
AsyncCBHandler
asyncDelegate
,
object
asyncContext
);
}
public
class
IODefineCollection
{
/// <summary>
/// 输入口数量
/// </summary>
public
int
InCount
;
/// <summary>
/// 输出口数量
/// </summary>
public
int
OutCount
;
/// <summary>
/// 列表
/// </summary>
public
List
<
IODefine
>
List
;
}
/// <summary>
/// 输入输出口描述
/// </summary>
...
...
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