Commit 39e3851f 几米阳光

出库等待10分或者height=0

1 个父辈 8d0aa236
...@@ -1257,6 +1257,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1257,6 +1257,7 @@ namespace OnlineStore.DeviceLibrary
{ {
IsNotScanCode = true; IsNotScanCode = true;
IsScanCode = false; IsScanCode = false;
CodeMsg = "没有收到二维码信息,请重新放入料盘";
LogUtil.info(LOGGER, StoreName + "没有收到二维码信息,请重新放入料盘"); LogUtil.info(LOGGER, StoreName + "没有收到二维码信息,请重新放入料盘");
return; return;
} }
...@@ -1264,10 +1265,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -1264,10 +1265,12 @@ namespace OnlineStore.DeviceLibrary
IsNotScanCode = false; IsNotScanCode = false;
if (storeRunStatus.Equals(StoreRunStatus.Wait)) if (storeRunStatus.Equals(StoreRunStatus.Wait))
{ {
CodeMsg = "收到二维码【 " + message + "】,设备未启动,不需要发送服务器";
LogUtil.info(LOGGER, StoreName + "收到二维码【 " + message + "】,设备未启动,不需要发送服务器"); LogUtil.info(LOGGER, StoreName + "收到二维码【 " + message + "】,设备未启动,不需要发送服务器");
IsScanCode = false; IsScanCode = false;
return; return;
} }
CodeMsg = "收到二维码【 " + message + "】,发送给服务器获取入库PosID";
LogUtil.info(LOGGER, StoreName + "收到二维码【 " + message + "】,发送给服务器获取入库PosID"); LogUtil.info(LOGGER, StoreName + "收到二维码【 " + message + "】,发送给服务器获取入库PosID");
//发送扫码内容到服务器进行入库操作 //发送扫码内容到服务器进行入库操作
Operation operation = getLineBoxStatus(); Operation operation = getLineBoxStatus();
...@@ -1277,6 +1280,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1277,6 +1280,7 @@ namespace OnlineStore.DeviceLibrary
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false); Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false);
if (resultOperation == null) if (resultOperation == null)
{ {
CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
LogUtil.info(LOGGER, StoreName + "二维码【" + message + "】没有收到服务器反馈!"); LogUtil.info(LOGGER, StoreName + "二维码【" + message + "】没有收到服务器反馈!");
IsScanCode = false; IsScanCode = false;
return; return;
...@@ -1385,6 +1389,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1385,6 +1389,7 @@ namespace OnlineStore.DeviceLibrary
} }
if (!outMsg.Equals("")) if (!outMsg.Equals(""))
{ {
CodeMsg = "盘尺寸错误,清理二维码【" + message + "】";
LogUtil.error("盘尺寸错误,清理二维码【" + message + "】"); LogUtil.error("盘尺寸错误,清理二维码【" + message + "】");
message = ""; message = "";
} }
...@@ -1601,6 +1606,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -1601,6 +1606,8 @@ namespace OnlineStore.DeviceLibrary
} }
#endregion #endregion
#region 与服务器通信定时器,每1秒向服务器通知一次状态,同时执行出库操作 #region 与服务器通信定时器,每1秒向服务器通知一次状态,同时执行出库操作
private string CodeMsg = "";
private bool isInProcess = false; private bool isInProcess = false;
public void server_connect_timer_Tick(object sender, EventArgs e) public void server_connect_timer_Tick(object sender, EventArgs e)
{ {
...@@ -1663,6 +1670,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -1663,6 +1670,13 @@ namespace OnlineStore.DeviceLibrary
} }
boxStatus.msg = WarnMsg; boxStatus.msg = WarnMsg;
lineOperation.msg = WarnMsg; lineOperation.msg = WarnMsg;
if (WarnMsg.Equals(""))
{
boxStatus.msg = CodeMsg;
lineOperation.msg = CodeMsg;
CodeMsg = "";
}
//WarnMsg = ""; //WarnMsg = "";
//状态 //状态
boxStatus.status = (int)storeStatus; boxStatus.status = (int)storeStatus;
......
...@@ -112,6 +112,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -112,6 +112,10 @@ namespace OnlineStore.DeviceLibrary
return; return;
} }
bool isOk = true; bool isOk = true;
if (StoreMove.OneWaitCanEndStep)
{
isOk = false;
}
foreach (WaitResultInfo wait in list) foreach (WaitResultInfo wait in list)
{ {
if (wait.IsEnd) if (wait.IsEnd)
...@@ -144,7 +148,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -144,7 +148,7 @@ namespace OnlineStore.DeviceLibrary
int timeOutMs = Config.IOSingle_TimerOut; int timeOutMs = Config.IOSingle_TimerOut;
if (StoreMove.MoveStep == StoreMoveStep.SO_14_WaitTake) if (StoreMove.MoveStep == StoreMoveStep.SO_14_WaitTake)
{ {
timeOutMs = 35000; timeOutMs = 650000;
} }
if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs) if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
{ {
...@@ -159,6 +163,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -159,6 +163,13 @@ namespace OnlineStore.DeviceLibrary
else if (wait.WaitType == 3) else if (wait.WaitType == 3)
{ {
wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds); wait.IsEnd = (span.TotalMilliseconds >= wait.TimeMSeconds);
}else if (wait.WaitType == 7)
{
wait.IsEnd = (wait.HeightValue.Equals(GetHeight()));
if (wait.IsEnd)
{
LogUtil.info("等待height="+ wait.HeightValue+"完成");
}
} }
else if (wait.WaitType == 5) else if (wait.WaitType == 5)
{ {
...@@ -175,17 +186,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -175,17 +186,23 @@ namespace OnlineStore.DeviceLibrary
ShuoKeControls.GetStatus(wait.SlvAddr); ShuoKeControls.GetStatus(wait.SlvAddr);
} }
} }
if (wait.IsEnd && StoreMove.OneWaitCanEndStep) if (wait.IsEnd)
{
if (StoreMove.OneWaitCanEndStep)
{ {
isOk = true; isOk = true;
break; break;
} }
else if (wait.IsEnd.Equals(false) && StoreMove.OneWaitCanEndStep.Equals(false)) }
else
{
if (!StoreMove.OneWaitCanEndStep )
{ {
isOk = false; isOk = false;
break; break;
} }
} }
}
if (isOk) if (isOk)
{ {
StoreMove.EndStepWait(); StoreMove.EndStepWait();
...@@ -669,9 +686,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -669,9 +686,10 @@ namespace OnlineStore.DeviceLibrary
else if (StoreMove.MoveStep == StoreMoveStep.SO_13_GoBack) else if (StoreMove.MoveStep == StoreMoveStep.SO_13_GoBack)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_14_WaitTake); StoreMove.NextMoveStep(StoreMoveStep.SO_14_WaitTake);
OutStoreLog("出库:SO_14_WaitTake 等待拿走物品,最多等待30秒"); OutStoreLog("出库:SO_14_WaitTake 等待拿走物品,最多等待600000");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(30000)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(600000));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW)); //StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
StoreMove.OneWaitCanEndStep = true; StoreMove.OneWaitCanEndStep = true;
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_14_WaitTake) else if (StoreMove.MoveStep == StoreMoveStep.SO_14_WaitTake)
......
...@@ -232,6 +232,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -232,6 +232,15 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = false; wait.IsEnd = false;
return wait; return wait;
} }
public static WaitResultInfo WaitHeight(int height)
{
WaitResultInfo wait = new WaitResultInfo();
wait.WaitType = 7;
wait.HeightValue = height;
wait.IsEnd = false;
return wait;
}
public string ToStr() public string ToStr()
{ {
if (WaitType == 1) if (WaitType == 1)
...@@ -264,7 +273,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -264,7 +273,11 @@ namespace OnlineStore.DeviceLibrary
else if (WaitType == 6) else if (WaitType == 6)
{ {
return "轴【" + AxisInfo.DisplayStr + "】ORG信号:【" + IoValue + "】 "; return "轴【" + AxisInfo.DisplayStr + "】ORG信号:【" + IoValue + "】 ";
}else if (WaitType == 7)
{
return "料盘高度【" + HeightValue + "】 ";
} }
else
{ {
return "Wait位置类型:WaitType=【" + WaitType + "】"; return "Wait位置类型:WaitType=【" + WaitType + "】";
} }
...@@ -314,6 +327,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -314,6 +327,10 @@ namespace OnlineStore.DeviceLibrary
/// 是否已经结束 /// 是否已经结束
/// </summary> /// </summary>
public bool IsEnd{ get; set; } public bool IsEnd{ get; set; }
/// <summary>
/// 高度
/// </summary>
public int HeightValue { get; set; }
} }
public enum StoreMoveType public enum StoreMoveType
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!