Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit cbbfca3a
由
LN
编写于
2021-07-29 15:13:07 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
IO模块断开时手动重连
1 个父辈
9211d903
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
161 行增加
和
45 行删除
source/AssemblyLineClient/FrmLineStore.Designer.cs
source/AssemblyLineClient/FrmLineStore.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOAutoConSetting.cs
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOBOX.cs
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOBOXManager.cs
source/DeviceLibrary/deviceLibrary/IO/IOManager.cs
source/AssemblyLineClient/FrmLineStore.Designer.cs
查看文件 @
cbbfca3
...
...
@@ -32,13 +32,14 @@
System
.
ComponentModel
.
ComponentResourceManager
resources
=
new
System
.
ComponentModel
.
ComponentResourceManager
(
typeof
(
FrmLineStore
));
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
chbSaveImage
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
numTrayNum
=
new
System
.
Windows
.
Forms
.
NumericUpDown
();
this
.
btnClear
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
label10
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblSelTrayNum
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
panel1
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
chbSaveImage
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
btnIOAutoCon
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnShunt2Reset
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnShuntReset
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
...
...
@@ -88,10 +89,10 @@
this
.
toolStripSeparator6
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
二维码学习
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator7
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
iO
模块状态
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator9
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
toolStripMenuItem3
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
托盘初始化
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator9
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
iO
模块状态
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator14
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
查看托盘信息
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator12
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
...
...
@@ -147,6 +148,7 @@
//
// tabPage1
//
this
.
tabPage1
.
Controls
.
Add
(
this
.
chbSaveImage
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
groupBox1
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
panel1
);
this
.
tabPage1
.
Controls
.
Add
(
this
.
groupBox2
);
...
...
@@ -162,6 +164,19 @@
this
.
tabPage1
.
Text
=
"状态信息"
;
this
.
tabPage1
.
UseVisualStyleBackColor
=
true
;
//
// chbSaveImage
//
this
.
chbSaveImage
.
AutoSize
=
true
;
this
.
chbSaveImage
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbSaveImage
.
Location
=
new
System
.
Drawing
.
Point
(
1201
,
150
);
this
.
chbSaveImage
.
Name
=
"chbSaveImage"
;
this
.
chbSaveImage
.
Size
=
new
System
.
Drawing
.
Size
(
112
,
24
);
this
.
chbSaveImage
.
TabIndex
=
203
;
this
.
chbSaveImage
.
Text
=
"保存扫码图片"
;
this
.
chbSaveImage
.
UseVisualStyleBackColor
=
true
;
this
.
chbSaveImage
.
Visible
=
false
;
this
.
chbSaveImage
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
chbSaveImage_CheckedChanged
);
//
// groupBox1
//
this
.
groupBox1
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)(((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
...
...
@@ -170,7 +185,7 @@
this
.
groupBox1
.
Controls
.
Add
(
this
.
btnClear
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
label10
);
this
.
groupBox1
.
Controls
.
Add
(
this
.
lblSelTrayNum
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
720
,
1
48
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
720
,
1
69
);
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
602
,
81
);
this
.
groupBox1
.
TabIndex
=
284
;
...
...
@@ -221,32 +236,33 @@
//
// panel1
//
this
.
panel1
.
Controls
.
Add
(
this
.
chbSaveImage
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnIOAutoCon
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnShunt2Reset
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnShuntReset
);
this
.
panel1
.
Location
=
new
System
.
Drawing
.
Point
(
720
,
4
);
this
.
panel1
.
Name
=
"panel1"
;
this
.
panel1
.
Size
=
new
System
.
Drawing
.
Size
(
165
,
1
4
0
);
this
.
panel1
.
Size
=
new
System
.
Drawing
.
Size
(
165
,
1
6
0
);
this
.
panel1
.
TabIndex
=
199
;
//
//
chbSaveImage
//
btnIOAutoCon
//
this
.
chbSaveImage
.
AutoSize
=
true
;
this
.
chbSaveImage
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
chbSaveImage
.
Location
=
new
System
.
Drawing
.
Point
(
16
,
10
);
this
.
chbSaveImage
.
Name
=
"chbSaveImage"
;
this
.
chbSaveImage
.
Size
=
new
System
.
Drawing
.
Size
(
112
,
24
);
this
.
chbSaveImage
.
TabIndex
=
203
;
this
.
chbSaveImage
.
Text
=
"保存扫码图片"
;
this
.
chbSaveImage
.
UseVisualStyleBackColor
=
true
;
this
.
chbSaveImage
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
chbSaveImage_CheckedChanged
);
this
.
btnIOAutoCon
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnIOAutoCon
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnIOAutoCon
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnIOAutoCon
.
Location
=
new
System
.
Drawing
.
Point
(
16
,
105
);
this
.
btnIOAutoCon
.
Name
=
"btnIOAutoCon"
;
this
.
btnIOAutoCon
.
Size
=
new
System
.
Drawing
.
Size
(
133
,
40
);
this
.
btnIOAutoCon
.
TabIndex
=
202
;
this
.
btnIOAutoCon
.
Text
=
"开始重连IO模块"
;
this
.
btnIOAutoCon
.
UseVisualStyleBackColor
=
false
;
this
.
btnIOAutoCon
.
Click
+=
new
System
.
EventHandler
(
this
.
btnIOAutoCon_Click
);
//
// btnShunt2Reset
//
this
.
btnShunt2Reset
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnShunt2Reset
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnShunt2Reset
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnShunt2Reset
.
Location
=
new
System
.
Drawing
.
Point
(
16
,
8
8
);
this
.
btnShunt2Reset
.
Location
=
new
System
.
Drawing
.
Point
(
16
,
5
8
);
this
.
btnShunt2Reset
.
Name
=
"btnShunt2Reset"
;
this
.
btnShunt2Reset
.
Size
=
new
System
.
Drawing
.
Size
(
133
,
40
);
this
.
btnShunt2Reset
.
TabIndex
=
201
;
...
...
@@ -259,7 +275,7 @@
this
.
btnShuntReset
.
BackColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnShuntReset
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnShuntReset
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
10.5F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnShuntReset
.
Location
=
new
System
.
Drawing
.
Point
(
16
,
4
1
);
this
.
btnShuntReset
.
Location
=
new
System
.
Drawing
.
Point
(
16
,
1
1
);
this
.
btnShuntReset
.
Name
=
"btnShuntReset"
;
this
.
btnShuntReset
.
Size
=
new
System
.
Drawing
.
Size
(
133
,
40
);
this
.
btnShuntReset
.
TabIndex
=
199
;
...
...
@@ -415,9 +431,9 @@
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
logBox
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
logBox
.
Location
=
new
System
.
Drawing
.
Point
(
720
,
2
35
);
this
.
logBox
.
Location
=
new
System
.
Drawing
.
Point
(
720
,
2
53
);
this
.
logBox
.
Name
=
"logBox"
;
this
.
logBox
.
Size
=
new
System
.
Drawing
.
Size
(
600
,
3
71
);
this
.
logBox
.
Size
=
new
System
.
Drawing
.
Size
(
600
,
3
53
);
this
.
logBox
.
TabIndex
=
106
;
this
.
logBox
.
Text
=
""
;
this
.
logBox
.
VisibleChanged
+=
new
System
.
EventHandler
(
this
.
logBox_VisibleChanged
);
...
...
@@ -716,69 +732,69 @@
// toolStripSeparator6
//
this
.
toolStripSeparator6
.
Name
=
"toolStripSeparator6"
;
this
.
toolStripSeparator6
.
Size
=
new
System
.
Drawing
.
Size
(
17
7
,
6
);
this
.
toolStripSeparator6
.
Size
=
new
System
.
Drawing
.
Size
(
17
3
,
6
);
this
.
toolStripSeparator6
.
Visible
=
false
;
//
// 二维码学习ToolStripMenuItem
//
this
.
二维码学习
ToolStripMenuItem
.
Name
=
"二维码学习ToolStripMenuItem"
;
this
.
二维码学习
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
二维码学习
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
76
,
26
);
this
.
二维码学习
ToolStripMenuItem
.
Text
=
"二维码学习"
;
this
.
二维码学习
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
二维码学习
ToolStripMenuItem_Click
);
//
// toolStripSeparator7
//
this
.
toolStripSeparator7
.
Name
=
"toolStripSeparator7"
;
this
.
toolStripSeparator7
.
Size
=
new
System
.
Drawing
.
Size
(
177
,
6
);
this
.
toolStripSeparator7
.
Size
=
new
System
.
Drawing
.
Size
(
173
,
6
);
//
// iO模块状态ToolStripMenuItem
//
this
.
iO
模块状态
ToolStripMenuItem
.
Name
=
"iO模块状态ToolStripMenuItem"
;
this
.
iO
模块状态
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
176
,
26
);
this
.
iO
模块状态
ToolStripMenuItem
.
Text
=
"IO模块状态"
;
this
.
iO
模块状态
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
iO
模块状态
ToolStripMenuItem_Click
);
//
// toolStripSeparator9
//
this
.
toolStripSeparator9
.
Name
=
"toolStripSeparator9"
;
this
.
toolStripSeparator9
.
Size
=
new
System
.
Drawing
.
Size
(
173
,
6
);
//
// toolStripMenuItem3
//
this
.
toolStripMenuItem3
.
Name
=
"toolStripMenuItem3"
;
this
.
toolStripMenuItem3
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
toolStripMenuItem3
.
Size
=
new
System
.
Drawing
.
Size
(
1
76
,
26
);
this
.
toolStripMenuItem3
.
Text
=
"查看禁用托盘"
;
this
.
toolStripMenuItem3
.
Click
+=
new
System
.
EventHandler
(
this
.
toolStripMenuItem3_Click
);
//
// 托盘初始化ToolStripMenuItem
//
this
.
托盘初始化
ToolStripMenuItem
.
Name
=
"托盘初始化ToolStripMenuItem"
;
this
.
托盘初始化
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
托盘初始化
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
76
,
26
);
this
.
托盘初始化
ToolStripMenuItem
.
Text
=
"托盘编码"
;
this
.
托盘初始化
ToolStripMenuItem
.
Visible
=
false
;
this
.
托盘初始化
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
托盘初始化
ToolStripMenuItem_Click
);
//
// toolStripSeparator9
//
this
.
toolStripSeparator9
.
Name
=
"toolStripSeparator9"
;
this
.
toolStripSeparator9
.
Size
=
new
System
.
Drawing
.
Size
(
177
,
6
);
//
// iO模块状态ToolStripMenuItem
//
this
.
iO
模块状态
ToolStripMenuItem
.
Name
=
"iO模块状态ToolStripMenuItem"
;
this
.
iO
模块状态
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
180
,
26
);
this
.
iO
模块状态
ToolStripMenuItem
.
Text
=
"IO模块状态"
;
this
.
iO
模块状态
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
iO
模块状态
ToolStripMenuItem_Click
);
//
// toolStripSeparator14
//
this
.
toolStripSeparator14
.
Name
=
"toolStripSeparator14"
;
this
.
toolStripSeparator14
.
Size
=
new
System
.
Drawing
.
Size
(
17
7
,
6
);
this
.
toolStripSeparator14
.
Size
=
new
System
.
Drawing
.
Size
(
17
3
,
6
);
//
// 查看托盘信息ToolStripMenuItem
//
this
.
查看托盘信息
ToolStripMenuItem
.
Name
=
"查看托盘信息ToolStripMenuItem"
;
this
.
查看托盘信息
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
查看托盘信息
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
76
,
26
);
this
.
查看托盘信息
ToolStripMenuItem
.
Text
=
"查看托盘信息"
;
this
.
查看托盘信息
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
btnTrayInfo_Click
);
//
// toolStripSeparator12
//
this
.
toolStripSeparator12
.
Name
=
"toolStripSeparator12"
;
this
.
toolStripSeparator12
.
Size
=
new
System
.
Drawing
.
Size
(
17
7
,
6
);
this
.
toolStripSeparator12
.
Size
=
new
System
.
Drawing
.
Size
(
17
3
,
6
);
//
// 清空托盘信息ToolStripMenuItem
//
this
.
清空托盘信息
ToolStripMenuItem
.
Name
=
"清空托盘信息ToolStripMenuItem"
;
this
.
清空托盘信息
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
清空托盘信息
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
76
,
26
);
this
.
清空托盘信息
ToolStripMenuItem
.
Text
=
"清空托盘信息"
;
this
.
清空托盘信息
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
清空托盘信息
ToolStripMenuItem_Click
);
//
...
...
@@ -952,7 +968,6 @@
this
.
groupBox1
.
PerformLayout
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
numTrayNum
)).
EndInit
();
this
.
panel1
.
ResumeLayout
(
false
);
this
.
panel1
.
PerformLayout
();
this
.
groupBox2
.
ResumeLayout
(
false
);
this
.
groupBox2
.
PerformLayout
();
this
.
groupBox3
.
ResumeLayout
(
false
);
...
...
@@ -1054,6 +1069,7 @@
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
启用分流横移
2
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripSeparator
toolStripSeparator19
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
自动保存托盘信息
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
Button
btnIOAutoCon
;
}
}
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
cbbfca3
...
...
@@ -558,6 +558,7 @@ namespace OnlineStore.AssemblyLine
{
aGVCancelStateToolStripMenuItem
.
Text
=
"AGV cancelState"
;
}
btnIOAutoCon
.
Enabled
=
(
AIOAutoConSetting
.
autoConnect
.
Equals
(
false
));
lblStatus
.
Text
=
lineBean
.
GetRunStr
()
+
canScanCode
;
string
time
=
LineManager
.
Line
.
alarmType
.
Equals
(
LineAlarmType
.
None
)
?
""
:
LineManager
.
Line
.
LastAlarmTime
.
ToLongTimeString
();
string
warnMsg
=
LineManager
.
Line
.
WarnMsg
.
Equals
(
""
)
?
""
:
time
+
LineManager
.
Line
.
WarnMsg
+
"\r\n"
;
...
...
@@ -567,7 +568,10 @@ namespace OnlineStore.AssemblyLine
{
warnMsg
+=
TrayManager
.
TrayErrorMsg
+
"\r\n"
;
}
if
(
lineBean
.
IOErrorMsg
.
Equals
(
""
).
Equals
(
false
))
{
warnMsg
+=
lineBean
.
IOErrorMsg
+
"\r\n"
;
}
foreach
(
EquipBase
move
in
lineBean
.
AllEquipMap
.
Values
)
{
if
(
move
.
WarnMsg
.
Equals
(
""
).
Equals
(
false
))
...
...
@@ -1340,5 +1344,11 @@ namespace OnlineStore.AssemblyLine
}
LogUtil
.
info
(
Name
+
" 点击:"
+
自动保存托盘信息
ToolStripMenuItem
.
Text
);
}
private
void
btnIOAutoCon_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
"用户点击了:"
+
btnIOAutoCon
.
Text
);
AIOAutoConSetting
.
SetAutoConnect
(
true
,
3
);
}
}
}
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
cbbfca3
...
...
@@ -87,6 +87,7 @@
<Compile Include="baan\AxisBean.cs" />
<Compile Include="baan\WaitUtil.cs" />
<Compile Include="deviceLibrary\halcon\CodeManager.cs" />
<Compile Include="deviceLibrary\IO\AIOBOX\AIOAutoConSetting.cs" />
<Compile Include="deviceLibrary\IO\AIOBOX\AIOBOX.cs" />
<Compile Include="deviceLibrary\IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="deviceLibrary\IO\IOManager.cs" />
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
cbbfca3
...
...
@@ -47,6 +47,8 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public
Line_Config
Config
{
get
;
set
;
}
public
string
IOErrorMsg
=
""
;
#
region
初始化
public
List
<
string
>
cioList
=
new
List
<
string
>();
// public List<string> rfidList = new List<string>();
...
...
@@ -59,6 +61,8 @@ namespace OnlineStore.DeviceLibrary
{
lineConfig
.
IOSingle_TimerOut
=
5000
;
}
AIOAutoConSetting
.
SetAutoConnect
(
true
,
0
);
Init
();
InitTimer
();
baseConfig
=
lineConfig
;
...
...
@@ -991,6 +995,8 @@ namespace OnlineStore.DeviceLibrary
}
msg
=
moveEquip
.
Name
+
"复位结束"
;
isOk
=
false
;
AIOAutoConSetting
.
SetAutoConnect
(
false
);
LogUtil
.
info
(
"环形线复位结束,设置IO模块自动连接=false"
);
break
;
}
else
...
...
@@ -1093,6 +1099,18 @@ namespace OnlineStore.DeviceLibrary
{
alarmList
.
Add
(
new
AlarmMsg
(
Name
,
"line."
+
alarmType
,
WarnMsg
));
}
string
ioMsg
=
AIOBOXManager
.
instance
.
GetIoErrorMsg
();
if
(!
IOErrorMsg
.
Equals
(
ioMsg
))
{
LogUtil
.
info
(
$
"IO模块报警变化:[{IOErrorMsg}]->[{ioMsg}]"
);
IOErrorMsg
=
ioMsg
;
}
if
(
String
.
IsNullOrEmpty
(
IOErrorMsg
).
Equals
(
false
))
{
alarmList
.
Add
(
new
AlarmMsg
(
Name
,
"line.IO"
,
IOErrorMsg
));
}
int
num
=
TrayDisableManager
.
GetDisableList
().
Count
;
if
(
num
>=
5
)
{
...
...
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOAutoConSetting.cs
0 → 100644
查看文件 @
cbbfca3
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
public
class
AIOAutoConSetting
{
public
static
bool
autoConnect
=
true
;
private
static
DateTime
StartAutoConTime
=
DateTime
.
Now
;
private
static
int
AutoMinutes
=
-
1
;
public
static
void
SetAutoConnect
(
bool
autoCon
,
int
minute
=
0
)
{
autoConnect
=
autoCon
;
StartAutoConTime
=
DateTime
.
Now
;
AutoMinutes
=
minute
;
LogUtil
.
info
(
$
"AIOAutoConSetting:autoCon={autoCon},minute={minute}"
);
}
public
static
bool
NeedAutoConnect
()
{
if
(
autoConnect
)
{
if
(
AutoMinutes
<=
0
)
{
return
true
;
}
DateTime
endConTime
=
StartAutoConTime
.
AddMinutes
(
AutoMinutes
);
if
(
DateTime
.
Now
<=
endConTime
)
{
return
true
;
}
else
{
autoConnect
=
false
;
LogUtil
.
info
(
$
"AIOAutoConSetting:StartAutoConTime={StartAutoConTime},minute={AutoMinutes},自动重连IO模块结束"
);
}
}
return
false
;
}
}
}
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOBOX.cs
查看文件 @
cbbfca3
using
OnlineStore.Common
;
using
OnlineStore.DeviceLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Net
;
...
...
@@ -620,8 +621,12 @@ namespace Asa.IOModule
}
else
{
if
(
AIOAutoConSetting
.
NeedAutoConnect
())
{
Thread
.
Sleep
(
100
);
if
(
_loop
)
Open
();
}
}
}
}
...
...
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOBOXManager.cs
查看文件 @
cbbfca3
...
...
@@ -33,7 +33,6 @@ namespace OnlineStore.DeviceLibrary
public
override
void
ConnectionIOList
(
List
<
string
>
DIONameList
)
{
foreach
(
string
ip
in
DIONameList
)
{
ConnectionIP
(
ip
);
...
...
@@ -41,7 +40,23 @@ namespace OnlineStore.DeviceLibrary
}
private
bool
isProcess
=
false
;
private
DateTime
lastTime
=
DateTime
.
Now
;
public
override
string
GetIoErrorMsg
()
{
string
msg
=
""
;
List
<
AIOBOX
>
lists
=
new
List
<
AIOBOX
>(
AIOMap
.
Values
);
foreach
(
AIOBOX
aio
in
lists
)
{
if
(!
aio
.
IsConn
)
{
msg
+=
$
"[{aio.IP}]"
;
}
}
if
(!
String
.
IsNullOrEmpty
(
msg
))
{
msg
=
"IO模块"
+
msg
+
"未连接"
;
}
return
msg
;
}
public
void
ConnectionIP
(
string
ioIp
)
{
AIOBOX
aioBox
=
null
;
...
...
source/DeviceLibrary/deviceLibrary/IO/IOManager.cs
查看文件 @
cbbfca3
...
...
@@ -203,5 +203,7 @@ namespace OnlineStore.DeviceLibrary
public
abstract
bool
IsConnect
(
string
ip
);
public
abstract
string
GetIoErrorMsg
();
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论