Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 29861c1c
由
LN
编写于
2020-07-15 10:35:00 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加TaskCreationOptions.LongRunning
1 个父辈
254bf6bb
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
39 行增加
和
41 行删除
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/OutTrayLineBean.cs
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
source/DeviceLibrary/model/KTK_Store.cs
source/DeviceLibrary/assemblyLine/DischargeLine.cs
查看文件 @
29861c1
...
@@ -263,7 +263,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -263,7 +263,7 @@ namespace OnlineStore.DeviceLibrary
Alarm
(
LineAlarmType
.
SuddenStop
);
Alarm
(
LineAlarmType
.
SuddenStop
);
return
;
return
;
}
}
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
}
}
else
if
(
IOValue
(
IO_Type
.
DLine_Reset
).
Equals
(
IO_VALUE
.
HIGH
))
else
if
(
IOValue
(
IO_Type
.
DLine_Reset
).
Equals
(
IO_VALUE
.
HIGH
))
...
@@ -489,13 +489,18 @@ namespace OnlineStore.DeviceLibrary
...
@@ -489,13 +489,18 @@ namespace OnlineStore.DeviceLibrary
}
}
NewTypeScan
();
NewTypeScan
();
}
}
else
{
LogUtil
.
error
(
Name
+
"Line3EndProcess result="
+
result
+
""
);
}
}
}
private
bool
ScanIsEnd
()
private
bool
ScanIsEnd
()
{
{
TimeSpan
span
=
DateTime
.
Now
-
LastScanTime
;
TimeSpan
span
=
DateTime
.
Now
-
LastScanTime
;
if
(
IsInScanCode
&&
span
.
TotalMinutes
<
1
)
//if (IsInScanCode && span.TotalMinutes < 1)
if
(
IsInScanCode
)
{
{
return
false
;
return
false
;
}
}
return
true
;
return
true
;
}
}
...
@@ -527,25 +532,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -527,25 +532,6 @@ namespace OnlineStore.DeviceLibrary
if
(
IOValue
(
IO_Type
.
ExitTray_Check3
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOValue
(
IO_Type
.
ExitTray_Check3
).
Equals
(
IO_VALUE
.
LOW
))
{
{
UpdateScanInfo
(
IO_VALUE
.
LOW
,
""
);
UpdateScanInfo
(
IO_VALUE
.
LOW
,
""
);
//List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), "", true);
//LastCode = SServerManager.ProcessCodeList(LastCodeList);
//if (LastCodeList.Count > 0)
//{
// UpdateScanInfo(IO_VALUE.HIGH, LastCode);
// LogUtil.info(hengyiName + "ExitTray_Check3不亮,但扫到条码,更改为有料: " + LastCode);
// if (DeviceID.Equals(301))
// {
// if (Line3LastTrayP > Line3MaxPosition) { Line3LastTrayP = Line3MaxPosition; }
// // StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr);
// }
// else
// {
// if (Line3LastTrayP > Line3MaxPosition - 1)
// {
// Line3LastTrayP = Line3MaxPosition - 1;
// }
// }
//}
IsInScanCode
=
false
;
IsInScanCode
=
false
;
}
}
...
@@ -589,7 +575,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -589,7 +575,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
hengyiName
+
" 扫码工位 : 扫码结束 ,"
+
StationInfo_Scan
.
ToStr
+
" IsInScanCode = "
+
IsInScanCode
);
LogUtil
.
info
(
hengyiName
+
" 扫码工位 : 扫码结束 ,"
+
StationInfo_Scan
.
ToStr
+
" IsInScanCode = "
+
IsInScanCode
);
}
}
}
}
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
private
void
UpdateScanInfo
(
IO_VALUE
value
,
string
code
)
private
void
UpdateScanInfo
(
IO_VALUE
value
,
string
code
)
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip.cs
查看文件 @
29861c1
...
@@ -365,7 +365,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -365,7 +365,7 @@ namespace OnlineStore.DeviceLibrary
}
}
return
;
return
;
}
}
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
}
}
else
if
(
IOValue
(
IO_Type
.
SL_Reset_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
else
if
(
IOValue
(
IO_Type
.
SL_Reset_BTN
).
Equals
(
IO_VALUE
.
HIGH
))
...
@@ -764,7 +764,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -764,7 +764,7 @@ namespace OnlineStore.DeviceLibrary
{
{
Thread
.
Sleep
(
1000
);
Thread
.
Sleep
(
1000
);
AgvClient
.
SetStatus
(
Config
.
AgvOutName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
AgvClient
.
SetStatus
(
Config
.
AgvOutName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
});
}
,
TaskCreationOptions
.
LongRunning
);
ProcessShelfOut
=
false
;
ProcessShelfOut
=
false
;
LogUtil
.
info
(
logName
+
",停止转动,清空料架["
+
LastOutShelfId
+
"], 结束"
);
LogUtil
.
info
(
logName
+
",停止转动,清空料架["
+
LastOutShelfId
+
"], 结束"
);
}
}
...
@@ -786,7 +786,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -786,7 +786,7 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
SL_OutSideWay_Run
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SL_OutSideWay_Run
,
IO_VALUE
.
LOW
);
ProcessShelfOut
=
false
;
ProcessShelfOut
=
false
;
}
}
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
internal
void
ShelfEnterProcess
()
internal
void
ShelfEnterProcess
()
{
{
...
@@ -844,7 +844,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -844,7 +844,7 @@ namespace OnlineStore.DeviceLibrary
{
{
Thread
.
Sleep
(
1000
);
Thread
.
Sleep
(
1000
);
AgvClient
.
SetStatus
(
Config
.
AgvInName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
AgvClient
.
SetStatus
(
Config
.
AgvInName
,
""
,
ClientAction
.
None
,
ClientLevel
.
High
,
true
);
});
}
,
TaskCreationOptions
.
LongRunning
);
ProcessShelfEnter
=
false
;
ProcessShelfEnter
=
false
;
LogUtil
.
info
(
logName
+
" 结束"
);
LogUtil
.
info
(
logName
+
" 结束"
);
}
}
...
@@ -862,7 +862,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -862,7 +862,7 @@ namespace OnlineStore.DeviceLibrary
IOMove
(
IO_Type
.
SL_Line_Run
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
SL_Line_Run
,
IO_VALUE
.
LOW
);
ProcessShelfEnter
=
false
;
ProcessShelfEnter
=
false
;
}
}
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
private
bool
ReadShelfId
()
private
bool
ReadShelfId
()
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
29861c1
...
@@ -755,9 +755,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -755,9 +755,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
)
{
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
(
"扫码执行结束超时"
);
}
else
if
(
MoveInfo
.
IsTimeOut
(
60
))
{
WarnMsg
=
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveStep
+
"] 扫码执行结束超时 ["
+
Math
.
Round
(
MoveInfo
.
StepSpan
().
TotalSeconds
,
1
)
+
"]秒"
;
LogUtil
.
error
(
WarnMsg
,
DeviceID
*
1000
+
30
);
Alarm
(
LineAlarmType
.
IoSingleTimeOut
);
}
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_14_CylinderTake
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FI_14_CylinderTake
))
{
{
...
@@ -1152,7 +1162,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1152,7 +1162,7 @@ namespace OnlineStore.DeviceLibrary
//需要等待500再下降
//需要等待500再下降
Thread
.
Sleep
(
500
);
Thread
.
Sleep
(
500
);
CylinderMove
(
null
,
IO_Type
.
SW_TopCylinder_Up
,
IO_Type
.
SW_TopCylinder_Down
);
CylinderMove
(
null
,
IO_Type
.
SW_TopCylinder_Up
,
IO_Type
.
SW_TopCylinder_Down
);
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
}
}
else
else
...
@@ -1244,6 +1254,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1244,6 +1254,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
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
))
...
@@ -1253,6 +1264,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1253,6 +1264,7 @@ namespace OnlineStore.DeviceLibrary
LastCodeList
=
new
List
<
string
>();
LastCodeList
=
new
List
<
string
>();
ScanCodeTask
=
null
;
if
(
NextCodeList
.
Count
>
0
)
if
(
NextCodeList
.
Count
>
0
)
{
{
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码:使用预扫码"
);
InLog
(
"料盘移栽"
+
MoveInfo
.
SLog
+
":开始扫码:使用预扫码"
);
...
@@ -1271,7 +1283,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1271,7 +1283,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
7000
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
7000
));
try
try
{
{
Task
<
List
<
string
>>
scan
Task
=
Task
.
Factory
.
StartNew
(
delegate
ScanCode
Task
=
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
());
...
@@ -1280,7 +1292,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1280,7 +1292,7 @@ namespace OnlineStore.DeviceLibrary
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
,
false
,
3000
);
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
GetCameraList
(),
Name
,
false
,
3000
);
}
}
return
LastCodeList
;
return
LastCodeList
;
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_OutStore.cs
查看文件 @
29861c1
...
@@ -661,7 +661,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -661,7 +661,7 @@ namespace OnlineStore.DeviceLibrary
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
;
}
}
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_221_UpdownAxisToP1
))
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
FO_221_UpdownAxisToP1
))
{
{
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
29861c1
...
@@ -182,7 +182,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -182,7 +182,7 @@ namespace OnlineStore.DeviceLibrary
canStart
=
true
;
canStart
=
true
;
AgvClient
.
Init
();
AgvClient
.
Init
();
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
...
@@ -686,7 +686,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -686,7 +686,7 @@ namespace OnlineStore.DeviceLibrary
SetWarnMsg
(
"收到急停信号,报警急停"
);
SetWarnMsg
(
"收到急停信号,报警急停"
);
Alarm
(
LineAlarmType
.
SuddenStop
);
Alarm
(
LineAlarmType
.
SuddenStop
);
}
}
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
}
}
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
查看文件 @
29861c1
...
@@ -534,7 +534,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -534,7 +534,7 @@ namespace OnlineStore.DeviceLibrary
waitInStoreList
.
RemoveAt
(
reIndex
);
waitInStoreList
.
RemoveAt
(
reIndex
);
Task
.
Factory
.
StartNew
(
delegate
{
Task
.
Factory
.
StartNew
(
delegate
{
SServerManager
.
cancelPutInTask
(
Name
,
currCode
.
WareCode
);
SServerManager
.
cancelPutInTask
(
Name
,
currCode
.
WareCode
);
});
}
,
TaskCreationOptions
.
LongRunning
);
return
false
;
return
false
;
}
}
...
...
source/DeviceLibrary/assemblyLine/OutTrayLineBean.cs
查看文件 @
29861c1
...
@@ -401,7 +401,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -401,7 +401,7 @@ namespace OnlineStore.DeviceLibrary
{
{
canWhileCount
=
3
;
canWhileCount
=
3
;
LineRunAndWait
(
timeOutMS
);
LineRunAndWait
(
timeOutMS
);
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
private
string
LineRunAndWait
(
int
timeOutMS
=
30000
)
private
string
LineRunAndWait
(
int
timeOutMS
=
30000
)
...
@@ -519,7 +519,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -519,7 +519,7 @@ namespace OnlineStore.DeviceLibrary
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
turnEnd
?.
Invoke
(
result
.
Equals
(
""
));
turnEnd
?.
Invoke
(
result
.
Equals
(
""
));
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
InTurn
=
false
;
InTurn
=
false
;
WaitCheckDI_High
=
false
;
WaitCheckDI_High
=
false
;
...
...
source/DeviceLibrary/assemblyLine/ProvidingEquip_Partial.cs
查看文件 @
29861c1
...
@@ -152,7 +152,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -152,7 +152,7 @@ namespace OnlineStore.DeviceLibrary
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
SServerManager
.
cancelPutInTask
(
Name
,
trayInfo
.
InoutPar
.
WareCode
);
SServerManager
.
cancelPutInTask
(
Name
,
trayInfo
.
InoutPar
.
WareCode
);
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
//入料失败料
//入料失败料
return
inoup
;
return
inoup
;
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
29861c1
...
@@ -140,7 +140,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -140,7 +140,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
moveEquip
.
Name
+
" 入库命令: "
+
param
.
ToStr
()
+
" 给料仓发送验证失败,等待3秒后重发 "
);
LogUtil
.
error
(
moveEquip
.
Name
+
" 入库命令: "
+
param
.
ToStr
()
+
" 给料仓发送验证失败,等待3秒后重发 "
);
Thread
.
Sleep
(
3000
);
Thread
.
Sleep
(
3000
);
LineServer
.
CheckInStorePos
(
storeId
,
param
);
LineServer
.
CheckInStorePos
(
storeId
,
param
);
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
lock
(
moveEquip
.
waitInListLock
)
lock
(
moveEquip
.
waitInListLock
)
{
{
...
@@ -589,7 +589,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -589,7 +589,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
error
(
deviceName
+
"["
+
moveEquip
.
Name
+
" ]入库命令: "
+
param
.
ToStr
()
+
" 给料仓发送验证失败,等待3秒后重发 "
);
LogUtil
.
error
(
deviceName
+
"["
+
moveEquip
.
Name
+
" ]入库命令: "
+
param
.
ToStr
()
+
" 给料仓发送验证失败,等待3秒后重发 "
);
Thread
.
Sleep
(
3000
);
Thread
.
Sleep
(
3000
);
LineServer
.
CheckInStorePos
(
storeId
,
param
);
LineServer
.
CheckInStorePos
(
storeId
,
param
);
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
lock
(
moveEquip
.
waitInListLock
)
lock
(
moveEquip
.
waitInListLock
)
{
{
...
...
source/DeviceLibrary/model/KTK_Store.cs
查看文件 @
29861c1
...
@@ -536,7 +536,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -536,7 +536,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
IOManager
.
IOMove
(
IoType
,
tValue
,
baseConfig
.
Id
);
IOManager
.
IOMove
(
IoType
,
tValue
,
baseConfig
.
Id
);
});
}
,
TaskCreationOptions
.
LongRunning
);
}
}
}
}
public
IO_VALUE
IOValue
(
string
IoType
)
public
IO_VALUE
IOValue
(
string
IoType
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论