Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
张东亮
/
SO1057-XLRStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ae723b5b
由
张东亮
编写于
2023-01-09 15:31:28 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
优化
1 个父辈
66be7140
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
65 行增加
和
47 行删除
source/DeviceLibrary/manager/SServerManager.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_ConnectServerTimer.cs
source/DeviceLibrary/storeBean/inputBean/BatchMoveBean_Partial.cs
source/DeviceLibrary/manager/SServerManager.cs
查看文件 @
ae723b5
...
...
@@ -629,7 +629,7 @@ namespace OnlineStore.DeviceLibrary
try
{
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"cid
s
"
,
StoreManager
.
Config
.
CID
);
paramMap
.
Add
(
"cid"
,
StoreManager
.
Config
.
CID
);
paramMap
.
Add
(
"hSerial"
,
hSerial
);
string
server
=
GetAddr
(
"/service/store/outTaskCount"
,
paramMap
);
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_ConnectServerTimer.cs
查看文件 @
ae723b5
...
...
@@ -60,7 +60,7 @@ namespace OnlineStore.DeviceLibrary
SendLineStatus
();
HttpHelper
.
Post
<
DoorInfo
>(
HttpHelper
.
GetPostApi
(
"/api/xlc/updateDoorInfo"
),
StoreManager
.
XLRStore
.
inputEquip
.
BatchMove_A
.
doorInfo
);
HttpHelper
.
Post
<
DoorInfo
>(
HttpHelper
.
GetPostApi
(
"/api/xlc/updateDoorInfo"
),
StoreManager
.
XLRStore
.
inputEquip
.
BatchMove_B
.
doorInfo
);
}
}
}
...
...
@@ -76,8 +76,12 @@ namespace OnlineStore.DeviceLibrary
public
void
SendStoreState
(
string
posid
,
DeviceStatus
storeStatus
)
{
Operation
operation
=
getLineBoxStatus
();
if
(!
string
.
IsNullOrEmpty
(
posid
))
if
(!
string
.
IsNullOrEmpty
(
posid
)
&&
!
operation
.
boxStatus
[
1
].
data
.
ContainsKey
(
ParamDefine
.
posId
)
)
operation
.
boxStatus
[
1
].
data
.
Add
(
ParamDefine
.
posId
,
posid
);
else
if
(!
string
.
IsNullOrEmpty
(
posid
)
&&
operation
.
boxStatus
[
1
].
data
.
ContainsKey
(
ParamDefine
.
posId
))
{
operation
.
boxStatus
[
1
].
data
[
ParamDefine
.
posId
]
=
posid
;
}
LogUtil
.
info
(
$
"SendStoreState,posid:{posid}, storeStatus:{storeStatus}"
);
operation
.
boxStatus
[
1
].
status
=
(
int
)
storeStatus
;
...
...
@@ -127,26 +131,26 @@ namespace OnlineStore.DeviceLibrary
else
if
(
runStatus
.
Equals
(
DeviceStatus
.
OutStoreBoxEnd
)
||
runStatus
.
Equals
(
DeviceStatus
.
InStoreEnd
))
{
boxStatus
.
data
.
Add
(
ParamDefine
.
posId
,
lastPosId
);
boxStatus
.
data
.
Add
(
ParamDefine
.
barcode
,
lastBarcode
);
boxStatus
.
data
.
Add
(
ParamDefine
.
barcode
,
lastBarcode
);
boxStatus
.
data
.
Add
(
ParamDefine
.
executeTime
,
executeTime
);
}
else
if
(!
lastPosId
.
Equals
(
""
))
{
boxStatus
.
data
.
Add
(
ParamDefine
.
posId
,
lastPosId
);
boxStatus
.
data
.
Add
(
ParamDefine
.
barcode
,
lastBarcode
);
boxStatus
.
data
.
Add
(
ParamDefine
.
executeTime
,
executeTime
);
boxStatus
.
data
.
Add
(
ParamDefine
.
executeTime
,
executeTime
);
boxStatus
.
status
=
(
int
)
deviceStatus
;
if
(
lastPosId
!=
""
)
{
LogUtil
.
info
(
"给服务器发送出入库消息:"
+
Name
+
",status【"
+
deviceStatus
+
"】posId【"
+
lastPosId
+
"】barcode【"
+
lastBarcode
+
"】"
);
LogUtil
.
info
(
"给服务器发送出入库消息:"
+
Name
+
",status【"
+
deviceStatus
+
"】posId【"
+
lastPosId
+
"】barcode【"
+
lastBarcode
+
"】"
);
}
lastPosId
=
""
;
lastBarcode
=
""
;
}
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
InStore
)
||
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
OutStore
))
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
InStore
)
||
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
OutStore
))
{
if
((
MoveInfo
.
MoveParam
!=
null
)
&&(
MoveInfo
.
MoveParam
.
PosInfo
!=
null
))
if
((
MoveInfo
.
MoveParam
!=
null
)
&&
(
MoveInfo
.
MoveParam
.
PosInfo
!=
null
))
{
if
(!
boxStatus
.
data
.
ContainsKey
(
ParamDefine
.
posId
))
{
...
...
@@ -186,14 +190,14 @@ namespace OnlineStore.DeviceLibrary
vals
.
Add
(
"humidity"
,
humitureParams
[
i
].
Humidity
.
ToString
());
vals
.
Add
(
"temperature"
,
humitureParams
[
i
].
Temperate
.
ToString
());
valuePairs
.
Add
(
vals
);
}
}
boxStatus
.
data
.
Add
(
ParamDefine
.
humiAndtempList
,
JsonHelper
.
SerializeObject
(
valuePairs
));
//LogUtil.info($"上报温湿度数据【{JsonHelper.SerializeObject(valuePairs)}】【{JsonHelper.SerializeObject(boxStatus.data)}】");
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"上报温湿度数据异常"
,
ex
);
LogUtil
.
error
(
"上报温湿度数据异常"
,
ex
);
}
return
lineOperation
;
}
...
...
@@ -278,7 +282,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
resultOperation
.
op
.
Equals
(
1
))
{
LogUtil
.
info
(
logName
+
" 成功"
+
$
"【{JsonHelper.SerializeObject(resultOperation)}】"
);
LogUtil
.
info
(
logName
+
" 成功"
+
$
"【{JsonHelper.SerializeObject(resultOperation)}】"
);
return
true
;
}
else
...
...
@@ -360,8 +364,8 @@ namespace OnlineStore.DeviceLibrary
try
{
//判断是否接收过此库位的出库信息
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
OutStore
)
&&
(
MoveInfo
.
MoveParam
.
PosInfo
.
PosId
.
Equals
(
posId
)
||
(
MoveInfo
.
MoveParam
.
PosInfoBack
!=
null
&&
MoveInfo
.
MoveParam
.
PosInfoBack
.
PosId
.
Equals
(
posId
))))
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
OutStore
)
&&
(
MoveInfo
.
MoveParam
.
PosInfo
.
PosId
.
Equals
(
posId
)
||
(
MoveInfo
.
MoveParam
.
PosInfoBack
!=
null
&&
MoveInfo
.
MoveParam
.
PosInfoBack
.
PosId
.
Equals
(
posId
))))
{
LogUtil
.
error
(
Name
+
" 出库命令【"
+
inoutParam
.
PosInfo
.
ToStr
()
+
"】重复,正在【"
+
posId
+
"】出库中"
);
continue
;
...
...
source/DeviceLibrary/storeBean/inputBean/BatchMoveBean_Partial.cs
查看文件 @
ae723b5
...
...
@@ -44,7 +44,7 @@ namespace OnlineStore.DeviceLibrary
if
(
AgvClient
.
GetAction
(
Config
.
AgvName
)
==
ClientAction
.
NeedLeave
||
AgvClient
.
GetAction
(
Config
.
AgvName
)
==
ClientAction
.
MayLeave
)
{
//WorkLog("料串入料 :等待AGV来取空料串1");
return
false
;
return
false
;
}
UpdateShelf
(
1
);
if
(
CurrShelf
.
ShelfState
.
Equals
(
3
))
...
...
@@ -59,12 +59,12 @@ namespace OnlineStore.DeviceLibrary
return
false
;
}
else
if
(
Robot
.
IOValue
(
Config
.
IO_LineIn_Check
).
Equals
(
IO_VALUE
.
HIGH
)
)
else
if
(
Robot
.
IOValue
(
Config
.
IO_LineIn_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
MoveInfo
.
NewMove
(
MoveType
.
InStore
,
new
InOutParam
());
MoveInfo
.
NewMove
(
MoveType
.
InStore
,
new
InOutParam
());
IB03_LineStart
();
}
else
if
(
Robot
.
IOValue
(
Config
.
IO_LineEnd_Check
).
Equals
(
IO_VALUE
.
HIGH
))
else
if
(
Robot
.
IOValue
(
Config
.
IO_LineEnd_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
MoveInfo
.
NewMove
(
MoveType
.
InStore
,
new
InOutParam
());
IB04_LineWait
();
...
...
@@ -96,7 +96,7 @@ namespace OnlineStore.DeviceLibrary
WorkLog
(
"定位工位检测到料串: 链条停止,阻挡气缸上升"
);
LineStop
();
StopUp
(
MoveInfo
);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
}
private
void
IB02_BatchAxisToP1
()
{
...
...
@@ -109,7 +109,7 @@ namespace OnlineStore.DeviceLibrary
{
WorkLog
(
"料串入料 :入口有料串,转动料串到位"
);
MoveInfo
.
NextMoveStep
(
StepEnum
.
IB03_LineStart
);
LineRun
(
MoveInfo
);
LineRun
(
MoveInfo
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
Config
.
IO_LineIn_Check
,
IO_VALUE
.
LOW
));
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
Config
.
IO_LineEnd_Check
,
IO_VALUE
.
HIGH
));
}
...
...
@@ -222,7 +222,8 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IB07_AxisUpMove
))
{
CheckHasTray
();
}
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IB08_BatchAxisToP4
))
}
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IB08_BatchAxisToP4
))
{
if
(
Robot
.
AxisIsInShelfUp
(
ShelfType
))
{
...
...
@@ -244,7 +245,7 @@ namespace OnlineStore.DeviceLibrary
else
if
(
MoveInfo
.
IsTimeOut
(
10
))
{
WarnMsg
=
Name
+
"["
+
MoveInfo
.
MoveStep
+
"] "
+
"等待旋转轴离开料串超时"
+
"["
+
FormUtil
.
GetSpanStr
(
MoveInfo
.
StepSpan
())
+
"]"
;
}
}
}
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IB11_ScanCode
))
{
...
...
@@ -275,8 +276,9 @@ namespace OnlineStore.DeviceLibrary
var
span
=
DateTime
.
Now
-
MoveInfo
.
LastSetpTime
;
WorkLog
(
"料串入料 :扫码结束【"
+
code
+
"】,等待取料机构来取料,"
+
MoveInfo
.
MoveParam
.
PosInfo
.
ToStr
());
}
}
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IB12_BatchAxisToReelPosition
))
}
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IB12_BatchAxisToReelPosition
))
{
string
code
=
CodeManager
.
ProcessCode
(
LastCodeList
);
MoveInfo
.
NextMoveStep
(
StepEnum
.
IB13_ScanOK
);
...
...
@@ -397,7 +399,7 @@ namespace OnlineStore.DeviceLibrary
{
LastCodeList
=
CodeManager
.
CameraScan
(
Config
.
CameraName
,
Name
);
}
// Robot.IOMove(IO_Type.CameraLed, IO_VALUE.LOW);
// Robot.IOMove(IO_Type.CameraLed, IO_VALUE.LOW);
//TODO 需要判断是否和上次的条码重复,重复的条码不可用
bool
isCanUse
=
true
;
...
...
@@ -442,22 +444,22 @@ namespace OnlineStore.DeviceLibrary
{
toBatchP4
=
false
;
//判断扫码点是否可用,可用,运动到扫码点
int
currP
=
BatchAxis
.
GetAclPosition
();
int
targetPosition
=
currP
+
Config
.
BatchAxisP4
;
if
(
Config
.
BatchAxisP4
>
0
&&
(
targetPosition
<
Config
.
BatchAxisP2
))
if
(
Config
.
BatchAxisP4
>
0
&&
(
targetPosition
<
Config
.
BatchAxisP2
))
{
batchAxisReelPosition
=
currP
;
toBatchP4
=
true
;
MoveInfo
.
NextMoveStep
(
StepEnum
.
IB08_BatchAxisToP4
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
BatchAxis
.
AbsMove
(
MoveInfo
,
targetPosition
,
Robot
.
Config
.
BatchAxis_P4Speed
);
WorkLog
(
"料盘已到位,批量轴当前位置【"
+
currP
+
"】,扫码上升高度P4【"
+
Config
.
BatchAxisP4
+
"】可用,批量轴走到扫码点【"
+
targetPosition
+
"】"
);
WorkLog
(
"料盘已到位,批量轴当前位置【"
+
currP
+
"】,扫码上升高度P4【"
+
Config
.
BatchAxisP4
+
"】可用,批量轴走到扫码点【"
+
targetPosition
+
"】"
);
}
else
{
LogUtil
.
info
(
Name
+
"料盘已到位,批量轴当前位置【"
+
currP
+
"】扫码上升高度P4【"
+
Config
.
BatchAxisP4
+
"】扫码点【"
+
targetPosition
+
"】P2【"
+
Config
.
BatchAxisP2
+
"】,可直接扫码"
);
LogUtil
.
info
(
Name
+
"料盘已到位,批量轴当前位置【"
+
currP
+
"】扫码上升高度P4【"
+
Config
.
BatchAxisP4
+
"】扫码点【"
+
targetPosition
+
"】P2【"
+
Config
.
BatchAxisP2
+
"】,可直接扫码"
);
if
(
Robot
.
AxisIsInShelfUp
(
ShelfType
))
{
MoveInfo
.
NextMoveStep
(
StepEnum
.
IB09_WaitCanScan
);
...
...
@@ -468,7 +470,7 @@ namespace OnlineStore.DeviceLibrary
{
IB11_ScanCode
();
}
}
}
}
else
{
...
...
@@ -493,7 +495,7 @@ namespace OnlineStore.DeviceLibrary
}
private
void
SendInShelfLeave
(
string
msg
=
""
)
{
WorkLog
(
" SendInShelfLeave :"
+
msg
+
",清空条码"
);
WorkLog
(
" SendInShelfLeave :"
+
msg
+
",清空条码"
);
LastCodeList
=
new
List
<
string
>();
preCodeList
=
new
List
<
string
>();
bool
needLeave
=
true
;
...
...
@@ -502,7 +504,7 @@ namespace OnlineStore.DeviceLibrary
{
needLeave
=
false
;
}
else
if
(
ShelfType
.
Equals
(
1
)
&&
Robot
.
BatchMove_B
.
ShelfIsOut
())
else
if
(
ShelfType
.
Equals
(
1
)
&&
Robot
.
BatchMove_B
.
ShelfIsOut
())
{
needLeave
=
true
;
}
...
...
@@ -636,9 +638,16 @@ namespace OnlineStore.DeviceLibrary
}
else
{
doorInfo
.
status
=
doorStatusE
.
outStore
;
MoveInfo
.
NextMoveStep
(
StepEnum
.
IS11_ShelfReady
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
//if (SServerManager.GetOutTaskCount(MoveInfo.MoveParam.PosInfo.hSerial) == 0)
//{
// SendOutShelfLeave("检测到工单已结束:" + MoveInfo.MoveParam.PosInfo.hSerial);
//}
//else
{
doorInfo
.
status
=
doorStatusE
.
outStore
;
MoveInfo
.
NextMoveStep
(
StepEnum
.
IS11_ShelfReady
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
}
}
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IS12_AxisDown
))
...
...
@@ -684,12 +693,16 @@ namespace OnlineStore.DeviceLibrary
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(60000));
//MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(Config.IO_LineIn_Check, IO_VALUE.LOW));
}
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IS23_WaitAgv
))
{
if
(
Robot
.
IOValue
(
Config
.
IO_AGV_RequestOut
).
Equals
(
IO_VALUE
.
HIGH
))
{
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IS23_WaitAgv
))
{
if
(
Robot
.
IOValue
(
Config
.
IO_AGV_RequestOut
).
Equals
(
IO_VALUE
.
HIGH
))
{
MoveInfo
.
NextMoveStep
(
StepEnum
.
IS24_ShelfOut
);
WorkLog
(
"收到AGV抵达信号"
);
ShelfOutProcess
(
""
,
CurrShelf
.
ShelfRfid
);
}
else
if
(
Robot
.
IOValue
(
Config
.
IO_LineEnd_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
}
else
if
(
Robot
.
IOValue
(
Config
.
IO_LineEnd_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
MoveInfo
.
NextMoveStep
(
StepEnum
.
IS24_ShelfOut
);
WorkLog
(
"料串已离开"
);
}
...
...
@@ -738,9 +751,9 @@ namespace OnlineStore.DeviceLibrary
}
internal
void
ReelPutOk
()
{
{
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
OutStore
)
&&
MoveInfo
.
IsStep
(
StepEnum
.
IS13_WaitReel
))
{
{
MoveInfo
.
NextMoveStep
(
StepEnum
.
IS14_ReelOK
);
WorkLog
(
$
"出库{MoveInfo.SLog} 放料完成"
);
...
...
@@ -748,7 +761,8 @@ namespace OnlineStore.DeviceLibrary
{
SendOutShelfLeave
(
"工单已结束:"
+
MoveInfo
.
MoveParam
.
PosInfo
.
hSerial
);
}
else
}
else
CheckShelfIsFull
();
}
else
...
...
@@ -777,7 +791,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
SendOutShelfLeave
(
"料串出满需离开(信号到位)"
);
SendOutShelfLeave
(
"料串出满需离开(信号到位)"
);
}
}
else
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IB07_AxisUpMove
))
...
...
@@ -851,11 +865,11 @@ namespace OnlineStore.DeviceLibrary
if
(!
result
)
{
LogUtil
.
error
(
logName
+
$
" 等待{
Config.IO_LineIn_Check}=High 超时, 等待 {Config.IO_LineEnd_Check
} 信号"
);
LogUtil
.
error
(
logName
+
$
" 等待{
Config.IO_LineIn_Check}=High 超时, 等待 {Config.IO_LineEnd_Check
} 信号"
);
}
else
{
LogUtil
.
info
(
logName
+
$
"已收到 {Config.IO_LineIn_Check}=High , 等待 {
Config.IO_LineEnd_Check} 信号"
);
LogUtil
.
info
(
logName
+
$
"已收到 {Config.IO_LineIn_Check}=High , 等待 {Config.IO_LineEnd_Check} 信号"
);
}
result
=
Robot
.
WaitIo
(
Config
.
IO_LineEnd_Check
,
IO_VALUE
.
HIGH
,
60000
);
...
...
@@ -926,7 +940,7 @@ namespace OnlineStore.DeviceLibrary
bool
result
=
Robot
.
WaitIo
(
Config
.
IO_LineIn_Check
,
IO_VALUE
.
LOW
,
60000
);
if
(!
result
)
{
LogUtil
.
error
(
logName
+
$
" 等待 {
Config.IO_LineIn_Check}=LOW超时,等待8000后停止转动,发送FinishLeave"
);
LogUtil
.
error
(
logName
+
$
" 等待 {Config.IO_LineIn_Check}=LOW超时,等待8000后停止转动,发送FinishLeave"
);
}
else
{
...
...
@@ -994,7 +1008,7 @@ namespace OnlineStore.DeviceLibrary
if
(
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
InStore
))
{
if
(
MoveInfo
.
IsStep
(
StepEnum
.
IB16_SaveHight
))
{
{
MoveInfo
.
NextMoveStep
(
StepEnum
.
IB17_WaitReelLeave
);
WorkLog
(
"当前料盘已离开,开始判断是否有下一盘,开始扫码"
);
LastHeight
=
0
;
...
...
@@ -1004,7 +1018,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil
.
error
(
Name
+
"当前状态:"
+
MoveInfo
.
MoveType
+
",GetTrayLeave暂不处理"
);
}
}
}
private
bool
isFastLoad
=
true
;
public
bool
UpdateShelf
(
int
state
=
0
,
string
xnRfid
=
""
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论