Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO827-OutletEquip
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit fa2fc749
由
LN
编写于
2021-04-22 16:13:55 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
门口取料逻辑优化
1 个父辈
6a0c394d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
95 行增加
和
78 行删除
source/DeviceLibrary/bean/EquipBean.cs
source/DeviceLibrary/bean/EquipBean_Partial.cs
source/DeviceLibrary/bean/EquipBean.cs
查看文件 @
fa2fc74
...
...
@@ -783,67 +783,79 @@ namespace OnlineStore.DeviceLibrary
}
}
public
TrayInfo
CurrTray
=
null
;
private
object
ProLock
=
""
;
private
DateTime
LastGTime
=
DateTime
.
Now
;
private
void
InShelfProcess
()
{
//2秒钟获取一次
TimeSpan
span
=
DateTime
.
Now
-
LastGTime
;
if
(
span
.
TotalSeconds
<
2
)
//TimeSpan span = DateTime.Now - LastGTime;
//if (span.TotalSeconds < 2)
//{
// return;
//}
if
(
Monitor
.
TryEnter
(
ProLock
,
1
))
{
return
;
}
try
{
LastGTime
=
DateTime
.
Now
;
if
((!
CanStarInOut
()))
{
return
;
}
if
((
LineConnect
.
DoorPosInfo
==
null
))
{
return
;
}
if
(
LineConnect
.
DoorPosInfo
.
IsNg
||
LineConnect
.
DoorPosInfo
.
barcode
.
Equals
(
""
))
{
LineConnect
.
DoorPosInfo
.
IsNg
=
true
;
StartMove
();
return
;
}
string
shelfRfid
=
ReadyShelf
();
if
(
String
.
IsNullOrEmpty
(
shelfRfid
))
try
{
//无可用料架
WarnMsg
=
$
"{LineConnect.DoorPosInfo.ToStr()}暂无可用料架"
;
return
;
}
ClearWarnMsg
(
"暂无可用料架"
);
//获取库位号
string
outMsg
=
""
;
CurrTray
=
HttpServer
.
GetLocation
(
LineConnect
.
DoorPosInfo
.
barcode
,
shelfRfid
,
out
outMsg
);
//需要取放料,且料架已准备好
if
(
outMsg
.
Equals
(
""
))
{
ClearWarnMsg
(
"getLocation"
);
string
targetP
=
GetShelfPosId
();
if
(!
String
.
IsNullOrEmpty
(
targetP
))
LastGTime
=
DateTime
.
Now
;
if
((!
CanStarInOut
()))
{
LineConnect
.
DoorPosInfo
.
ShelfPosId
=
targetP
;
return
;
}
if
((
LineConnect
.
DoorPosInfo
==
null
))
{
return
;
}
if
(
LineConnect
.
DoorPosInfo
.
IsNg
||
LineConnect
.
DoorPosInfo
.
barcode
.
Equals
(
""
))
{
LineConnect
.
DoorPosInfo
.
IsNg
=
true
;
StartMove
();
return
;
}
else
string
shelfRfid
=
ReadyShelf
();
if
(
String
.
IsNullOrEmpty
(
shelfRfid
))
{
WarnMsg
=
"未找到可用料架 getLocation "
+
CurrTray
.
ToStr
();
//无可用料架
WarnMsg
=
$
"{LineConnect.DoorPosInfo.ToStr()}暂无可用料架"
;
return
;
}
ClearWarnMsg
(
"暂无可用料架"
);
//获取库位号
string
outMsg
=
""
;
CurrTray
=
HttpServer
.
GetLocation
(
LineConnect
.
DoorPosInfo
.
barcode
,
shelfRfid
,
out
outMsg
);
//需要取放料,且料架已准备好
if
(
outMsg
.
Equals
(
""
))
{
ClearWarnMsg
(
"getLocation"
);
string
targetP
=
GetShelfPosId
();
if
(!
String
.
IsNullOrEmpty
(
targetP
))
{
LineConnect
.
DoorPosInfo
.
ShelfPosId
=
targetP
;
StartMove
();
}
else
{
WarnMsg
=
"未找到可用料架 getLocation "
+
CurrTray
.
ToStr
();
}
}
else
if
(!
outMsg
.
Equals
(
""
))
{
WarnMsg
=
" getLocation "
+
outMsg
;
}
}
else
if
(!
outMsg
.
Equals
(
""
)
)
catch
(
Exception
ex
)
{
WarnMsg
=
" getLocation "
+
outMsg
;
LogUtil
.
error
(
Name
+
"InShelfProcess:"
+
ex
.
ToString
());
}
finally
{
Monitor
.
Exit
(
ProLock
);
}
}
catch
(
Exception
ex
)
else
{
LogUtil
.
error
(
Name
+
"InShelfProcess:"
+
ex
.
ToString
());
}
}
...
...
source/DeviceLibrary/bean/EquipBean_Partial.cs
查看文件 @
fa2fc74
...
...
@@ -336,11 +336,10 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
SO_11_InOutToP1
);
MoveLog
(
"进出轴到P1["
+
moveP
.
InOut_P1
+
"]"
);
int
outCount
=
AxisManager
.
instance
.
GetActualtPosition
(
Config
.
InOut_Axis
.
DeviceName
,
Config
.
InOut_Axis
.
GetAxisValue
());
int
errorCount
=
Math
.
Abs
(
outCount
-
moveP
.
InOut_P1
);
if
(
errorCount
<=
Config
.
InOut_Axis
.
CanErrorCountMin
)
ConfigMoveAxis
axis
=
Config
.
InOut_Axis
;
if
(
AxisManager
.
instance
.
isInPosition
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
moveP
.
InOut_P1
,
axis
.
CanErrorCountMin
,
true
))
{
LogUtil
.
error
(
Name
+
"进出轴
当前位置:"
+
outCount
+
",
已经在P1["
+
moveP
.
InOut_P1
+
"],不需要再回P1"
);
LogUtil
.
error
(
Name
+
"进出轴
已经在P1["
+
moveP
.
InOut_P1
+
"],不需要再回P1"
);
}
else
{
...
...
@@ -398,6 +397,39 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P2
,
Config
.
MiddleAxis_P2_Speed
);
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P3
,
Config
.
UpDownAxis_P3_Speed
);
}
private
void
SO_12_AxisToP1
()
{
LineMoveP
moveP
=
MoveInfo
.
MoveParam
.
MoveP
;
if
(
IOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
LOW
))
{
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosInfo
.
ShelfPosId
:
""
;
WarnMsg
=
"["
+
posId
+
"]叉子去取料前,未检测到进料口有料"
;
LogUtil
.
error
(
WarnMsg
);
}
MoveInfo
.
NextMoveStep
(
MoveStep
.
SO_12_AxisToP1
);
MoveLog
(
" 所有轴回到待机点,升降轴到P1 ["
+
moveP
.
UpDown_P1
+
"],旋转轴到P1 ["
+
moveP
.
Middle_P1
+
"], 压紧轴到P3 ["
+
moveP
.
ComPress_P3
+
"]"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
ComMoveToPosition
(
moveP
.
ComPress_P3
,
Config
.
CompAxis_P3_Speed
);
ConfigMoveAxis
updown
=
Config
.
UpDown_Axis
;
if
(!
AxisManager
.
instance
.
isInPosition
(
updown
.
DeviceName
,
updown
.
GetAxisValue
(),
moveP
.
UpDown_P1
,
updown
.
CanErrorCountMax
))
{
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
}
else
{
MoveLog
(
"升降轴已在P1["
+
moveP
.
UpDown_P1
+
"]"
);
}
ConfigMoveAxis
middle
=
Config
.
Middle_Axis
;
if
(!
AxisManager
.
instance
.
isInPosition
(
middle
.
DeviceName
,
middle
.
GetAxisValue
(),
moveP
.
Middle_P1
,
middle
.
GetAxisValue
()))
{
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
}
else
{
MoveLog
(
"旋转轴已在P1 ["
+
moveP
.
Middle_P1
+
"]"
);
}
}
protected
override
void
OutProcess
()
{
LineMoveP
moveP
=
MoveInfo
.
MoveParam
.
MoveP
;
...
...
@@ -413,35 +445,8 @@ namespace OnlineStore.DeviceLibrary
if
(
MoveInfo
.
IsStep
(
MoveStep
.
SO_11_InOutToP1
))
{
if
(
IOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
LOW
))
{
string
posId
=
MoveInfo
.
MoveParam
!=
null
?
MoveInfo
.
MoveParam
.
PosInfo
.
ShelfPosId
:
""
;
WarnMsg
=
"["
+
posId
+
"]叉子去取料前,未检测到进料口有料"
;
LogUtil
.
error
(
WarnMsg
);
}
MoveInfo
.
NextMoveStep
(
MoveStep
.
SO_12_AxisToP1
);
MoveLog
(
" 所有轴回到待机点,升降轴到P1 ["
+
moveP
.
UpDown_P1
+
"],旋转轴到P1 ["
+
moveP
.
Middle_P1
+
"], 压紧轴到P3 ["
+
moveP
.
ComPress_P3
+
"]"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
ComMoveToPosition
(
moveP
.
ComPress_P3
,
Config
.
CompAxis_P3_Speed
);
ConfigMoveAxis
updown
=
Config
.
UpDown_Axis
;
if
(!
AxisManager
.
instance
.
isInPosition
(
updown
.
DeviceName
,
updown
.
GetAxisValue
(),
moveP
.
UpDown_P1
,
updown
.
CanErrorCountMax
))
{
ACAxisMove
(
Config
.
UpDown_Axis
,
moveP
.
UpDown_P1
,
Config
.
UpDownAxis_P1_Speed
);
}
else
{
MoveLog
(
"升降轴已在P1["
+
moveP
.
UpDown_P1
+
"]"
);
}
ConfigMoveAxis
middle
=
Config
.
Middle_Axis
;
if
(!
AxisManager
.
instance
.
isInPosition
(
middle
.
DeviceName
,
middle
.
GetAxisValue
(),
moveP
.
Middle_P1
,
middle
.
GetAxisValue
()))
{
ACAxisMove
(
Config
.
Middle_Axis
,
moveP
.
Middle_P1
,
Config
.
MiddleAxis_P1_Speed
);
}
else
{
MoveLog
(
"旋转轴已在P1 ["
+
moveP
.
Middle_P1
+
"]"
);
}
SO_12_AxisToP1
();
}
else
if
(
MoveInfo
.
IsStep
(
MoveStep
.
SO_12_AxisToP1
))
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论