Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO1057_XLC_Store
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3262408c
由
张东亮
编写于
2023-04-26 11:01:42 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
出库时入库问题修复
1 个父辈
25e078b6
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
112 行增加
和
11 行删除
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/theMachine/InOutDevice_IN.cs
DeviceLibrary/theMachine/MainMachine _Store.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
3262408
...
@@ -88,6 +88,7 @@ namespace DeviceLibrary
...
@@ -88,6 +88,7 @@ namespace DeviceLibrary
if
(
RobotManage
.
InoutDebugMode
)
if
(
RobotManage
.
InoutDebugMode
)
return
;
return
;
lock
(
serverclock
)
lock
(
serverclock
)
{
{
var
code
=
ProcessCode
(
codelist
,
0
,
0
);
var
code
=
ProcessCode
(
codelist
,
0
,
0
);
...
@@ -371,14 +372,14 @@ namespace DeviceLibrary
...
@@ -371,14 +372,14 @@ namespace DeviceLibrary
SendStoreState
(
""
,
StoreStatus
.
InStoreError
);
SendStoreState
(
""
,
StoreStatus
.
InStoreError
);
}
}
}
}
else
if
(
inOutDevice
.
MoveInfo
.
MoveStep
==
MoveStep
.
InWaitServerCallback
)
//
else if (inOutDevice.MoveInfo.MoveStep == MoveStep.InWaitServerCallback)
{
//
{
string
msg
=
resultOperation
.
msg
;
// //
string msg = resultOperation.msg;
SendStoreState
(
""
,
StoreStatus
.
InStoreError
);
// //
SendStoreState("", StoreStatus.InStoreError);
//RobotManage.mainMachine.ClampMoveInfo.NextMoveStep(MoveStep.NGOUT_01);
//
//RobotManage.mainMachine.ClampMoveInfo.NextMoveStep(MoveStep.NGOUT_01);
LogUtil
.
info
(
"服务器没有正确返回库位."
);
// //
LogUtil.info("服务器没有正确返回库位.");
inOutDevice
.
Rescan
();
// //
inOutDevice.Rescan();
}
//
}
else
else
{
{
LogUtil
.
info
(
"扫码时状态错误."
);
LogUtil
.
info
(
"扫码时状态错误."
);
...
@@ -529,6 +530,64 @@ namespace DeviceLibrary
...
@@ -529,6 +530,64 @@ namespace DeviceLibrary
HttpHelper
.
Post
<
DoorInfo
>(
GetPostApi
(
"/api/xlc/updateDoorInfo"
),
dev
.
Value
.
DoorInfo
,
false
);
HttpHelper
.
Post
<
DoorInfo
>(
GetPostApi
(
"/api/xlc/updateDoorInfo"
),
dev
.
Value
.
DoorInfo
,
false
);
}
}
}
}
private
static
string
Addr_PosForPutin
=
"/service/store/robotBox/emptyPosForPutin"
;
/// <summary>
/// 获取库位号
/// </summary>
/// <param name="deviceName"></param>
/// <param name="codeList"></param>
/// <param name="height"></param>
/// <param name="width"></param>
/// <param name="rfid"></param>
/// <param name="lastPosId"></param>
/// <returns></returns>
public
void
GetPosId
(
string
[]
codelist
,
InOutDevice
inOutDevice
,
double
weight
=
0.0
)
{
try
{
string
codeStr
=
""
;
List
<
string
>
list
=
new
List
<
string
>();
var
code
=
ProcessCode
(
codelist
,
0
,
0
);
codeStr
=
code
+
spiltStr
+
weight
;
// 参数:cids: 多个 cid
//code: 条码内容
Dictionary
<
string
,
string
>
paramMap
=
new
Dictionary
<
string
,
string
>();
paramMap
.
Add
(
"cids"
,
CID
);
paramMap
.
Add
(
"code"
,
codeStr
);
string
server
=
GetAddr
(
Addr_PosForPutin
,
paramMap
);
DateTime
startTime
=
DateTime
.
Now
;
string
resultStr
=
HttpHelper
.
Post
(
server
,
""
,
Encoding
.
UTF8
,
10000
);
LogUtil
.
info
(
$
"GetPosId 【{server}】【{resultStr}】"
);
//{"result":"0","msg":"","pos":"11#AC1_18_4_28","barcode":"R506072019102200414","cid":"line-ac-11"}
ForPutinData
serverResult
=
JsonHelper
.
DeserializeJsonToObject
<
ForPutinData
>(
resultStr
);
if
(
serverResult
==
null
)
{
Thread
.
Sleep
(
500
);
GetPosId
(
codelist
,
inOutDevice
,
weight
);
return
;
}
else
if
(
serverResult
.
result
.
Equals
(
100
).
Equals
(
true
))
{
Thread
.
Sleep
(
500
);
GetPosId
(
codelist
,
inOutDevice
,
weight
);
return
;
}
if
(
serverResult
.
realRfid
.
Equals
(
0
))
{
SendInStoreRequest
(
codelist
,
inOutDevice
,
true
,
weight
);
return
;
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"GetPosId "
,
ex
);
}
GetPosId
(
codelist
,
inOutDevice
,
weight
);
}
}
}
public
class
ResultData
public
class
ResultData
{
{
...
@@ -604,7 +663,49 @@ namespace DeviceLibrary
...
@@ -604,7 +663,49 @@ namespace DeviceLibrary
/// </summary>
/// </summary>
InStoreError
=
14
,
InStoreError
=
14
,
}
}
public
class
GetPosResult
{
/// <summary>
/// 消息字符串
/// </summary>
public
string
Msg
=
""
;
/// <summary>
/// 0=获取库位成功,98=此盘为出库盘。99:暂时不能入库,需要重新获取库位。
/// 100:服务器需要更新,需要重新获取库位
/// 105:查找空库位失败,NG
/// </summary>
public
int
Result
;
/// <summary>
/// 获取超时,需要重新获取库位
/// </summary>
public
bool
IsTimeOut
=
false
;
}
public
class
ForPutinData
{
// //{"result":"0","msg":"","pos":"11#AC1_18_4_28","barcode":"R506072019102200414","cid":"line-ac-11"}
// 返回: {"code": 0, "msg":"ok", data:7}
/// <summary>
/// 0=成功,98=此盘为出库盘。99:暂时不能入库,需要重新获取库位。100:服务器需要更新,需要重新获取库位
/// </summary>
public
int
result
;
public
string
cid
;
public
string
msg
=
""
;
public
string
pos
=
""
;
public
string
barcode
=
""
;
public
string
taskId
=
""
;
//以下为出库参数
public
string
posId
=
""
;
public
string
plateW
=
""
;
public
string
plateH
=
""
;
public
string
singleOut
=
""
;
public
string
urgentReel
=
""
;
public
string
cutReel
=
""
;
public
string
rfid
=
""
;
public
string
realRfid
=
""
;
public
string
rfidLoc
=
""
;
public
string
smallReel
=
""
;
}
public
class
DoorInfo
public
class
DoorInfo
{
{
public
DoorInfo
()
public
DoorInfo
()
...
...
DeviceLibrary/theMachine/InOutDevice_IN.cs
查看文件 @
3262408
...
@@ -193,7 +193,7 @@ namespace DeviceLibrary
...
@@ -193,7 +193,7 @@ namespace DeviceLibrary
MoveInfo
.
MoveParam
.
IsNg
=
false
;
MoveInfo
.
MoveParam
.
IsNg
=
false
;
MoveInfo
.
MoveParam
.
codeInfos
=
x
;
MoveInfo
.
MoveParam
.
codeInfos
=
x
;
var
cc
=
x
.
Select
((
a
)
=>
a
.
CodeStr
);
var
cc
=
x
.
Select
((
a
)
=>
a
.
CodeStr
);
mainMachine
.
ServerCM
.
SendInStoreRequest
(
cc
.
ToArray
(),
this
,
true
,
weight
);
mainMachine
.
ServerCM
.
GetPosId
(
cc
.
ToArray
(),
this
,
weight
);
}
}
}
}
else
//超重
else
//超重
...
@@ -222,7 +222,7 @@ namespace DeviceLibrary
...
@@ -222,7 +222,7 @@ namespace DeviceLibrary
Msg
.
add
(
"等待服务器返回库位"
,
MsgLevel
.
info
);
Msg
.
add
(
"等待服务器返回库位"
,
MsgLevel
.
info
);
else
if
(
MoveInfo
.
IsTimeOut
(
15
))
else
if
(
MoveInfo
.
IsTimeOut
(
15
))
{
{
MoveInfo
.
NextMoveStep
(
MoveStep
.
Wait
);
//
MoveInfo.NextMoveStep(MoveStep.Wait);
MoveInfo
.
log
(
$
"等待服务器返回库位超时"
);
MoveInfo
.
log
(
$
"等待服务器返回库位超时"
);
}
}
break
;
break
;
...
...
DeviceLibrary/theMachine/MainMachine _Store.cs
查看文件 @
3262408
...
@@ -40,7 +40,7 @@ namespace DeviceLibrary
...
@@ -40,7 +40,7 @@ namespace DeviceLibrary
StoreMoveInfo
.
log
(
$
"{CurrentSide}:入库周转箱已准备好"
);
StoreMoveInfo
.
log
(
$
"{CurrentSide}:入库周转箱已准备好"
);
}
}
//判断有没有出库任务, 需要入库空闲, 出口空闲
//判断有没有出库任务, 需要入库空闲, 出口空闲
else
if
(
boxTransport
.
IsComplateOrFree
)
{
else
if
(
boxTransport
.
IsComplateOrFree
&&
ServerCM
.
storeStatus
.
Equals
(
StoreStatus
.
StoreOnline
)
)
{
if
(
InOutDevice
.
GetOutStoreFreeSide
(
out
InOutSideE
inOutSide2
,
out
InOutDevice
iod2
)
&&
OutStoreJobList
.
Dequeue
(
out
JobInfo
jobInfo
))
if
(
InOutDevice
.
GetOutStoreFreeSide
(
out
InOutSideE
inOutSide2
,
out
InOutDevice
iod2
)
&&
OutStoreJobList
.
Dequeue
(
out
JobInfo
jobInfo
))
{
{
StoreMoveInfo
.
log
(
"检测到出库空闲侧:"
+
inOutSide2
);
StoreMoveInfo
.
log
(
"检测到出库空闲侧:"
+
inOutSide2
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论