Commit 172560bd LN

接驳台获取尺寸NG后送料到NG箱。

1 个父辈 0656dc4e
......@@ -454,7 +454,7 @@ namespace OnlineStore.AssemblyLine
rdbUrg.Checked = tray.InoutPar.urgentReel;
chbSmall.Checked = tray.InoutPar.smallReel;
txtTrayLoc.Text = tray.InoutPar.rfidLoc.ToString();
chbInStoNG.Checked = tray.InoutPar.InStoreNg;
chbInStoNG.Checked = tray.InoutPar.IsNG;
}
else
{
......
......@@ -896,14 +896,14 @@ namespace OnlineStore.DeviceLibrary
{
//非 1,2,3,4,5,13,14,15,16的入库料需要横移
if (tray.IsFull)
{
if (tray.InOrOutStore.Equals(1))
{
//NG料需要横移
if (tray.InoutPar.IsNG)
{
//NG料需要横移
if (tray.InoutPar.InStoreNg)
{
return true;
}
return true;
}
if (tray.InOrOutStore.Equals(1))
{
int storeId = tray.InoutPar.GetStoreId();
List<int> instoreId = new List<int> { 1, 2, 3, 4, 5, 13, 14, 15, 16 };
if (!instoreId.Contains(storeId))
......@@ -940,16 +940,16 @@ namespace OnlineStore.DeviceLibrary
//NG料直接横移
if (tray.IsFull)
{
if (tray.InoutPar.IsNG)
{
return true;
}
if (tray.InOrOutStore.Equals(2) && (!tray.InoutPar.cutReel) && (!tray.InoutPar.urgentReel))
{
return true;
}
else if (tray.InOrOutStore.Equals(1))
{
if (tray.InoutPar.InStoreNg)
{
return true;
}
{
int storeId = tray.InoutPar.GetStoreId();
List<int> instoreId = new List<int> { 11, 12, 23, 24 };
if (!instoreId.Contains(storeId))
......@@ -1040,11 +1040,11 @@ namespace OnlineStore.DeviceLibrary
return false;
}
InOutParam param = trayInfo.InoutPar;
if (trayInfo.IsFull && trayInfo.InoutPar.InStoreNg && this.DeviceID.Equals(216))
if (trayInfo.IsFull && trayInfo.InoutPar.IsNG && this.DeviceID.Equals(216))
{
LogInfo(" C1->出料线:NG料" + "" + param.ToStr());
//如果分配了库位,需要调用取消
if (trayInfo.InoutPar.WareCode != "" && trayInfo.InoutPar.PosId != "")
if (trayInfo.InoutPar.WareCode != "" && trayInfo.InoutPar.PosId != ""&&trayInfo.InOrOutStore.Equals(1))
{
SServerManager.cancelPutInTask(Name, trayInfo.InoutPar.WareCode);
}
......
......@@ -337,8 +337,9 @@ namespace OnlineStore.DeviceLibrary
LastWidth = 0;
int robotIndex = GetRobotIndex();
string code = SecondMoveInfo.MoveParam.WareCode;
string result = SServerManager.GetTraySize(Name, robotIndex, code, out LastWidth);
OutLog( "接驳台托盘[" + currTrayNum + "] [" + code + "] 获取尺寸【" + LastWidth + "】【" + result + "】");
bool isNg = false;
string result = SServerManager.GetTraySize(Name, robotIndex, code, out LastWidth, out isNg);
OutLog("接驳台托盘[" + currTrayNum + "] [" + code + "] 获取尺寸【" + LastWidth + "】"+(isNg?"NG":"")+"【" + result + "】");
if (LastWidth > 0)
{
......@@ -349,6 +350,11 @@ namespace OnlineStore.DeviceLibrary
}
else
{
if (isNg)
{
TrayManager.UpdateInStoreNG(currTrayNum, true, result);
LogInfo("更新工单出库料[" + currTrayNum + "] [" + code + "]为NG料:" + result);
}
JHY_11_TopDown();
}
}
......@@ -416,7 +422,7 @@ namespace OnlineStore.DeviceLibrary
return false;
}
InOutParam inoup = trayInfo.InoutPar;
if (trayInfo.IsFull && trayInfo.InoutPar.InStoreNg && this.DeviceID.Equals(217))
if (trayInfo.IsFull && trayInfo.InoutPar.IsNG && this.DeviceID.Equals(217)&& trayInfo.InOrOutStore.Equals(1))
{
LogInfo(" NG料->NG箱" + "" + inoup.ToStr());
//如果分配了库位,需要调用取消
......@@ -613,7 +619,7 @@ namespace OnlineStore.DeviceLibrary
string msg = SServerManager.afterPutCut(Name, "BN", code, "", 1, out taskData);
afterPutCutOK = true;
}
else if (!MoveInfo.MoveParam.InStoreNg)
else if (!MoveInfo.MoveParam.IsNG)
{
int robotIndex = GetRobotIndex();
OutLog(logName + MoveInfo.SLog + ",工单料到达接驳台,发送 arrive3fRobotLocation ");
......
......@@ -493,12 +493,12 @@ namespace OnlineStore.DeviceLibrary
//判断是否验证成功,如果验证失败,不入库
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;
}
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() + "】料仓未验证成功,重新发送验证消息");
LineServer.CheckInStorePos(DeviceID, cc);
return true;
......@@ -605,13 +605,13 @@ namespace OnlineStore.DeviceLibrary
{
reIndex = i;
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;
}
}
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))
{
......
......@@ -63,9 +63,10 @@ namespace OnlineStore.DeviceLibrary
}
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;
isNg = false;
string msg = "";
try
{
......@@ -73,9 +74,10 @@ namespace OnlineStore.DeviceLibrary
{
return msg = deviceName + "未扫到条码";
}
string logName = $"GetTraySize [{robotIndex }] [{codeStr}] :";
if (string.IsNullOrEmpty(serverAddr))
{
LogUtil.error(deviceName + "GetTraySize [" + robotIndex + "] [" + codeStr + "] :未找到服务器地址");
LogUtil.error(deviceName + $"{logName}未找到服务器地址");
return msg;
}
Dictionary<string, string> paramMap = new Dictionary<string, string>();
......@@ -84,27 +86,33 @@ namespace OnlineStore.DeviceLibrary
string server = GetAddr(Addr_getSize, paramMap);
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 + "】");
if (isTimeOut)
{
return msg = "获取尺寸超时";
}
//返回: { "code": 0, "msg":"ok", data: 7}
ServerData serverResult = JsonHelper.DeserializeJsonToObject<ServerData>(resultStr);
if (serverResult == null)
{
return msg = deviceName + " 【" + robotIndex + "】 条码【 " + codeStr + "】没有收到服务器反馈";
return msg = "没有收到服务器反馈";
}
else if (serverResult.code.Equals(0).Equals(false))
{
// code: 0为正常,其他为异常,
// msg:消息,
return msg = deviceName + " 【" + robotIndex + "】 条码【 " + codeStr + "】返回:" + "[" + serverResult.code + "]" + serverResult.msg;
//code不是0,直接NG
isNg = true;
return msg = $" [{ serverResult.code}]:" + serverResult.msg;
}
if (!serverResult.data.Equals(""))
{
// data:料盘直径,= 7时升起气缸
outSize = Convert.ToInt32(serverResult.data);
LogUtil.info(deviceName + "【" + robotIndex + "】 条码【 " + codeStr + "】,获得尺寸:" + outSize);
LogUtil.info(deviceName + $"{ logName} 获得尺寸:" + outSize);
}
}
catch (Exception ex)
......@@ -115,6 +123,7 @@ namespace OnlineStore.DeviceLibrary
}
public static string UpdateTrayLoc(string deviceName, string barcode, string status, string locInfo)
{
string msg = "";
......@@ -449,7 +458,7 @@ namespace OnlineStore.DeviceLibrary
cancelPutInTask(deviceName, codeStr);
result.Param = new InOutParam(0, codeStr, "", height, width, true);
result.Param.rfid = rfid;
result.Param.InStoreNg = true;
result.Param.IsNG = true;
result.Param.NgMsg = "没有收到服务器反馈";
return result;
}
......@@ -475,7 +484,7 @@ namespace OnlineStore.DeviceLibrary
result.Msg = serverResult.msg;
result.Param = new InOutParam(0, codeStr, "", height, width, true);
result.Param.rfid = rfid;
result.Param.InStoreNg = true;
result.Param.IsNG = true;
result.Param.NgMsg = "" + serverResult.msg;
return result;
}
......@@ -502,7 +511,7 @@ namespace OnlineStore.DeviceLibrary
MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId];
if (LineManager.Line.IsReviceInPosId(moveEquip, posId))
{
result.Param.InStoreNg = true;
result.Param.IsNG = true;
result.Param.NgMsg = "入库库位重复";
result.Msg = deviceName + ("收到服务器入库命令 " + "入库库位重复: " + result.Param.ToStr() + " ,入库失败!");
return result;
......@@ -511,7 +520,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
result.Param.InStoreNg = true;
result.Param.IsNG = true;
result.Param.NgMsg = "未找到料仓[" + storeId + "]";
result.Msg = deviceName + ("收到服务器入库命令 " + "未找到料仓[" + storeId + "]: " + result.Param.ToStr() + " ,入库失败!");
return result;
......@@ -526,7 +535,7 @@ namespace OnlineStore.DeviceLibrary
}
public static void SendPosToStoreCheck(string deviceName, InOutParam param)
{
if (param == null || param.InStoreNg)
if (param == null || param.IsNG)
{
return;
}
......
......@@ -100,10 +100,10 @@ namespace OnlineStore.DeviceLibrary
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))
{
TrayInfoMap[trayNum].InoutPar.InStoreNg = isNg;
TrayInfoMap[trayNum].InoutPar.IsNG = isNg;
TrayInfoMap[trayNum].ShowMsg = msg;
TrayInfoMap[trayNum].LastUpdateTime = DateTime.Now;
......@@ -170,7 +170,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info("加载到缓存托盘:" + tray.ToStr());
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();
if (storeId > 0 && LineManager.Line.MoveEquipMap.ContainsKey(storeId))
......@@ -220,7 +220,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();
if (storeId > 0 && LineManager.Line.MoveEquipMap.ContainsKey(storeId))
......
......@@ -25,7 +25,7 @@ namespace OnlineStore.DeviceLibrary
this.PlateW = plateW;
this.PlateH = plateH;
this.TrayNumber = trayCode;
this.InStoreNg = instoreNg;
this.IsNG = instoreNg;
this.urgentReel = urgentReel;
this.cutReel = cutReel;
......@@ -63,11 +63,11 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 是否是入库NG的料盘
/// </summary>
public bool InStoreNg = false;
public bool IsNG = false;
public string NgMsg = "";
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 }],NG: [{ IsNG }],urgentReel [{ urgentReel }],cutReel [{ cutReel }],smallReel [{ smallReel }],rfid [{ rfid }],rfidLoc [{ rfidLoc }]";
}
public string ToShortStr()
{
......
......@@ -30,17 +30,18 @@ namespace OnlineStore.DeviceLibrary
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))
{
string outType = "出料:";
string ngstr = InoutPar.IsNG ? "NG("+InoutPar.NgMsg+")" : "";
string outType = "出料"+ ngstr + ":";
if (inoutPar.urgentReel)
{
outType = "紧急料:";
outType = "紧急料" + ngstr + ":";
}else if (inoutPar.cutReel)
{
outType = "分盘料:";
outType = "分盘料" + ngstr + ":";
}
type = outType + inoutPar.ToStr();
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!