Commit 73f9bc4a LN

获取尺寸失败时ng

1 个父辈 11f4be57
...@@ -385,7 +385,7 @@ namespace OnlineStore.AssemblyLine ...@@ -385,7 +385,7 @@ namespace OnlineStore.AssemblyLine
rdbUrg.Checked = tray.InoutPar.urgentReel; rdbUrg.Checked = tray.InoutPar.urgentReel;
chbSmall.Checked = tray.InoutPar.smallReel; chbSmall.Checked = tray.InoutPar.smallReel;
txtTrayLoc.Text = tray.InoutPar.rfidLoc.ToString(); txtTrayLoc.Text = tray.InoutPar.rfidLoc.ToString();
chbInStoNG.Checked = tray.InoutPar.InStoreNg; chbInStoNG.Checked = tray.InoutPar.IsNG;
} }
else else
{ {
......
...@@ -66,22 +66,39 @@ namespace OnlineStore.DeviceLibrary ...@@ -66,22 +66,39 @@ namespace OnlineStore.DeviceLibrary
InOutParam param = tray.InoutPar; InOutParam param = tray.InoutPar;
if (tray.InOrOutStore.Equals(2)) if (tray.InOrOutStore.Equals(2))
{ {
//获取尺寸 //紧急料,分盘料,直接返回
if (param.cutReel || param.urgentReel)
{
SecondMoveInfo.MoveParam = param.Clone();
return true;
}
bool isNg = false;
//工单料获取尺寸
int robotIndex = 0; int robotIndex = 0;
string code = SecondMoveInfo.MoveParam.WareCode; string code = SecondMoveInfo.MoveParam.WareCode;
string result = SServerManager.GetTraySize(Name, robotIndex, code, out LastWidth); string result = SServerManager.GetTraySize(Name, robotIndex, code, out LastWidth, out isNg);
LogUtil.info(Name + "[" + currTrayNum + "] [" + code + "] 获取尺寸【" + LastWidth + "】【" + result + "】"); LogUtil.info(Name + "[" + currTrayNum + "] [" + code + "] 获取尺寸【" + LastWidth + "】【" + result + "】");
if (LastWidth > 0) if (LastWidth > 0)
{ {
SecondMoveInfo.MoveParam = param.Clone(); SecondMoveInfo.MoveParam = param.Clone();
return true; return true;
} }
else if (isNg)
{
TrayManager.UpdateInStoreNG(currTrayNum, true, result);
LogInfo("更新工单出库料[" + currTrayNum + "] [" + code + "]为NG料:" + result);
tray = TrayManager.GetTrayInfo(currTrayNum);
param = tray.InoutPar;
SecondMoveInfo.MoveParam = param.Clone();
return true;
}
else else
{ {
LogUtil.info(Name + "[" + currTrayNum + "] [" + tray.ToStr() + "] 获取尺寸失败,托盘继续流转"); LogUtil.info(Name + "[" + currTrayNum + "] [" + tray.ToStr() + "] 获取尺寸失败,托盘继续流转");
} }
} }
else if (param.InStoreNg) else if (param.IsNG)
{ {
SecondMoveInfo.MoveParam = param.Clone(); SecondMoveInfo.MoveParam = param.Clone();
return true; return true;
...@@ -121,13 +138,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -121,13 +138,13 @@ namespace OnlineStore.DeviceLibrary
{ {
reIndex = i; reIndex = i;
currCode = cc; currCode = cc;
SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.InStoreNg); SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.IsNG);
break; break;
} }
} }
if (reIndex >= 0) if (reIndex >= 0)
{ {
if (currCode.PosId.Equals(tray.InoutPar.PosId) && tray.InOrOutStore.Equals(1) && tray.InoutPar.InStoreNg.Equals(false)) if (currCode.PosId.Equals(tray.InoutPar.PosId) && tray.InOrOutStore.Equals(1) && tray.InoutPar.IsNG.Equals(false))
{ {
if (!LineServer.BoxCanInStore(DeviceID)) if (!LineServer.BoxCanInStore(DeviceID))
{ {
...@@ -550,19 +567,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -550,19 +567,17 @@ namespace OnlineStore.DeviceLibrary
} }
else if (MoveInfo.IsStep(LineMoveStep.MI_06_CylinderUp)) else if (MoveInfo.IsStep(LineMoveStep.MI_06_CylinderUp))
{ {
// MoveInfo.NextMoveStep(LineMoveStep.MI_07_ClampCheck);
// InLog("入库 " + MoveInfo.SLog + ": 等待夹爪料盘检测信号=HIGH");
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.ClampCylinder_Check, IO_VALUE.HIGH));
//}
//else if (MoveInfo.IsStep(LineMoveStep.MI_07_ClampCheck))
//{
int num = MoveInfo.MoveParam.TrayNumber; int num = MoveInfo.MoveParam.TrayNumber;
MoveInfo.NextMoveStep(LineMoveStep.MI_10_WaitBox); MoveInfo.NextMoveStep(LineMoveStep.MI_10_WaitBox);
LogInfo("入库【" + posId + "】 " + MoveInfo.SLog + ": 物品已移走,更新托盘【" + num + "】为空盘,删除入库任务"); LogInfo("入库【" + posId + "】 " + MoveInfo.SLog + ": 物品已移走,更新托盘【" + num + "】为空盘,删除入库任务");
MoveInfo.WaitList.Add(WaitResultInfo.WaitBoxCanReviceTray()); MoveInfo.WaitList.Add(WaitResultInfo.WaitBoxCanReviceTray());
TrayManager.UpdateTrayInfo(num); TrayManager.UpdateTrayInfo(num);
RemoveInStore(MoveInfo.MoveParam); RemoveInStore(MoveInfo.MoveParam);
if (OnlyProOutTray)
{
//更新位置在皮带线
SServerManager.UpdateTrayLoc(Name, MoveInfo.MoveParam.WareCode, LocStatus.INBELT, "D7");
}
InLog("放托盘(放开阻挡): " + MoveInfo.SLog + " 物品已移走,顶升气缸1下降"); InLog("放托盘(放开阻挡): " + MoveInfo.SLog + " 物品已移走,顶升气缸1下降");
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopDown); SecondMoveInfo.NextMoveStep(LineMoveStep.MO_14_TopDown);
CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Down); CylinderMove(SecondMoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Down);
...@@ -633,7 +648,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -633,7 +648,7 @@ namespace OnlineStore.DeviceLibrary
string code = MoveInfo.MoveParam.WareCode; string code = MoveInfo.MoveParam.WareCode;
if (OnlyProOutTray) if (OnlyProOutTray)
{ {
if (MoveInfo.MoveParam.InStoreNg) if (MoveInfo.MoveParam.IsNG)
{ {
OutLog( MoveInfo.SLog + ",NG料已放到出料口,发送 cancelPutInTask "); OutLog( MoveInfo.SLog + ",NG料已放到出料口,发送 cancelPutInTask ");
string msg = SServerManager.cancelPutInTask(Name, code); string msg = SServerManager.cancelPutInTask(Name, code);
...@@ -706,12 +721,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -706,12 +721,12 @@ namespace OnlineStore.DeviceLibrary
//判断是否验证成功,如果验证失败,不入库 //判断是否验证成功,如果验证失败,不入库
if (LineServer.RightInPosId(DeviceID, cc.PosId)) if (LineServer.RightInPosId(DeviceID, cc.PosId))
{ {
SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.InStoreNg); SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.IsNG);
return true; return true;
} }
else else
{ {
SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.InStoreNg); SecondMoveInfo.MoveParam = new InOutParam(cc.TrayNumber, cc.WareCode, cc.PosId, cc.PlateH, cc.PlateW, cc.IsNG);
LogUtil.error(Name + "托盘号【" + currTrayNum + "】入库信息【" + cc.ToStr() + "】料仓未验证成功,重新发送验证消息"); LogUtil.error(Name + "托盘号【" + currTrayNum + "】入库信息【" + cc.ToStr() + "】料仓未验证成功,重新发送验证消息");
LineServer.CheckInStorePos(DeviceID, cc); LineServer.CheckInStorePos(DeviceID, cc);
return true; return true;
......
...@@ -64,20 +64,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -64,20 +64,6 @@ namespace OnlineStore.DeviceLibrary
//public static void ClearInOutParam()
//{
// LogUtil.info("-------------------点击:清空托盘。清空前打印托盘信息:");
// List<EquipDataInfo> tray = new List<EquipDataInfo> (paramdataMap.Values);
// foreach (EquipDataInfo t in tray)
// {
// LogUtil.info(t.ToStr());
// }
// paramdataMap = new ConcurrentDictionary<int, EquipDataInfo>();
// SaveMapToFile();
// LogUtil.info("-------------------点击:清空托盘。托盘内容已清空");
//}
private static string FilePath = ""; private static string FilePath = "";
public static void InitFileData() public static void InitFileData()
{ {
......
...@@ -63,9 +63,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -63,9 +63,10 @@ namespace OnlineStore.DeviceLibrary
} }
return codeStr; return codeStr;
} }
public static string GetTraySize(string deviceName, int robotIndex, string codeStr, out int outSize) public static string GetTraySize(string deviceName, int robotIndex, string codeStr, out int outSize, out bool isNg)
{ {
outSize = 0; outSize = 0;
isNg = false;
string msg = ""; string msg = "";
try try
{ {
...@@ -73,9 +74,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -73,9 +74,10 @@ namespace OnlineStore.DeviceLibrary
{ {
return msg = deviceName + "未扫到条码"; return msg = deviceName + "未扫到条码";
} }
string logName = $"GetTraySize [{robotIndex }] [{codeStr}] :";
if (string.IsNullOrEmpty(serverAddr)) if (string.IsNullOrEmpty(serverAddr))
{ {
LogUtil.error(deviceName + "GetTraySize [" + robotIndex + "] [" + codeStr + "] :未找到服务器地址"); LogUtil.error(deviceName + $"{logName}未找到服务器地址");
return msg; return msg;
} }
Dictionary<string, string> paramMap = new Dictionary<string, string>(); Dictionary<string, string> paramMap = new Dictionary<string, string>();
...@@ -84,27 +86,33 @@ namespace OnlineStore.DeviceLibrary ...@@ -84,27 +86,33 @@ namespace OnlineStore.DeviceLibrary
string server = GetAddr(Addr_getSize, paramMap); string server = GetAddr(Addr_getSize, paramMap);
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, ""); bool isTimeOut = false;
string resultStr = HttpHelper.Post(server, "", Encoding.UTF8, 5000, out isTimeOut);
LogUtil.info("GetTraySize " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】"); LogUtil.info("GetTraySize " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
if (isTimeOut)
{
return msg = "获取尺寸超时";
}
//返回: { "code": 0, "msg":"ok", data: 7} //返回: { "code": 0, "msg":"ok", data: 7}
ServerData serverResult = JsonHelper.DeserializeJsonToObject<ServerData>(resultStr); ServerData serverResult = JsonHelper.DeserializeJsonToObject<ServerData>(resultStr);
if (serverResult == null) if (serverResult == null)
{ {
return msg = deviceName + " 【" + robotIndex + "】 条码【 " + codeStr + "】没有收到服务器反馈"; return msg = "没有收到服务器反馈";
} }
else if (serverResult.code.Equals(0).Equals(false)) else if (serverResult.code.Equals(0).Equals(false))
{ {
// code: 0为正常,其他为异常, // code: 0为正常,其他为异常,
// msg:消息, //code不是0,直接NG
return msg = deviceName + " 【" + robotIndex + "】 条码【 " + codeStr + "】返回:" + "[" + serverResult.code + "]" + serverResult.msg; isNg = true;
return msg = $" [{ serverResult.code}]:" + serverResult.msg;
} }
if (!serverResult.data.Equals("")) if (!serverResult.data.Equals(""))
{ {
// data:料盘直径,= 7时升起气缸 // data:料盘直径,= 7时升起气缸
outSize = Convert.ToInt32(serverResult.data); outSize = Convert.ToInt32(serverResult.data);
LogUtil.info(deviceName + "【" + robotIndex + "】 条码【 " + codeStr + "】,获得尺寸:" + outSize); LogUtil.info(deviceName + $"{ logName} 获得尺寸:" + outSize);
} }
} }
catch (Exception ex) catch (Exception ex)
...@@ -449,7 +457,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -449,7 +457,7 @@ namespace OnlineStore.DeviceLibrary
cancelPutInTask(deviceName, codeStr); cancelPutInTask(deviceName, codeStr);
result.Param = new InOutParam(0, codeStr, "", height, width, true); result.Param = new InOutParam(0, codeStr, "", height, width, true);
result.Param.rfid = rfid; result.Param.rfid = rfid;
result.Param.InStoreNg = true; result.Param.IsNG = true;
result.Param.NgMsg = "没有收到服务器反馈"; result.Param.NgMsg = "没有收到服务器反馈";
return result; return result;
} }
...@@ -475,7 +483,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -475,7 +483,7 @@ namespace OnlineStore.DeviceLibrary
result.Msg = serverResult.msg; result.Msg = serverResult.msg;
result.Param = new InOutParam(0, codeStr, "", height, width, true); result.Param = new InOutParam(0, codeStr, "", height, width, true);
result.Param.rfid = rfid; result.Param.rfid = rfid;
result.Param.InStoreNg = true; result.Param.IsNG = true;
result.Param.NgMsg = "" + serverResult.msg; result.Param.NgMsg = "" + serverResult.msg;
return result; return result;
} }
...@@ -502,7 +510,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -502,7 +510,7 @@ namespace OnlineStore.DeviceLibrary
MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId]; MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId];
if (LineManager.Line.IsReviceInPosId(moveEquip, posId)) if (LineManager.Line.IsReviceInPosId(moveEquip, posId))
{ {
result.Param.InStoreNg = true; result.Param.IsNG = true;
result.Param.NgMsg = "入库库位重复"; result.Param.NgMsg = "入库库位重复";
result.Msg = deviceName + ("收到服务器入库命令 " + "入库库位重复: " + result.Param.ToStr() + " ,入库失败!"); result.Msg = deviceName + ("收到服务器入库命令 " + "入库库位重复: " + result.Param.ToStr() + " ,入库失败!");
return result; return result;
...@@ -511,7 +519,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -511,7 +519,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
result.Param.InStoreNg = true; result.Param.IsNG = true;
result.Param.NgMsg = "未找到料仓[" + storeId + "]"; result.Param.NgMsg = "未找到料仓[" + storeId + "]";
result.Msg = deviceName + ("收到服务器入库命令 " + "未找到料仓[" + storeId + "]: " + result.Param.ToStr() + " ,入库失败!"); result.Msg = deviceName + ("收到服务器入库命令 " + "未找到料仓[" + storeId + "]: " + result.Param.ToStr() + " ,入库失败!");
return result; return result;
...@@ -526,7 +534,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -526,7 +534,7 @@ namespace OnlineStore.DeviceLibrary
} }
public static void SendPosToStoreCheck(string deviceName, InOutParam param) public static void SendPosToStoreCheck(string deviceName, InOutParam param)
{ {
if (param == null || param.InStoreNg) if (param == null || param.IsNG)
{ {
return; return;
} }
......
...@@ -97,10 +97,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -97,10 +97,10 @@ namespace OnlineStore.DeviceLibrary
public static void UpdateInStoreNG(int trayNum, bool isNg, string msg) public static void UpdateInStoreNG(int trayNum, bool isNg, string msg)
{ {
LogUtil.info("更新托盘【" + trayNum + "】InStoreNG=【" + isNg + "】NgMsg=【" + msg + "】"); LogUtil.info("更新托盘【" + trayNum + "】IsNG=【" + isNg + "】NgMsg=【" + msg + "】");
if (TrayInfoMap.ContainsKey(trayNum)) if (TrayInfoMap.ContainsKey(trayNum))
{ {
TrayInfoMap[trayNum].InoutPar.InStoreNg = isNg; TrayInfoMap[trayNum].InoutPar.IsNG = isNg;
TrayInfoMap[trayNum].ShowMsg = msg; TrayInfoMap[trayNum].ShowMsg = msg;
TrayInfoMap[trayNum].LastUpdateTime = DateTime.Now; TrayInfoMap[trayNum].LastUpdateTime = DateTime.Now;
...@@ -167,7 +167,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -167,7 +167,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info("加载到缓存托盘:" + tray.ToStr()); LogUtil.info("加载到缓存托盘:" + tray.ToStr());
TrayInfoMap.TryAdd(tray.TrayNum, tray); TrayInfoMap.TryAdd(tray.TrayNum, tray);
if (tray.InOrOutStore.Equals(1) && tray.InoutPar.InStoreNg.Equals(false) && (!tray.InoutPar.PosId.Equals(""))) if (tray.InOrOutStore.Equals(1) && tray.InoutPar.IsNG.Equals(false) && (!tray.InoutPar.PosId.Equals("")))
{ {
int storeId = tray.InoutPar.GetStoreId(); int storeId = tray.InoutPar.GetStoreId();
if (storeId > 0 && LineManager.Line.MoveEquipMap.ContainsKey(storeId)) if (storeId > 0 && LineManager.Line.MoveEquipMap.ContainsKey(storeId))
...@@ -217,7 +217,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -217,7 +217,7 @@ namespace OnlineStore.DeviceLibrary
} }
//如果是入库托盘,需要清理入库消息 //如果是入库托盘,需要清理入库消息
if (tray.InOrOutStore.Equals(1) && tray.InoutPar.InStoreNg.Equals(false) && (!tray.InoutPar.PosId.Equals(""))) if (tray.InOrOutStore.Equals(1) && tray.InoutPar.IsNG.Equals(false) && (!tray.InoutPar.PosId.Equals("")))
{ {
int storeId = tray.InoutPar.GetStoreId(); int storeId = tray.InoutPar.GetStoreId();
if (storeId > 0 && LineManager.Line.MoveEquipMap.ContainsKey(storeId)) if (storeId > 0 && LineManager.Line.MoveEquipMap.ContainsKey(storeId))
......
...@@ -25,7 +25,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -25,7 +25,7 @@ namespace OnlineStore.DeviceLibrary
this.PlateW = plateW; this.PlateW = plateW;
this.PlateH = plateH; this.PlateH = plateH;
this.TrayNumber = trayCode; this.TrayNumber = trayCode;
this.InStoreNg = instoreNg; this.IsNG = instoreNg;
this.urgentReel = urgentReel; this.urgentReel = urgentReel;
this.cutReel = cutReel; this.cutReel = cutReel;
...@@ -63,11 +63,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -63,11 +63,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 是否是入库NG的料盘 /// 是否是入库NG的料盘
/// </summary> /// </summary>
public bool InStoreNg = false; public bool IsNG = false;
public string NgMsg = ""; public string NgMsg = "";
public string ToStr() public string ToStr()
{ {
return $" [{ TrayNumber }] [{ WareCode }] [{ PosId }] [{ PlateW }x{ PlateH }],InStoreNg [{ InStoreNg }],urgentReel [{ urgentReel }],cutReel [{ cutReel }],smallReel [{ smallReel }],rfid [{ rfid }],rfidLoc [{ rfidLoc }]"; return $" [{ TrayNumber }] [{ WareCode }] [{ PosId }] [{ PlateW }x{ PlateH }],InStoreNg [{ IsNG }],urgentReel [{ urgentReel }],cutReel [{ cutReel }],smallReel [{ smallReel }],rfid [{ rfid }],rfidLoc [{ rfidLoc }]";
} }
public string ToShortStr() public string ToShortStr()
{ {
......
...@@ -30,17 +30,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -30,17 +30,19 @@ namespace OnlineStore.DeviceLibrary
if (InOrOutStore.Equals(1)) if (InOrOutStore.Equals(1))
{ {
type = inoutPar.InStoreNg ? "入料失败:" + ShowMsg + "[" + inoutPar.PosId + "][" + inoutPar.WareCode + "] [" + inoutPar.PlateW + "x" + inoutPar.PlateH + "] " : "入料:" + "" + inoutPar.ToStr() + ""; type = inoutPar.IsNG ? "入料失败:" + ShowMsg + "[" + inoutPar.PosId + "][" + inoutPar.WareCode + "] [" + inoutPar.PlateW + "x" + inoutPar.PlateH + "] " : "入料:" + "" + inoutPar.ToStr() + "";
} }
else if (InOrOutStore.Equals(2)) else if (InOrOutStore.Equals(2))
{ {
string outType = "出料:"; string ngstr = InoutPar.IsNG ? "NG(" + InoutPar.NgMsg + ")" : "";
string outType = "出料" + ngstr + ":";
if (inoutPar.urgentReel) if (inoutPar.urgentReel)
{ {
outType = "紧急料:"; outType = "紧急料" + ngstr + ":";
}else if (inoutPar.cutReel) }
else if (inoutPar.cutReel)
{ {
outType = "分盘料:"; outType = "分盘料" + ngstr + ":";
} }
type = outType + inoutPar.ToStr(); type = outType + inoutPar.ToStr();
} }
......
...@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -98,7 +98,7 @@ namespace OnlineStore.DeviceLibrary
LineRunStatus runs = (LineRunStatus)box.SRunStatus; LineRunStatus runs = (LineRunStatus)box.SRunStatus;
if (runs.Equals(LineRunStatus.Busy)) if (runs.Equals(LineRunStatus.Busy))
{ {
if (status.Equals(LineStatus.InStoreEnd) || status.Equals(LineStatus.InStoreExecute) || box.WaitInStoreList.Contains(posId)) if (status.Equals(LineStatus.OutStoreExecute) || status.Equals(LineStatus.OutStoreBoxEnd) || box.WaitInStoreList.Contains(posId))
{ {
return true; return true;
} }
...@@ -131,7 +131,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -131,7 +131,12 @@ namespace OnlineStore.DeviceLibrary
/// <returns></returns> /// <returns></returns>
public static bool BoxCanReviceTray(int id, out string NotOkMsg) public static bool BoxCanReviceTray(int id, out string NotOkMsg)
{ {
NotOkMsg = " [料仓" + id + "可以入库:离线] "; string str = "可以入库";
if (id.Equals(7))
{
str = "取料";
}
NotOkMsg = $" [料仓{id}{str}:离线] ";
BoxInfo box = GetBoxInfo(id); BoxInfo box = GetBoxInfo(id);
if (box != null) if (box != null)
{ {
...@@ -139,17 +144,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -139,17 +144,17 @@ namespace OnlineStore.DeviceLibrary
TimeSpan span = DateTime.Now - box.LastMsgTime; TimeSpan span = DateTime.Now - box.LastMsgTime;
if (span.TotalSeconds > ClientKeepSecond) if (span.TotalSeconds > ClientKeepSecond)
{ {
NotOkMsg = " [料仓" + id + "可以入库:离线] "; NotOkMsg = $" [料仓{id}{str}:离线] ";
return false; return false;
} }
else if (!box.HasTray.Equals(0)) else if (!box.HasTray.Equals(0))
{ {
NotOkMsg = " [料仓" + id + "可以入库:仓门口有料] "; NotOkMsg = $" [料仓{id}{str}:仓门口有料] ";
return false; return false;
} }
else if (!box.SAlarmType.Equals(LineAlarmType.None)) else if (!box.SAlarmType.Equals(LineAlarmType.None))
{ {
NotOkMsg = " [料仓" + id + "可以入库:报警中] "; NotOkMsg = $" [料仓{id}{str}:报警中] ";
return false; return false;
} }
...@@ -163,7 +168,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -163,7 +168,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
NotOkMsg = " [料仓" + id + "可以入库:忙碌中] "; NotOkMsg = $" [料仓{id}{str}:忙碌中] ";
} }
} }
else else
...@@ -174,7 +179,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -174,7 +179,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
NotOkMsg = " [料仓" + id + "可以入库:忙碌中] "; NotOkMsg = $" [料仓{id}{str}:忙碌中] ";
} }
} }
} }
...@@ -288,7 +293,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -288,7 +293,7 @@ namespace OnlineStore.DeviceLibrary
paramList.Add(S_PlateW, param.PlateW); paramList.Add(S_PlateW, param.PlateW);
paramList.Add(S_WareCode, param.WareCode); paramList.Add(S_WareCode, param.WareCode);
paramList.Add(S_RFID, param.rfid); paramList.Add(S_RFID, param.rfid);
paramList.Add(S_NG, param.InStoreNg); paramList.Add(S_NG, param.IsNG);
string msg = ToParamStr(paramList); string msg = ToParamStr(paramList);
TcpClientBean client = ClientMap[id]; TcpClientBean client = ClientMap[id];
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!