Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit cbbfca3a
由
LN
编写于
2021-07-29 15:13:07 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
IO模块断开时手动重连
1 个父辈
9211d903
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
107 行增加
和
7 行删除
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
此文件的差异被折叠,
点击展开。
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
)
{
...
...
@@ -1124,7 +1142,7 @@ namespace OnlineStore.DeviceLibrary
conIsPro
=
false
;
}
}
public
MoveEquip
GetMoveByDId
(
int
deviceId
)
...
...
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
{
Thread
.
Sleep
(
100
);
if
(
_loop
)
Open
();
if
(
AIOAutoConSetting
.
NeedAutoConnect
())
{
Thread
.
Sleep
(
100
);
if
(
_loop
)
Open
();
}
}
}
}
...
...
source/DeviceLibrary/deviceLibrary/IO/AIOBOX/AIOBOXManager.cs
查看文件 @
cbbfca3
...
...
@@ -30,10 +30,9 @@ namespace OnlineStore.DeviceLibrary
//private object DILock = "";
//private object DOLock = "";
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
请
注册
或
登录
后发表评论