Commit 4a2d765f LN

获取库位号时,需要判断料盘是不是出库料盘

1 个父辈 0e7d1fb1
......@@ -18,12 +18,12 @@ namespace OnlineStore.Common
public string code = "";
}
public class LineOperation
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=成功
/// 0=成功,98=此盘为出库盘。99:暂时不能入库,需要重新获取库位。100:服务器需要更新,需要重新获取库位
/// </summary>
public int result;
public string cid;
......@@ -31,6 +31,18 @@ namespace OnlineStore.Common
public string pos = "";
public string barcode = "";
//以下为出库参数
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 = "";
}
/// <summary>
/// 与服务器通信用对象
......
......@@ -9,6 +9,19 @@ namespace OnlineStore.Common
{
public class FormUtil
{
public static int GetIntValue(string text)
{
int value = 0;
try
{
value = int.Parse(text);
}
catch (Exception ex)
{
value = 0;
}
return value;
}
public static int GetIntValue(TextBox txt)
{
int value = 0;
......
......@@ -651,7 +651,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.debug(Name + "" + msg);
}
}
protected void InLog(string msg)
protected void InLog(string msg )
{
string posId = MoveInfo.MoveParam != null ? "[" + currTrayNum + "][" + MoveInfo.MoveParam.PosId + "][" + MoveInfo.MoveParam.WareCode + "]" : "";
//baseConfig.DType.Equals(DeviceType.HYEquip)
......
......@@ -476,7 +476,14 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.MoveParam = LastPosParam.Clone();
MoveInfo.NextMoveStep(LineMoveStep.FI_32_WaitTray);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
InLog(" " + MoveInfo.SLog + " 开始拦截空托盘 ");
if (LastResult.Equals(98))
{
InLog(" " + MoveInfo.SLog + " 出库料,开始拦截空托盘 ");
}
else
{
InLog(" " + MoveInfo.SLog + " 入库料,开始拦截空托盘 ");
}
ClearTimeoutAlarm("获取库位号超时");
}
......@@ -495,17 +502,26 @@ namespace OnlineStore.DeviceLibrary
int targetPositon = Config.GetUpdownP2Detial(LastHeight, LastWidth);
UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
LastPosParam.TrayNumber = currTrayNum;
TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, LastPosParam.Clone(), LastPosParam.NgMsg);
TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum);
InLog("料盘移栽" + MoveInfo.SLog + ":移栽伺服下降到P2: [" + targetPositon + "] 更新托盘信息【" + tray.ToStr() + "】");
SServerManager.SendPosToStoreCheck(Name, LastPosParam.Clone());
if (LastResult.Equals(98))
{
TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.OutStore, LastPosParam.Clone(), LastPosParam.NgMsg);
TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum);
InLog("料盘移栽" + MoveInfo.SLog + ":升降轴到P2: [" + targetPositon + "] 更新料盘位置,更新托盘信息【" + tray.ToStr() + "】");
SServerManager.UpdateTrayLoc(Name, LastPosParam.WareCode, LocStatus.INLINE, "E" + currTrayNum.ToString().PadLeft(2, '0'));
}
else
{
TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, LastPosParam.Clone(), LastPosParam.NgMsg);
TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum);
InLog("料盘移栽" + MoveInfo.SLog + ":升降轴到P2: [" + targetPositon + "] 更新托盘信息【" + tray.ToStr() + "】");
SServerManager.SendPosToStoreCheck(Name, LastPosParam.Clone());
}
if (IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.LOW) && MoveInfo.ShelfNoTray.Equals(false))
{
InLog("获取库位" + MoveInfo.SLog + ": 上料轴开始慢速上升到P3点,不等待结果");
BatchAxisToP3(false, false);
}
}
ClearTimeoutAlarm("等待空托盘到达超时");
}
else if (MoveInfo.IsTimeOut(180))
......@@ -698,6 +714,7 @@ namespace OnlineStore.DeviceLibrary
}
private Task getPosTask = null;
private InOutParam LastPosParam = null;
private int LastResult = 0;
private void FI_31_GetPosID()
{
MoveInfo.NextMoveStep(LineMoveStep.FI_31_GetPosID);
......@@ -719,6 +736,7 @@ namespace OnlineStore.DeviceLibrary
int ms = 5000;
//从服务器获取库位号
GetPosResult result = SServerManager.GetPosId(Name, LastCodeList, LastHeight, LastWidth, CurrShelfId, DeviceID);
LastResult = result.Result;
if (result.IsTimeOut)
{
if (count < 5)
......@@ -745,7 +763,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
LastPosParam = result.Param;
LastPosParam = result.Param;
break;
}
count++;
......
......@@ -852,13 +852,21 @@ namespace OnlineStore.DeviceLibrary
{
return true;
}
//NG料需要横移
if (tray.InoutPar.InStoreNg)
{
return true;
}
}
}
}
else if (DeviceID.Equals(215))
{
//非分盘料的出库需要横移
//非11,12,23,24的入库料需要横移
//NG料直接横移
if (tray.IsFull)
{
if (tray.InOrOutStore.Equals(2) && (!tray.InoutPar.cutReel))
......@@ -873,6 +881,10 @@ namespace OnlineStore.DeviceLibrary
{
return true;
}
if (tray.InoutPar.InStoreNg)
{
return true;
}
}
}
}
......
......@@ -419,8 +419,8 @@ namespace OnlineStore.DeviceLibrary
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.MI_16_SendEnd);
InLog("入库 " + MoveInfo.SLog + " , 送料流程完成,料仓已开始入库");
LogInfo("入库【" + posId + "】处理(移栽)全部完成!");
MoveEndS();
}
}
else if (MoveInfo.IsStep(LineMoveStep.MI_16_SendEnd))
......
......@@ -441,7 +441,7 @@ namespace OnlineStore.DeviceLibrary
return result;
}
//{"result":"0","msg":"","pos":"11#AC1_18_4_28","barcode":"R506072019102200414","cid":"line-ac-11"}
LineOperation serverResult = JsonHelper.DeserializeJsonToObject<LineOperation>(resultStr);
ForPutinData serverResult = JsonHelper.DeserializeJsonToObject<ForPutinData>(resultStr);
if (serverResult == null)
{
......@@ -453,6 +453,21 @@ namespace OnlineStore.DeviceLibrary
result.Param.NgMsg = "没有收到服务器反馈";
return result;
}
else if ((!string.IsNullOrEmpty(serverResult.msg)) && serverResult.result.Equals(98))
{
result.Result = serverResult.result;
result.Msg = "";
bool cutReel = serverResult.cutReel.ToLower().Equals("true");
bool urgentReel = serverResult.urgentReel.ToLower().Equals("true");
bool smallReel = serverResult.smallReel.ToLower().Equals("true");
int rfidloc = FormUtil.GetIntValue(serverResult.rfidLoc);
int pH = FormUtil.GetIntValue(serverResult.plateH);
int pW = FormUtil.GetIntValue(serverResult.plateW);
result.Param = new InOutParam(0, serverResult.barcode, serverResult.posId, pH, pW, false, urgentReel, cutReel, smallReel, serverResult.rfid, rfidloc);
LogUtil.info(deviceName + "收到出库命令: " + result.Param.ToStr() + " ");
return result;
}
else if ((!string.IsNullOrEmpty(serverResult.msg)) || serverResult.result.Equals(0).Equals(false))
{
result.Result = serverResult.result;
......@@ -615,7 +630,7 @@ namespace OnlineStore.DeviceLibrary
{
public string Msg = "";
/// <summary>
/// 99:暂时不能入库,需要重新获取库位。100:服务器需要更新,需要重新获取库位
/// 0=成功,98=此盘为出库盘。99:暂时不能入库,需要重新获取库位。100:服务器需要更新,需要重新获取库位
/// </summary>
public int Result = 0;
/// <summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!