Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 96b0eb0d
由
LN
编写于
2020-08-28 13:39:54 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
扫码后休眠10ms。去掉部分task
1 个父辈
2bb2f618
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
74 行增加
和
50 行删除
source/AssemblyLineClient/FrmLineStore.cs
source/DeviceLibrary/assemblyLine/DischargeLine.cs
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
96b0eb0
...
@@ -130,6 +130,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -130,6 +130,7 @@ namespace OnlineStore.AssemblyLine
LogUtil
.
logBox
=
this
.
logBox
;
LogUtil
.
logBox
=
this
.
logBox
;
LoadOk
=
true
;
LoadOk
=
true
;
HideForm
();
HideForm
();
lastLogTime
=
DateTime
.
Now
.
AddMinutes
(-
10
);
timer1
.
Start
();
timer1
.
Start
();
}
}
...
@@ -452,7 +453,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -452,7 +453,7 @@ namespace OnlineStore.AssemblyLine
try
try
{
{
TimeSpan
sp
=
DateTime
.
Now
-
lastLogTime
;
TimeSpan
sp
=
DateTime
.
Now
-
lastLogTime
;
if
(
sp
.
TotalMinutes
>
10
)
if
(
sp
.
TotalMinutes
>
=
5
)
{
{
lastLogTime
=
DateTime
.
Now
;
lastLogTime
=
DateTime
.
Now
;
...
@@ -479,7 +480,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -479,7 +480,7 @@ namespace OnlineStore.AssemblyLine
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
{
LogM
();
LogM
();
if
(!
this
.
Visible
)
if
(!
listView1
.
Visible
)
{
{
return
;
return
;
}
}
...
...
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
96b0eb0
...
@@ -254,8 +254,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -254,8 +254,8 @@ namespace OnlineStore.DeviceLibrary
if
(!
isInSuddenDown
)
if
(!
isInSuddenDown
)
{
{
LogUtil
.
error
(
Name
+
"收到急停信号,等待300后再次验证急停"
);
LogUtil
.
error
(
Name
+
"收到急停信号,等待300后再次验证急停"
);
Task
.
Factory
.
StartNew
(
delegate
//
Task.Factory.StartNew(delegate
{
//
{
Thread
.
Sleep
(
300
);
Thread
.
Sleep
(
300
);
if
(
IOValue
(
IO_Type
.
DLine_SuddenStop
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
DLine_SuddenStop
).
Equals
(
IO_VALUE
.
LOW
))
{
{
...
@@ -263,7 +263,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -263,7 +263,7 @@ namespace OnlineStore.DeviceLibrary
Alarm
(
LineAlarmType
.
SuddenStop
);
Alarm
(
LineAlarmType
.
SuddenStop
);
return
;
return
;
}
}
});
//
});
}
}
}
}
else
if
(
IOValue
(
IO_Type
.
DLine_Reset
).
Equals
(
IO_VALUE
.
HIGH
))
else
if
(
IOValue
(
IO_Type
.
DLine_Reset
).
Equals
(
IO_VALUE
.
HIGH
))
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
96b0eb0
...
@@ -353,8 +353,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -353,8 +353,8 @@ namespace OnlineStore.DeviceLibrary
if
(!
isInSuddenDown
)
if
(!
isInSuddenDown
)
{
{
LogUtil
.
error
(
Name
+
"收到急停信号,等待300后再次验证急停"
);
LogUtil
.
error
(
Name
+
"收到急停信号,等待300后再次验证急停"
);
Task
.
Factory
.
StartNew
(
delegate
//
Task.Factory.StartNew(delegate
{
//
{
Thread
.
Sleep
(
300
);
Thread
.
Sleep
(
300
);
if
(
IOValue
(
IO_Type
.
SL_SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
SL_SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
{
...
@@ -365,7 +365,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -365,7 +365,7 @@ namespace OnlineStore.DeviceLibrary
}
}
return
;
return
;
}
}
});
//
});
}
}
}
}
else
if
(
IOValue
(
IO_Type
.
SL_Reset_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
else
if
(
IOValue
(
IO_Type
.
SL_Reset_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
...
@@ -763,14 +763,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -763,14 +763,13 @@ namespace OnlineStore.DeviceLibrary
//停止转动 ,阻挡上升
//停止转动 ,阻挡上升
IOMove
(
IO_Type
.
SL_OutSideWay_Run
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SL_OutSideWay_Run
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SL_Out_StopDown
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SL_Out_StopDown
,
IO_VALUE
.
LOW
);
AgvClient
.
SetStatus
(
Config
.
AgvOutName
,
LastOutShelfId
,
ClientAction
.
FinishLeave
,
ClientLevel
.
High
,
true
);
AgvClient
.
SetStatus
(
Config
.
AgvOutName
,
LastOutShelfId
,
ClientAction
.
FinishLeave
,
ClientLevel
.
High
,
true
);
Task
.
Factory
.
StartNew
(
delegate
{
Thread
.
Sleep
(
1000
);
Thread
.
Sleep
(
1000
);
AgvClient
.
SetStatus
(
Config
.
AgvOutName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
AgvClient
.
SetStatus
(
Config
.
AgvOutName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
});
ProcessShelfOut
=
false
;
ProcessShelfOut
=
false
;
LogUtil
.
info
(
logName
+
",停止转动,清空料架["
+
LastOutShelfId
+
"], 结束"
);
LogUtil
.
info
(
logName
+
",停止转动,清空料架["
+
LastOutShelfId
+
"], 结束"
);
}
}
else
else
{
{
...
@@ -844,11 +843,9 @@ namespace OnlineStore.DeviceLibrary
...
@@ -844,11 +843,9 @@ namespace OnlineStore.DeviceLibrary
}
}
//料架可离开
//料架可离开
AgvClient
.
SetStatus
(
Config
.
AgvInName
,
""
,
ClientAction
.
FinishEnter
,
ClientLevel
.
High
,
true
);
AgvClient
.
SetStatus
(
Config
.
AgvInName
,
""
,
ClientAction
.
FinishEnter
,
ClientLevel
.
High
,
true
);
Task
.
Factory
.
StartNew
(
delegate
{
Thread
.
Sleep
(
1000
);
Thread
.
Sleep
(
1000
);
AgvClient
.
SetStatus
(
Config
.
AgvInName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
AgvClient
.
SetStatus
(
Config
.
AgvInName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
});
ProcessShelfEnter
=
false
;
ProcessShelfEnter
=
false
;
LogUtil
.
info
(
logName
+
" 结束"
);
LogUtil
.
info
(
logName
+
" 结束"
);
}
}
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
96b0eb0
...
@@ -758,19 +758,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -758,19 +758,19 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_13_ScanCode
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_13_ScanCode
))
{
{
if
(
ScanCodeTask
==
null
||
ScanCodeTask
.
IsCompleted
)
//
if (ScanCodeTask == null || ScanCodeTask.IsCompleted)
{
//
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_14_CylinderTake
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
FI_14_CylinderTake
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":上料横移取料端"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":上料横移取料端"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Give
,
IO_Type
.
SL_MoveCylinder_Take
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Give
,
IO_Type
.
SL_MoveCylinder_Take
);
ClearTimeoutAlarm
(
"扫码执行结束超时"
);
ClearTimeoutAlarm
(
"扫码执行结束超时"
);
}
//
}
else
if
(
MoveInfo
.
IsTimeOut
(
60
))
//
else if (MoveInfo.IsTimeOut(60))
{
//
{
WarnMsg
=
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveStep
+
"] 扫码执行结束超时 ["
+
Math
.
Round
(
MoveInfo
.
StepSpan
().
TotalSeconds
,
1
)
+
"]秒"
;
//
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveStep + "] 扫码执行结束超时 [" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil
.
error
(
WarnMsg
,
DeviceID
*
1000
+
30
);
//
LogUtil.error(WarnMsg, DeviceID * 1000 + 30);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
//
Alarm(LineAlarmType.IoSingleTimeOut);
}
//
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_14_CylinderTake
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_14_CylinderTake
))
{
{
...
@@ -1229,7 +1229,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1229,7 +1229,7 @@ namespace OnlineStore.DeviceLibrary
{
{
Task
<
List
<
string
>>
scanTask
=
Task
.
Factory
.
StartNew
(
delegate
Task
<
List
<
string
>>
scanTask
=
Task
.
Factory
.
StartNew
(
delegate
{
{
Thread
.
Sleep
(
5
00
);
Thread
.
Sleep
(
1
00
);
NextCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
.
Trim
()+
"预扫码"
);
NextCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
.
Trim
()+
"预扫码"
);
bool
isCanUse
=
true
;
bool
isCanUse
=
true
;
//判断是否可用
//判断是否可用
...
@@ -1278,7 +1278,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1278,7 +1278,7 @@ namespace OnlineStore.DeviceLibrary
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
CylinderMove
(
MoveInfo
,
IO_Type
.
SL_MoveCylinder_Down
,
IO_Type
.
SL_MoveCylinder_Up
);
}
}
}
}
private
Task
ScanCodeTask
=
null
;
//
private Task ScanCodeTask = null;
private
void
FI_13_ScanCode
()
private
void
FI_13_ScanCode
()
{
{
if
(
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Give
))
if
(
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Take
,
IO_Type
.
SL_MoveCylinder_Give
))
...
@@ -1288,7 +1288,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1288,7 +1288,7 @@ namespace OnlineStore.DeviceLibrary
LastCodeList
=
new
List
<
string
>();
LastCodeList
=
new
List
<
string
>();
ScanCodeTask
=
null
;
//
ScanCodeTask = null;
if
(
NextCodeList
.
Count
>
0
)
if
(
NextCodeList
.
Count
>
0
)
{
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码:使用预扫码"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码:使用预扫码"
);
...
@@ -1304,24 +1304,28 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1304,24 +1304,28 @@ namespace OnlineStore.DeviceLibrary
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码"
);
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
OneWaitCanEndStep
=
true
;
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitFeedScanCode
());
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitFeedScanCode
());
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
7
000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
20
000
));
try
try
{
{
ScanCodeTask
=
Task
.
Factory
.
StartNew
(
delegate
//
ScanCodeTask = Task.Factory.StartNew(delegate
{
//
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
);
bool
hasRightCode
=
CodeManager
.
HasRightCode
(
LastCodeList
.
ToArray
());
bool
hasRightCode
=
CodeManager
.
HasRightCode
(
LastCodeList
.
ToArray
());
if
(!
hasRightCode
)
if
(!
hasRightCode
)
{
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
,
false
,
3000
);
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
,
false
,
3000
);
}
}
return
LastCodeList
;
//
return LastCodeList;
});
//
});
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
LogUtil
.
error
(
"FI_13_ScanCode扫码出错:"
,
ex
);
LogUtil
.
error
(
"FI_13_ScanCode扫码出错:"
,
ex
);
}
}
finally
{
MoveInfo
.
EndStepWait
();
}
}
}
else
else
{
{
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
查看文件 @
96b0eb0
...
@@ -669,15 +669,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -669,15 +669,14 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
OutLog
(
outType
+
MoveInfo
.
SLog
+
":移栽伺服上升到待机点P1,通知服务器 afterPutCut"
);
OutLog
(
outType
+
MoveInfo
.
SLog
+
":移栽伺服上升到待机点P1,通知服务器 afterPutCut"
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxisP1
,
Config
.
UpdownAxis_P1Speed
);
UpdownAxis
.
AbsMove
(
MoveInfo
,
Config
.
UpDownAxisP1
,
Config
.
UpdownAxis_P1Speed
);
Task
.
Factory
.
StartNew
(
delegate
afterPutOk
=
false
;
{
string
msg
=
SServerManager
.
afterPutCut
(
Name
,
CurrShelfId
,
MoveInfo
.
MoveParam
.
WareCode
,
""
,
OutStoreCount
,
out
taskData
);
string
msg
=
SServerManager
.
afterPutCut
(
Name
,
CurrShelfId
,
MoveInfo
.
MoveParam
.
WareCode
,
""
,
OutStoreCount
,
out
taskData
);
if
(
String
.
IsNullOrEmpty
(
msg
).
Equals
(
false
))
if
(
String
.
IsNullOrEmpty
(
msg
).
Equals
(
false
))
{
{
LogUtil
.
error
(
Name
+
"【"
+
MoveInfo
.
MoveParam
.
WareCode
+
"】【"
+
CurrShelfId
+
"】【"
+
OutStoreCount
.
ToString
()
+
"】afterPutCut 结果:"
+
msg
);
LogUtil
.
error
(
Name
+
"【"
+
MoveInfo
.
MoveParam
.
WareCode
+
"】【"
+
CurrShelfId
+
"】【"
+
OutStoreCount
.
ToString
()
+
"】afterPutCut 结果:"
+
msg
);
taskData
=
null
;
taskData
=
null
;
}
}
})
;
afterPutOk
=
true
;
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_221_UpdownAxisToP1
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_221_UpdownAxisToP1
))
{
{
...
@@ -706,6 +705,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -706,6 +705,8 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_222_CylinderTake
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_222_CylinderTake
))
{
{
if
(
afterPutOk
)
{
//出库结束 TODO
//出库结束 TODO
// bool isNeedSendShelf = false;
// bool isNeedSendShelf = false;
//判断料架是否满了
//判断料架是否满了
...
@@ -741,7 +742,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -741,7 +742,15 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
}
}
else
if
(
MoveInfo
.
IsTimeOut
(
60
))
{
WarnMsg
=
SecondMoveInfo
.
Name
+
"["
+
SecondMoveInfo
.
MoveStep
+
"] 等待给服务器发送afterPut完成超时 ["
+
Math
.
Round
(
MoveInfo
.
StepSpan
().
TotalSeconds
,
1
)
+
"]秒"
;
LogUtil
.
error
(
WarnMsg
,
DeviceID
*
1000
+
21
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
}
}
}
}
private
bool
afterPutOk
=
false
;
private
void
FO_214_CylinderDown
(
string
outType
)
private
void
FO_214_CylinderDown
(
string
outType
)
{
{
if
(
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Up
,
IO_Type
.
SL_MoveCylinder_Down
))
if
(
CylinderIsOk
(
IO_Type
.
SL_MoveCylinder_Up
,
IO_Type
.
SL_MoveCylinder_Down
))
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
96b0eb0
...
@@ -686,15 +686,15 @@ namespace OnlineStore.DeviceLibrary
...
@@ -686,15 +686,15 @@ namespace OnlineStore.DeviceLibrary
if
(
isInSuddenDown
.
Equals
(
false
))
if
(
isInSuddenDown
.
Equals
(
false
))
{
{
LogUtil
.
error
(
Name
+
"收到急停信号,等待300后再次验证急停"
);
LogUtil
.
error
(
Name
+
"收到急停信号,等待300后再次验证急停"
);
Task
.
Factory
.
StartNew
(
delegate
//
Task.Factory.StartNew(delegate
{
//
{
Thread
.
Sleep
(
300
);
Thread
.
Sleep
(
300
);
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
{
SetWarnMsg
(
"收到急停信号,报警急停"
);
SetWarnMsg
(
"收到急停信号,报警急停"
);
Alarm
(
LineAlarmType
.
SuddenStop
);
Alarm
(
LineAlarmType
.
SuddenStop
);
}
}
});
//
});
}
}
}
}
else
if
(
fuweiValue
.
Equals
(
IO_VALUE
.
HIGH
)
&&
(!
fuweiValue
.
Equals
(
lastFuwei
)))
else
if
(
fuweiValue
.
Equals
(
IO_VALUE
.
HIGH
)
&&
(!
fuweiValue
.
Equals
(
lastFuwei
)))
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
96b0eb0
...
@@ -555,10 +555,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -555,10 +555,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
Name
+
"托盘号【"
+
currTrayNum
+
"】入库信息【"
+
currCode
.
ToStr
()
+
"】料仓未验证成功,不拦截托盘,更新此托盘为NG,从waitInStoreList中删除,取消入库任务"
);
LogUtil
.
error
(
Name
+
"托盘号【"
+
currTrayNum
+
"】入库信息【"
+
currCode
.
ToStr
()
+
"】料仓未验证成功,不拦截托盘,更新此托盘为NG,从waitInStoreList中删除,取消入库任务"
);
TrayManager
.
UpdateInStoreNG
(
currTrayNum
,
true
,
"Box验证入库失败"
);
TrayManager
.
UpdateInStoreNG
(
currTrayNum
,
true
,
"Box验证入库失败"
);
waitInStoreList
.
RemoveAt
(
reIndex
);
waitInStoreList
.
RemoveAt
(
reIndex
);
Task
.
Factory
.
StartNew
(
delegate
{
SServerManager
.
cancelPutInTask
(
Name
,
currCode
.
WareCode
);
SServerManager
.
cancelPutInTask
(
Name
,
currCode
.
WareCode
);
});
return
false
;
return
false
;
}
}
...
@@ -763,7 +760,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -763,7 +760,7 @@ namespace OnlineStore.DeviceLibrary
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_06_TopUp
))
else
if
(
SecondMoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MIO_06_TopUp
))
{
{
CheckLog
(
"托盘阻挡*************** 托盘号【"
+
currTrayNum
+
"】"
);
CheckLog
(
"托盘阻挡*************** 托盘号【"
+
currTrayNum
+
"】"
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
//托盘号正确
//托盘号正确
//preTrayNum = num;
//preTrayNum = num;
bool
isNeedMove
=
false
;
bool
isNeedMove
=
false
;
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
96b0eb0
...
@@ -639,8 +639,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -639,8 +639,7 @@ namespace OnlineStore.DeviceLibrary
if
(
MoveInfo
.
MoveParam
.
urgentReel
&&
this
.
Config
.
SidesWayNum
.
Equals
(
4
))
if
(
MoveInfo
.
MoveParam
.
urgentReel
&&
this
.
Config
.
SidesWayNum
.
Equals
(
4
))
{
{
Task
.
Factory
.
StartNew
(
delegate
afterPutCutOK
=
false
;
{
OutLog
(
"出料:"
+
MoveInfo
.
SLog
+
",紧急料,且SidesWayNum=4,发送 afterPutCut"
);
OutLog
(
"出料:"
+
MoveInfo
.
SLog
+
",紧急料,且SidesWayNum=4,发送 afterPutCut"
);
TaskData
taskData
;
TaskData
taskData
;
string
shefId
=
"BN"
;
string
shefId
=
"BN"
;
...
@@ -651,7 +650,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -651,7 +650,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
Name
+
"【"
+
MoveInfo
.
MoveParam
.
WareCode
+
"】【"
+
shefId
+
"】【"
+
ShelfLoc
.
ToString
()
+
"】afterPutCut 结果:"
+
msg
);
LogUtil
.
error
(
Name
+
"【"
+
MoveInfo
.
MoveParam
.
WareCode
+
"】【"
+
shefId
+
"】【"
+
ShelfLoc
.
ToString
()
+
"】afterPutCut 结果:"
+
msg
);
taskData
=
null
;
taskData
=
null
;
}
}
});
afterPutCutOK
=
true
;
}
else
{
afterPutCutOK
=
true
;
}
}
}
}
else
if
(
MoveInfo
.
IsTimeOut
())
else
if
(
MoveInfo
.
IsTimeOut
())
...
@@ -692,10 +695,20 @@ namespace OnlineStore.DeviceLibrary
...
@@ -692,10 +695,20 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_10_CylinderAfter
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
PO_10_CylinderAfter
))
{
{
if
(
afterPutCutOK
)
{
OutLog
(
"出料【"
+
posId
+
"】处理完成!"
);
OutLog
(
"出料【"
+
posId
+
"】处理完成!"
);
MoveEndS
();
MoveEndS
();
}
}
else
if
(
MoveInfo
.
IsTimeOut
(
60
))
{
WarnMsg
=
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveType
+
"]["
+
MoveInfo
.
MoveStep
+
"]等待 给服务器发送afterPutCutTask完成 "
+
"超时["
+
Math
.
Round
(
MoveInfo
.
StepSpan
().
TotalSeconds
,
1
)
+
"]秒"
;
LogUtil
.
error
(
WarnMsg
,
DeviceID
*
1000
+
20
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
}
}
}
}
private
bool
afterPutCutOK
=
false
;
private
OutTrayLineBean
GetDisLine
()
private
OutTrayLineBean
GetDisLine
()
{
{
try
try
...
...
source/DeviceLibrary/deviceLibrary/halcon/CodeManager.cs
查看文件 @
96b0eb0
...
@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary
private
static
int
ScanCount
=
0
;
private
static
int
ScanCount
=
0
;
private
static
int
codeCount
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
CodeCount
);
private
static
int
codeCount
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
CodeCount
);
[
HandleProcessCorruptedStateExceptions
]
[
HandleProcessCorruptedStateExceptions
]
public
static
List
<
string
>
CameraScan
(
List
<
string
>
cameraList
,
string
deviceName
,
bool
findRightCodeBreak
=
false
,
int
timeOut
=
1500
)
public
static
List
<
string
>
CameraScan
(
List
<
string
>
cameraList
,
string
deviceName
,
bool
findRightCodeBreak
=
false
,
int
timeOut
=
1500
)
{
{
List
<
string
>
codeList
=
new
List
<
string
>();
List
<
string
>
codeList
=
new
List
<
string
>();
if
(
cameraList
==
null
||
cameraList
.
Count
<=
0
)
if
(
cameraList
==
null
||
cameraList
.
Count
<=
0
)
...
@@ -123,8 +123,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -123,8 +123,8 @@ namespace OnlineStore.DeviceLibrary
bool
findRightCode
=
false
;
bool
findRightCode
=
false
;
try
try
{
{
ho_Image
=
Camera
.
_cam
.
CaptureOnImage
(
cameraName
);
bool
result
=
Camera
.
_cam
.
CaptureOnImage
(
cameraName
,
out
ho_Image
);
if
(
ho_Image
==
null
)
if
(
!
result
||
ho_Image
==
null
)
{
{
LogUtil
.
error
(
deviceName
+
" 【"
+
cameraName
+
"】取图片失败["
+
Camera
.
_cam
.
ErrInfo
+
"],关闭相机"
);
LogUtil
.
error
(
deviceName
+
" 【"
+
cameraName
+
"】取图片失败["
+
Camera
.
_cam
.
ErrInfo
+
"],关闭相机"
);
CloseCamera
(
cameraName
);
CloseCamera
(
cameraName
);
...
@@ -159,7 +159,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -159,7 +159,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
if
(
findRightCodeBreak
&&
findRightCode
)
if
(
findRightCodeBreak
&&
findRightCode
)
{
{
break
;
break
;
}
}
...
@@ -190,8 +190,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -190,8 +190,11 @@ namespace OnlineStore.DeviceLibrary
ho_Image
.
Dispose
();
ho_Image
.
Dispose
();
ho_Image
=
null
;
ho_Image
=
null
;
}
}
// GC.Collect();
Thread
.
Sleep
(
10
);
}
}
}
}
}
}
catch
(
AccessViolationException
e
)
catch
(
AccessViolationException
e
)
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论