Commit 84988642 张东亮

11

1 个父辈 3262408c
......@@ -89,21 +89,34 @@ namespace DeviceLibrary
if (RobotManage.InoutDebugMode)
return;
lock (serverclock)
if (Monitor.TryEnter(serverclock, 2000))
{
var code = ProcessCode(codelist, 0, 0);
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)
try
{
Thread.Sleep(500);
SendInStoreRequest(codelist, inOutDevice, printlog);
return;
var code = ProcessCode(codelist, 0, 0);
while (true)
{
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)
......@@ -530,7 +543,7 @@ namespace DeviceLibrary
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>
......@@ -565,28 +578,22 @@ namespace DeviceLibrary
if (serverResult == null)
{
Thread.Sleep(500);
GetPosId(codelist, inOutDevice, weight);
return;
}
else if (serverResult.result.Equals(100).Equals(true))
if (serverResult.result.Equals(0))
{
Thread.Sleep(500);
GetPosId(codelist, inOutDevice, weight);
SendInStoreRequest(codelist, inOutDevice, true, weight);
return;
}
if(serverResult.realRfid.Equals(0))
else
{
SendInStoreRequest(codelist, inOutDevice, true, weight);
return;
}
}
catch (Exception ex)
{
LogUtil.error("GetPosId ", ex);
}
GetPosId(codelist, inOutDevice, weight);
}
}
public class ResultData
......
......@@ -192,8 +192,9 @@ namespace DeviceLibrary
MoveInfo.log($"已完成扫码,并称重完成 {weight}kg,等待服务器反馈库位 Count={x.Count}");
MoveInfo.MoveParam.IsNg = false;
MoveInfo.MoveParam.codeInfos = x;
var cc = x.Select((a) => a.CodeStr);
mainMachine.ServerCM.GetPosId(cc.ToArray(), this,weight);
MoveInfo.MoveParam.weight = weight;
//var cc = x.Select((a) => a.CodeStr);
//mainMachine.ServerCM.GetPosId(cc.ToArray(), this,weight);
}
}
else//超重
......@@ -217,8 +218,11 @@ namespace DeviceLibrary
{
//Msg.add("等待手动选择入库库位", MsgLevel.info);
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);
else if (MoveInfo.IsTimeOut(15))
{
......
......@@ -40,6 +40,7 @@ namespace DeviceLibrary
public string PosID { get; set; }
public string bitmapfilename = "";
public List<CodeInfo> codeInfos { get; set; }
public double weight { get; set; }
/// <summary>
/// 料盘高度
/// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!