Commit 39e3851f 几米阳光

出库等待10分或者height=0

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