Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO827-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
图表
网络
创建新的问题
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0d1fe10f
由
LN
编写于
2021-06-29 17:25:08 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出库料放到托盘上时先调用GetLocation判断是否可放
1 个父辈
45eb003b
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
304 行增加
和
151 行删除
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
source/DeviceLibrary/model/StoreStep.cs
source/DeviceLibrary/server/BoxInfo.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
0d1fe10
...
...
@@ -315,11 +315,11 @@ namespace OnlineStore.DeviceLibrary
//前进后退气缸后退以后才可以出库
else
if
(
move
.
runStatus
.
Equals
(
LineRunStatus
.
Busy
)
&&
move
.
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
{
if
(
move
.
MoveInfo
.
MoveStep
>=
(
LineMoveStep
.
MO_6
0
_CylinderDown
))
if
(
move
.
MoveInfo
.
MoveStep
>=
(
LineMoveStep
.
MO_6
4
_CylinderDown
))
{
return
true
;
}
else
if
(
move
.
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_
59
_CylinderAfter
)
&&
move
.
MoveInfo
.
IsInWait
.
Equals
(
false
)
else
if
(
move
.
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_
63
_CylinderAfter
)
&&
move
.
MoveInfo
.
IsInWait
.
Equals
(
false
)
&&
move
.
CylinderIsOk
(
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
))
{
return
true
;
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
0d1fe10
...
...
@@ -26,9 +26,9 @@ namespace OnlineStore.DeviceLibrary
{
return
false
;
}
bool
moveOk
=
(
IsBigStore
()
&&
MoveInfo
.
MoveStep
>=
LineMoveStep
.
MO_
58_WaitTray
)
||
MoveInfo
.
MoveStep
>=
LineMoveStep
.
MO_59
_CylinderAfter
;
bool
moveOk
=
(
IsBigStore
()
&&
MoveInfo
.
MoveStep
>=
LineMoveStep
.
MO_
62_WaitTray
)
||
MoveInfo
.
MoveStep
>=
LineMoveStep
.
MO_63
_CylinderAfter
;
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
)
&&
moveOk
&&
(!
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_6
2
_CylinderUp
)))
&&
(!
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_6
6
_CylinderUp
)))
{
if
(
isFull
.
Equals
(
false
))
{
...
...
@@ -45,9 +45,9 @@ namespace OnlineStore.DeviceLibrary
{
return
false
;
}
bool
moveOk
=
(
IsBigStore
()
&&
MoveInfo
.
MoveStep
>=
LineMoveStep
.
MO_
58_WaitTray
)
||
MoveInfo
.
MoveStep
>=
LineMoveStep
.
MO_59
_CylinderAfter
;
bool
moveOk
=
(
IsBigStore
()
&&
MoveInfo
.
MoveStep
>=
LineMoveStep
.
MO_
62_WaitTray
)
||
MoveInfo
.
MoveStep
>=
LineMoveStep
.
MO_63
_CylinderAfter
;
if
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
)
&&
moveOk
&&
(!
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_6
2
_CylinderUp
)))
&&
(!
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_6
6
_CylinderUp
)))
{
return
true
;
}
...
...
@@ -61,51 +61,57 @@ namespace OnlineStore.DeviceLibrary
{
return
false
;
}
try
{
TrayInfo
tray
=
TrayManager
.
GetTrayInfo
(
currTrayNum
);
InOutParam
param
=
tray
.
InoutPar
;
if
(
tray
.
InOrOutStore
.
Equals
(
2
))
{
SecondMoveInfo
.
MoveParam
=
param
.
Clone
();
return
true
;
//string outMsg = "";
//BoxInfo box = LineServer.GetBoxInfo(DeviceID);
TrayInfo
tray
=
TrayManager
.
GetTrayInfo
(
currTrayNum
);
InOutParam
param
=
tray
.
InoutPar
;
if
(
tray
.
InOrOutStore
.
Equals
(
2
))
{
SecondMoveInfo
.
MoveParam
=
param
.
Clone
();
return
true
;
//紧急料,分盘料,直接返回
//if (param.cutReel || param.urgentReel)
//{
//return true;
//}
//bool isNg = false;
////工单料获取尺寸
//int robotIndex = 0;
//string code = SecondMoveInfo.MoveParam.WareCode;
//string result = SServerManager.GetTraySize(Name, robotIndex, code, out LastWidth, out isNg);
//LogUtil.info(Name + "[" + currTrayNum + "] [" + code + "] 获取尺寸【" + LastWidth + "】【" + result + "】");
//if (LastWidth > 0)
//{
// SecondMoveInfo.MoveParam = param.Clone();
// return true;
//}
//else if (isNg)
//{
// TrayManager.UpdateInStoreNG(currTrayNum, true, result);
// LogInfo("更新工单出库料[" + currTrayNum + "] [" + code + "]为NG料:" + result);
// tray = TrayManager.GetTrayInfo(currTrayNum);
// param = tray.InoutPar;
// SecondMoveInfo.MoveParam = param.Clone();
// return true;
//}
//else
//{
// LogUtil.info(Name + "[" + currTrayNum + "] [" + tray.ToStr() + "] 获取尺寸失败,托盘继续流转");
//}
//if (box != null && LineServer.BoxConnected(DeviceID))
//{
// OutWareInfo wareInfo = SServerManager.GetLocation(tray.InoutPar.WareCode, box.GetRfids(), out outMsg);
// //需要取放料,且料架已准备好
// if (outMsg.Equals(""))
// {
// bool result = box.HasRightRFID( wareInfo, out string targetP);
// if (result)
// {
// LogUtil.info($"{tray.ToStr()} getLocation 目标料架:" + targetP);
// SecondMoveInfo.MoveParam = param.Clone();
// return true;
// }
// else
// {
// LogUtil.error($"{tray.ToStr()} getLocation 未找到可用料架: " + wareInfo.ToStr());
// }
// }
// else if (!outMsg.Equals(""))
// {
// LogUtil.error($"{tray.ToStr()} getLocation " + outMsg);
// return false;
// }
// SecondMoveInfo.MoveParam = param.Clone();
// return true;
//}
}
else
if
(
param
.
IsNG
)
{
SecondMoveInfo
.
MoveParam
=
param
.
Clone
();
return
true
;
}
}
else
if
(
param
.
IsNG
)
catch
(
Exception
ex
)
{
SecondMoveInfo
.
MoveParam
=
param
.
Clone
();
return
true
;
LogUtil
.
error
(
Name
+
"CheckIsNeedMove 出错:"
+
ex
.
ToString
());
}
return
false
;
}
private
bool
CheckIsNeedInStore
()
{
if
(
currTrayNum
<=
0
||
...
...
@@ -281,12 +287,13 @@ namespace OnlineStore.DeviceLibrary
OutLog
(
"出库 "
+
MoveInfo
.
MoveStep
+
": 等待500毫秒再下降"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_52_WaitTime
))
{
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_52_WaitTime
))
{
//重置夹料次数=0
ClampCount
=
0
;
if
(
CylinderIsOk
(
IO_Type
.
BeforeAfterCylinder_After
,
IO_Type
.
BeforeAfterCylinder_Before
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
2
_CylinderDown
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
3
_CylinderDown
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 上下气缸下降 "
);
UpdownDownP3Move
(
MoveInfo
.
MoveParam
.
PlateH
,
MoveInfo
.
MoveParam
.
PlateW
);
// CylinderMove(MoveInfo, IO_Type.UpDownCylinder_Up, IO_Type.UpDownCylinder_Down);
...
...
@@ -299,18 +306,18 @@ namespace OnlineStore.DeviceLibrary
CylinderMove
(
MoveInfo
,
IO_Type
.
BeforeAfterCylinder_After
,
IO_Type
.
BeforeAfterCylinder_Before
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_5
2
_CylinderDown
))
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_5
3
_CylinderDown
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
3
_DownWait
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
4
_DownWait
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 等待200ms后夹紧"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
200
));
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_5
3
_DownWait
))
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_5
4
_DownWait
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
4
_CylinderOpen
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
5
_CylinderOpen
);
ClampEmptyMove
=
false
;
ClampJwa
.
Push
(
MoveInfo
,
true
,
MoveInfo
.
MoveParam
.
WareCode
);
ClampJwa
.
Push
(
MoveInfo
,
true
,
MoveInfo
.
MoveParam
.
WareCode
);
if
(
ClampCount
<=
0
)
{
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 夹料气缸夹紧,更新料盘位置【"
+
MoveInfo
.
MoveParam
.
WareCode
+
"】【MOVING】【"
+
DeviceID
+
"】"
);
...
...
@@ -323,20 +330,20 @@ namespace OnlineStore.DeviceLibrary
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 再次夹料"
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_5
4
_CylinderOpen
))
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_5
5
_CylinderOpen
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
5
_CylinderUp
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
6
_CylinderUp
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 上下气缸上升"
);
UpdownUpMove
();
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_5
6
_ResetClamp
))
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_5
7
_ResetClamp
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
2
_CylinderDown
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
3
_CylinderDown
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 上下气缸下降 "
);
UpdownDownP3Move
(
MoveInfo
.
MoveParam
.
PlateH
,
MoveInfo
.
MoveParam
.
PlateW
);
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_5
5
_CylinderUp
))
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_5
6
_CylinderUp
))
{
if
(
UpdownIsUp
())
{
...
...
@@ -345,12 +352,13 @@ namespace OnlineStore.DeviceLibrary
{
if
(
IsBigStore
())
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_58_WaitTray
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 等待托盘到达"
);
//MoveInfo.NextMoveStep(LineMoveStep.MO_62_WaitTray);
//OutLog("出库 " + MoveInfo.SLog + ": 等待托盘到达");
MO_61_WaitCanPut
();
}
else
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_
59
_CylinderAfter
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_
63
_CylinderAfter
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
200
));
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 前后气缸后退"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
);
...
...
@@ -360,15 +368,15 @@ namespace OnlineStore.DeviceLibrary
{
if
(
ClampCount
<=
0
)
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
6
_ResetClamp
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
7
_ResetClamp
);
ClampCount
=
1
;
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 第一次未抓到料,重新抓一次,夹爪先放松"
,
1
);
//CylinderMove(MoveInfo, IO_Type.ClampCylinder_Work, IO_Type.ClampCylinder_Relax);
ClampJwa
.
Relax
(
MoveInfo
,
MoveInfo
.
MoveParam
.
WareCode
);
ClampJwa
.
Relax
(
MoveInfo
,
MoveInfo
.
MoveParam
.
WareCode
);
}
else
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
7
_WaitHasReel
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
8
_WaitHasReel
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 等待夹爪有料"
,
1
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitClampHasReel
());
MoveInfo
.
TimeOutSeconds
=
5
;
...
...
@@ -377,31 +385,44 @@ namespace OnlineStore.DeviceLibrary
}
else
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
5
_CylinderUp
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_5
6
_CylinderUp
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 上下气缸上升"
);
UpdownUpMove
();
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_5
7
_WaitHasReel
))
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_5
8
_WaitHasReel
))
{
if
(
IsBigStore
())
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_58_WaitTray
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 等待托盘到达"
);
//MoveInfo.NextMoveStep(LineMoveStep.MO_62_WaitTray);
//OutLog("出库 " + MoveInfo.SLog + ": 等待托盘到达");
MO_61_WaitCanPut
();
}
else
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_
59
_CylinderAfter
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_
63
_CylinderAfter
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
200
));
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 前后气缸后退"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_58_WaitTray
))
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_61_WaitCanPut
))
{
if
(
checkCanPutTask
==
null
||
checkCanPutTask
.
IsCompleted
)
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_62_WaitTray
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 等待托盘到达"
);
}
else
if
(
MoveInfo
.
IsTimeOut
(
30
))
{
MoveTimeOut
(
MoveInfo
,
"等待料盘可以放入托盘超时"
);
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_62_WaitTray
))
{
if
(
TrayIsOk
())
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_
59
_CylinderAfter
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_
63
_CylinderAfter
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
200
));
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 前后气缸后退"
);
CylinderMove
(
MoveInfo
,
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
);
...
...
@@ -410,7 +431,7 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
region
移载装置,放物品到流水线操作
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_
59
_CylinderAfter
))
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_
63
_CylinderAfter
))
{
if
(
CylinderIsOk
(
IO_Type
.
BeforeAfterCylinder_Before
,
IO_Type
.
BeforeAfterCylinder_After
))
{
...
...
@@ -418,7 +439,7 @@ namespace OnlineStore.DeviceLibrary
{
int
trayNum
=
SecondMoveInfo
.
MoveParam
.
TrayNumber
;
//去掉直接丢盘处理
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_6
0
_CylinderDown
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_6
4
_CylinderDown
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 拦截到空托盘【"
+
trayNum
+
"】, 上下气缸下降 ,顶升气缸上升"
);
if
(
MoveInfo
.
MoveParam
!=
null
)
{
...
...
@@ -435,7 +456,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_6
0
_CylinderDown
))
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_6
4
_CylinderDown
))
{
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 夹料气缸放松,更新托盘【"
+
MoveInfo
.
MoveParam
.
TrayNumber
+
"】,有料盘,OutStore,【"
+
MoveInfo
.
MoveParam
.
ToStr
()
+
"】"
);
//更新料盘位置
...
...
@@ -445,20 +466,20 @@ namespace OnlineStore.DeviceLibrary
TrayInfo
tray
=
TrayManager
.
GetTrayInfo
(
trayNum
);
LogInfo
(
"出库 "
+
MoveInfo
.
SLog
+
": ,更新料盘位置【"
+
MoveInfo
.
MoveParam
.
WareCode
+
"】【INLINE】更新托盘【"
+
trayNum
+
"】 "
+
tray
.
ToStr
()
+
""
);
//出库全部完成
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_6
1
_CylinderRelax
);
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_6
5
_CylinderRelax
);
//CylinderMove(MoveInfo, IO_Type.ClampCylinder_Work, IO_Type.ClampCylinder_Relax);
ClampJwa
.
Relax
(
MoveInfo
,
MoveInfo
.
MoveParam
.
WareCode
);
//EDataManager.UpdateParam(DeviceID);
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_6
1
_CylinderRelax
))
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_6
5
_CylinderRelax
))
{
this
.
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_6
2
_CylinderUp
);
this
.
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_6
6
_CylinderUp
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 上下气缸上升,同时顶升气缸先下降"
);
UpdownUpMove
();
CylinderMove
(
null
,
IO_Type
.
TopCylinder_Up
,
IO_Type
.
TopCylinder_Down
);
}
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_6
2
_CylinderUp
))
else
if
(
MoveInfo
.
IsStep
(
LineMoveStep
.
MO_6
6
_CylinderUp
))
{
// 减去需要的盘数
// TrayManager.DelNeedEmptyTrayNum();
...
...
@@ -473,6 +494,38 @@ namespace OnlineStore.DeviceLibrary
#
endregion
}
private
Task
checkCanPutTask
=
null
;
private
void
MO_61_WaitCanPut
()
{
checkCanPutTask
=
null
;
if
(
MoveInfo
.
MoveParam
.
urgentReel
)
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_62_WaitTray
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": 紧急料,直接等待托盘到达"
);
return
;
}
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_61_WaitCanPut
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
checkCanPutTask
=
Task
.
Factory
.
StartNew
(
delegate
{
int
getlocationCount
=
0
;
while
(
MoveInfo
.
MoveType
.
Equals
(
LineMoveType
.
OutStore
))
{
getlocationCount
++;
if
(
SServerManager
.
GetLocation
(
MoveInfo
.
MoveParam
.
WareCode
))
{
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MO_62_WaitTray
);
OutLog
(
"出库 "
+
MoveInfo
.
SLog
+
": GetLocation OK,等待托盘到达"
);
break
;
}
//OutLog("出库 " + MoveInfo.SLog + ": 等待料盘可以放到托盘上,等待3秒后重新判断");
Thread
.
Sleep
(
3000
);
}
});
}
private
bool
TrayIsOk
()
{
if
(
SecondMoveInfo
.
IsStep
(
LineMoveStep
.
MO_11_CodeRember
)
&&
!
SecondMoveInfo
.
IsInWait
)
...
...
@@ -994,6 +1047,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
SecondMoveInfo
.
IsStep
(
LineMoveStep
.
MIO_04_Wait
))
{
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
try
{
//判断是否需要顶升
...
...
@@ -1073,7 +1127,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
if
(
SecondMoveInfo
.
IsStep
(
LineMoveStep
.
MIO_06_TopUp
))
{
{
CheckLog
(
"托盘阻挡*************** 托盘号【"
+
currTrayNum
+
"】"
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
10000
));
//托盘号正确
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
0d1fe10
...
...
@@ -4,7 +4,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
...
...
@@ -63,65 +63,7 @@ namespace OnlineStore.DeviceLibrary
}
return
codeStr
;
}
//public static string GetTraySize(string deviceName, int robotIndex, string codeStr, out int outSize, out bool isNg)
//{
// outSize = 0;
// isNg = false;
// string msg = "";
// try
// {
// if (String.IsNullOrEmpty(codeStr))
// {
// return msg = deviceName + "未扫到条码";
// }
// string logName = $"GetTraySize [{robotIndex }] [{codeStr}] :";
// if (string.IsNullOrEmpty(serverAddr))
// {
// LogUtil.error(deviceName + $"{logName}未找到服务器地址");
// return msg;
// }
// Dictionary<string, string> paramMap = new Dictionary<string, string>();
// paramMap.Add("robotIndex", robotIndex.ToString());// 参数: robotIndex = 机器人编号,IP为51的机器人为1, 52的机器人为2, 53的机器人为3
// paramMap.Add("barcode", codeStr);// barcode = 扫到的条码
// string server = GetAddr(Addr_getSize, paramMap);
// DateTime startTime = DateTime.Now;
// bool isTimeOut = false;
// string resultStr = HttpHelper.Post(server, "", Encoding.UTF8, 5000, out isTimeOut);
// LogUtil.info("GetTraySize " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
// if (isTimeOut)
// {
// return msg = "获取尺寸超时";
// }
// //返回: { "code": 0, "msg":"ok", data: 7}
// ServerData serverResult = JsonHelper.DeserializeJsonToObject<ServerData>(resultStr);
// if (serverResult == null)
// {
// return msg = "没有收到服务器反馈";
// }
// else if (serverResult.code.Equals(0).Equals(false))
// {
// // code: 0为正常,其他为异常,
// //code不是0,直接NG
// isNg = true;
// return msg = $" [{ serverResult.code}]:" + serverResult.msg;
// }
// if (!serverResult.data.Equals(""))
// {
// // data:料盘直径,= 7时升起气缸
// outSize = Convert.ToInt32(serverResult.data);
// LogUtil.info(deviceName + $"{ logName} 获得尺寸:" + outSize);
// }
// }
// catch (Exception ex)
// {
// LogUtil.error(deviceName + " ", ex);
// }
// return "";
//}
public
static
string
UpdateTrayLoc
(
string
deviceName
,
string
barcode
,
string
status
,
string
locInfo
)
{
...
...
@@ -563,6 +505,52 @@ namespace OnlineStore.DeviceLibrary
}
}
private
static
string
Addr_getLocation
=
"/rest/api/qisda/device/getLocation"
;
public
static
bool
GetLocation
(
string
barcode
)
{
//加参数: onMoving=true 如果返回的code是99,则停留在横移上,下个可放托盘继续判断
//getLocation这个接口传入barcode和rfid列表会分配料架
try
{
string
currRFID
=
""
;
BoxInfo
box
=
LineServer
.
GetBoxInfo
(
7
);
if
(
box
!=
null
&&
LineServer
.
BoxConnected
(
7
))
{
currRFID
=
box
.
GetRfids
();
}
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"barcode"
,
barcode
);
paramMap
.
Add
(
"rfid"
,
currRFID
);
paramMap
.
Add
(
"onMoving"
,
true
.
ToString
());
string
url
=
GetAddr
(
Addr_getLocation
,
paramMap
);
string
logName
=
"http :URL:"
+
url
;
DateTime
startTime
=
DateTime
.
Now
;
string
json
=
HttpHelper
.
Post
(
url
,
""
,
10000
);
LogUtil
.
info
(
logName
+
": Response:"
+
json
+
",耗时【"
+
FormUtil
.
GetSpanStr
(
DateTime
.
Now
-
startTime
)
+
"】"
);
RfidData
data
=
JsonHelper
.
DeserializeJsonToObject
<
RfidData
>(
json
);
if
(
data
==
null
)
{
return
false
;
}
else
if
(
data
.
code
.
Equals
(
99
))
{
return
false
;
}
else
{
return
true
;
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"http error : "
+
ex
.
ToString
());
}
return
false
;
}
//14.异常看板
// > 地址:
...
...
@@ -618,7 +606,7 @@ namespace OnlineStore.DeviceLibrary
}
return
msg
;
}
}
}
public
class
AlarmMsg
{
...
...
@@ -650,7 +638,7 @@ namespace OnlineStore.DeviceLibrary
public
InOutParam
Param
=
null
;
}
public
class
RfidData
{
{
//Response:{"code":0,"msg":"ok","data":{"w":"7","realRfid":"","h":"8","rfid":"1-2F","usedRfidList":"F102","rfidLoc":"11","barcode":"985022*35030377*0822*3000*08220350"}}
//{"code":0,"msg":"ok","data":"7"}
public
int
code
{
get
;
set
;
}
...
...
source/DeviceLibrary/model/StoreStep.cs
查看文件 @
0d1fe10
...
...
@@ -323,50 +323,55 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 移栽装置出库处理。上下气缸1下降
/// </summary>
MO_5
2
_CylinderDown
,
MO_5
3
_CylinderDown
,
/// <summary>
/// 移栽装置出库处理。上下气缸1下降后,等待0.3秒再夹紧,防止没有下降到位就夹紧操作
/// </summary>
MO_5
3
_DownWait
,
MO_5
4
_DownWait
,
/// <summary>
/// 移栽装置出库处理。 夹料气缸1夹紧
/// </summary>
MO_5
4
_CylinderOpen
,
MO_5
5
_CylinderOpen
,
/// <summary>
/// 移栽装置出库处理。 上下气缸1上升
/// </summary>
MO_5
5
_CylinderUp
,
MO_5
6
_CylinderUp
,
/// <summary>
/// 移栽出库:开始重抓一次
/// </summary>
MO_5
6
_ResetClamp
,
MO_5
7
_ResetClamp
,
/// <summary>
/// 移栽出库。 等待夹爪有料
/// </summary>
MO_57_WaitHasReel
,
MO_58_WaitHasReel
,
/// <summary>
/// 移栽出库:判断料盘能否放到托盘
/// </summary>
MO_61_WaitCanPut
,
/// <summary>
/// 移栽出库:开始等待托盘
/// </summary>
MO_
58
_WaitTray
,
MO_
62
_WaitTray
,
/// <summary>
/// 移栽装置出库处理。 前后气缸1后退
/// </summary>
MO_
59
_CylinderAfter
,
MO_
63
_CylinderAfter
,
/// <summary>
/// 移载(流水线)装置出库处理,上下气缸1下降
/// </summary>
MO_6
0
_CylinderDown
,
MO_6
4
_CylinderDown
,
/// <summary>
/// 移载(流水线)装置出库处理,夹料气缸1放松
/// </summary>
MO_6
1
_CylinderRelax
,
MO_6
5
_CylinderRelax
,
/// <summary>
/// 移载(流水线)装置出库处理,上下气缸1上升
/// </summary>
MO_6
2
_CylinderUp
,
MO_6
6
_CylinderUp
,
#
region
入料模块,紧急出料移栽处理
...
...
source/DeviceLibrary/server/BoxInfo.cs
查看文件 @
0d1fe10
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
namespace
OnlineStore.DeviceLibrary
{
...
...
@@ -85,5 +86,110 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public
string
rfids
=
""
;
private
char
rfidSpilt
=
';'
;
public
string
GetRfids
()
{
string
str
=
""
;
string
[]
array
=
rfids
.
Split
(
rfidSpilt
);
if
(
array
!=
null
&&
array
.
Length
>
0
)
{
foreach
(
string
obj
in
array
)
{
string
realRfid
=
obj
;
string
xuniRfid
=
""
;
if
(
obj
.
Contains
(
","
))
{
string
[]
rarray
=
obj
.
Split
(
','
);
if
(
rarray
.
Length
==
2
)
{
realRfid
=
rarray
[
0
];
xuniRfid
=
rarray
[
1
];
}
}
str
+=
realRfid
+
rfidSpilt
;
}
}
str
=
str
.
Substring
(
0
,
str
.
Length
-
1
);
return
str
;
}
//internal bool HasRightRFID(OutWareInfo wareInfo, out string TargetRfid)
//{
// TargetRfid = "";
// string[] rfidArray = rfids.Split(rfidSpilt);
// if (rfidArray == null || rfidArray.Length <= 0)
// {
// return false;
// }
// foreach (string obj in rfidArray)
// {
// string realRfid = obj;
// string xuniRfid = "";
// if (obj.Contains(","))
// {
// string[] rarray = obj.Split(',');
// if (rarray.Length == 2)
// {
// realRfid = rarray[0];
// xuniRfid = rarray[1];
// }
// }
// if (realRfid.Equals(wareInfo.realRFID))
// {
// TargetRfid = obj;
// return true;
// }
// else if (String.IsNullOrEmpty(wareInfo.realRFID))
// {
// if ((!xuniRfid.Equals("")) && xuniRfid.Equals(wareInfo.rfid))
// {
// TargetRfid = obj;
// return true;
// }
// if (!String.IsNullOrEmpty(wareInfo.usedRfidList))
// {
// string[] array = wareInfo.usedRfidList.Split(',');
// //若料架已使用过,直接返回false
// if (array.Contains(realRfid))
// {
// return false;
// }
// }
// if (xuniRfid.Equals(""))
// {
// TargetRfid = obj;
// return true;
// }
// }
// }
// return false;
//}
//public Dictionary<string, string> GetRfidMap()
//{
// Dictionary<string, string> map = new Dictionary<string, string>();
// string[] array = rfids.Split(rfidSpilt);
// if (array != null && array.Length > 0)
// {
// foreach (string obj in array)
// {
// string realRfid = obj;
// string xuniRfid = "";
// if (obj.Contains("-"))
// {
// string[] rarray = obj.Split('-');
// if (rarray.Length == 2)
// {
// realRfid = rarray[0];
// xuniRfid = rarray[1];
// }
// }
// map.Add(realRfid, xuniRfid);
// }
// }
// return map;
//}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论