Commit 84988642 张东亮

11

1 个父辈 3262408c
...@@ -89,21 +89,34 @@ namespace DeviceLibrary ...@@ -89,21 +89,34 @@ namespace DeviceLibrary
if (RobotManage.InoutDebugMode) if (RobotManage.InoutDebugMode)
return; return;
lock (serverclock) if (Monitor.TryEnter(serverclock, 2000))
{ {
var code = ProcessCode(codelist, 0, 0); try
Operation operation = getLineBoxStatus();
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", code + spiltStr + weight }, { "boxId", StoreID.ToString() }, { "doorReelSignal", "1" } };
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, false, printlog);
if (operation.seq != resultOperation.seq)
{ {
Thread.Sleep(500); var code = ProcessCode(codelist, 0, 0);
SendInStoreRequest(codelist, inOutDevice, printlog); while (true)
return; {
Operation operation = getLineBoxStatus();
for (int i = 0; i < 5; i++)
{
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", code + spiltStr + weight }, { "boxId", StoreID.ToString() }, { "doorReelSignal", "1" } };
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, false, printlog);
if (operation.seq != resultOperation.seq)
{
Thread.Sleep(1000);
continue;
}
ResultProcess(resultOperation, inOutDevice);
return;
}
}
} }
ResultProcess(resultOperation, inOutDevice); finally
{ Monitor.Exit(serverclock); }
} }
} }
public void SendStoreState(string posid, StoreStatus storeStatus) public void SendStoreState(string posid, StoreStatus storeStatus)
...@@ -530,7 +543,7 @@ namespace DeviceLibrary ...@@ -530,7 +543,7 @@ 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"; private static string Addr_PosForPutin = "/service/store/emptyPosForPutin";
/// <summary> /// <summary>
/// 获取库位号 /// 获取库位号
/// </summary> /// </summary>
...@@ -565,28 +578,22 @@ namespace DeviceLibrary ...@@ -565,28 +578,22 @@ namespace DeviceLibrary
if (serverResult == null) if (serverResult == null)
{ {
Thread.Sleep(500);
GetPosId(codelist, inOutDevice, weight);
return; return;
} }
else if (serverResult.result.Equals(100).Equals(true)) if (serverResult.result.Equals(0))
{ {
Thread.Sleep(500); SendInStoreRequest(codelist, inOutDevice, true, weight);
GetPosId(codelist, inOutDevice, weight);
return; return;
} }
if(serverResult.realRfid.Equals(0)) else
{ {
SendInStoreRequest(codelist, inOutDevice, true, weight);
return; return;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error("GetPosId ", ex); LogUtil.error("GetPosId ", ex);
} }
GetPosId(codelist, inOutDevice, weight);
} }
} }
public class ResultData public class ResultData
......
...@@ -192,8 +192,9 @@ namespace DeviceLibrary ...@@ -192,8 +192,9 @@ namespace DeviceLibrary
MoveInfo.log($"已完成扫码,并称重完成 {weight}kg,等待服务器反馈库位 Count={x.Count}"); MoveInfo.log($"已完成扫码,并称重完成 {weight}kg,等待服务器反馈库位 Count={x.Count}");
MoveInfo.MoveParam.IsNg = false; MoveInfo.MoveParam.IsNg = false;
MoveInfo.MoveParam.codeInfos = x; MoveInfo.MoveParam.codeInfos = x;
var cc = x.Select((a) => a.CodeStr); MoveInfo.MoveParam.weight = weight;
mainMachine.ServerCM.GetPosId(cc.ToArray(), this,weight); //var cc = x.Select((a) => a.CodeStr);
//mainMachine.ServerCM.GetPosId(cc.ToArray(), this,weight);
} }
} }
else//超重 else//超重
...@@ -217,8 +218,11 @@ namespace DeviceLibrary ...@@ -217,8 +218,11 @@ namespace DeviceLibrary
{ {
//Msg.add("等待手动选择入库库位", MsgLevel.info); //Msg.add("等待手动选择入库库位", MsgLevel.info);
MoveInfo.NextMoveStep(MoveStep.StartInStore); MoveInfo.NextMoveStep(MoveStep.StartInStore);
return;
} }
else if (MoveInfo.IsTimeOut(5)) var cc = MoveInfo.MoveParam.codeInfos.Select((a) => a.CodeStr);
mainMachine.ServerCM.GetPosId(cc.ToArray(), this, MoveInfo.MoveParam.weight);
if (MoveInfo.IsTimeOut(5))
Msg.add("等待服务器返回库位", MsgLevel.info); Msg.add("等待服务器返回库位", MsgLevel.info);
else if (MoveInfo.IsTimeOut(15)) else if (MoveInfo.IsTimeOut(15))
{ {
......
...@@ -40,6 +40,7 @@ namespace DeviceLibrary ...@@ -40,6 +40,7 @@ namespace DeviceLibrary
public string PosID { get; set; } public string PosID { get; set; }
public string bitmapfilename = ""; public string bitmapfilename = "";
public List<CodeInfo> codeInfos { get; set; } public List<CodeInfo> codeInfos { get; set; }
public double weight { get; set; }
/// <summary> /// <summary>
/// 料盘高度 /// 料盘高度
/// </summary> /// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!