Commit 172560bd LN

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

1 个父辈 0656dc4e
...@@ -454,7 +454,7 @@ namespace OnlineStore.AssemblyLine ...@@ -454,7 +454,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
{ {
......
...@@ -897,13 +897,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -897,13 +897,13 @@ namespace OnlineStore.DeviceLibrary
//非 1,2,3,4,5,13,14,15,16的入库料需要横移 //非 1,2,3,4,5,13,14,15,16的入库料需要横移
if (tray.IsFull) if (tray.IsFull)
{ {
if (tray.InOrOutStore.Equals(1))
{
//NG料需要横移 //NG料需要横移
if (tray.InoutPar.InStoreNg) if (tray.InoutPar.IsNG)
{ {
return true; return true;
} }
if (tray.InOrOutStore.Equals(1))
{
int storeId = tray.InoutPar.GetStoreId(); int storeId = tray.InoutPar.GetStoreId();
List<int> instoreId = new List<int> { 1, 2, 3, 4, 5, 13, 14, 15, 16 }; List<int> instoreId = new List<int> { 1, 2, 3, 4, 5, 13, 14, 15, 16 };
if (!instoreId.Contains(storeId)) if (!instoreId.Contains(storeId))
...@@ -940,16 +940,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -940,16 +940,16 @@ namespace OnlineStore.DeviceLibrary
//NG料直接横移 //NG料直接横移
if (tray.IsFull) if (tray.IsFull)
{ {
if (tray.InOrOutStore.Equals(2) && (!tray.InoutPar.cutReel) && (!tray.InoutPar.urgentReel)) if (tray.InoutPar.IsNG)
{ {
return true; return true;
} }
else if (tray.InOrOutStore.Equals(1)) if (tray.InOrOutStore.Equals(2) && (!tray.InoutPar.cutReel) && (!tray.InoutPar.urgentReel))
{
if (tray.InoutPar.InStoreNg)
{ {
return true; return true;
} }
else if (tray.InOrOutStore.Equals(1))
{
int storeId = tray.InoutPar.GetStoreId(); int storeId = tray.InoutPar.GetStoreId();
List<int> instoreId = new List<int> { 11, 12, 23, 24 }; List<int> instoreId = new List<int> { 11, 12, 23, 24 };
if (!instoreId.Contains(storeId)) if (!instoreId.Contains(storeId))
...@@ -1040,11 +1040,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -1040,11 +1040,11 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
InOutParam param = trayInfo.InoutPar; 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()); 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); SServerManager.cancelPutInTask(Name, trayInfo.InoutPar.WareCode);
} }
......
...@@ -337,8 +337,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -337,8 +337,9 @@ namespace OnlineStore.DeviceLibrary
LastWidth = 0; LastWidth = 0;
int robotIndex = GetRobotIndex(); int robotIndex = GetRobotIndex();
string code = SecondMoveInfo.MoveParam.WareCode; string code = SecondMoveInfo.MoveParam.WareCode;
string result = SServerManager.GetTraySize(Name, robotIndex, code, out LastWidth); bool isNg = false;
OutLog( "接驳台托盘[" + currTrayNum + "] [" + code + "] 获取尺寸【" + LastWidth + "】【" + result + "】"); string result = SServerManager.GetTraySize(Name, robotIndex, code, out LastWidth, out isNg);
OutLog("接驳台托盘[" + currTrayNum + "] [" + code + "] 获取尺寸【" + LastWidth + "】"+(isNg?"NG":"")+"【" + result + "】");
if (LastWidth > 0) if (LastWidth > 0)
{ {
...@@ -349,6 +350,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -349,6 +350,11 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
if (isNg)
{
TrayManager.UpdateInStoreNG(currTrayNum, true, result);
LogInfo("更新工单出库料[" + currTrayNum + "] [" + code + "]为NG料:" + result);
}
JHY_11_TopDown(); JHY_11_TopDown();
} }
} }
...@@ -416,7 +422,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -416,7 +422,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
InOutParam inoup = trayInfo.InoutPar; 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()); LogInfo(" NG料->NG箱" + "" + inoup.ToStr());
//如果分配了库位,需要调用取消 //如果分配了库位,需要调用取消
...@@ -613,7 +619,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -613,7 +619,7 @@ namespace OnlineStore.DeviceLibrary
string msg = SServerManager.afterPutCut(Name, "BN", code, "", 1, out taskData); string msg = SServerManager.afterPutCut(Name, "BN", code, "", 1, out taskData);
afterPutCutOK = true; afterPutCutOK = true;
} }
else if (!MoveInfo.MoveParam.InStoreNg) else if (!MoveInfo.MoveParam.IsNG)
{ {
int robotIndex = GetRobotIndex(); int robotIndex = GetRobotIndex();
OutLog(logName + MoveInfo.SLog + ",工单料到达接驳台,发送 arrive3fRobotLocation "); OutLog(logName + MoveInfo.SLog + ",工单料到达接驳台,发送 arrive3fRobotLocation ");
......
...@@ -493,12 +493,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -493,12 +493,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;
...@@ -605,13 +605,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -605,13 +605,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))
{ {
......
...@@ -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)
...@@ -115,6 +123,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -115,6 +123,7 @@ namespace OnlineStore.DeviceLibrary
} }
public static string UpdateTrayLoc(string deviceName, string barcode, string status, string locInfo) public static string UpdateTrayLoc(string deviceName, string barcode, string status, string locInfo)
{ {
string msg = ""; string msg = "";
...@@ -449,7 +458,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -449,7 +458,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 +484,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -475,7 +484,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 +511,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -502,7 +511,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 +520,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -511,7 +520,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 +535,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -526,7 +535,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;
} }
......
...@@ -100,10 +100,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -100,10 +100,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;
...@@ -170,7 +170,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -170,7 +170,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))
...@@ -220,7 +220,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -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(); 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 }],NG: [{ IsNG }],urgentReel [{ urgentReel }],cutReel [{ cutReel }],smallReel [{ smallReel }],rfid [{ rfid }],rfidLoc [{ rfidLoc }]";
} }
public string ToShortStr() public string ToShortStr()
{ {
......
...@@ -30,17 +30,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -30,17 +30,18 @@ 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();
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!