Commit 317ea9ce LN

工单料去掉getSize处理

1 个父辈 0223cd3f
...@@ -66,37 +66,37 @@ namespace OnlineStore.DeviceLibrary ...@@ -66,37 +66,37 @@ namespace OnlineStore.DeviceLibrary
InOutParam param = tray.InoutPar; InOutParam param = tray.InoutPar;
if (tray.InOrOutStore.Equals(2)) if (tray.InOrOutStore.Equals(2))
{ {
SecondMoveInfo.MoveParam = param.Clone();
return true;
//紧急料,分盘料,直接返回 //紧急料,分盘料,直接返回
if (param.cutReel || param.urgentReel) //if (param.cutReel || param.urgentReel)
{ //{
SecondMoveInfo.MoveParam = param.Clone(); //return true;
return true; //}
} //bool isNg = false;
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, out isNg);
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)
else if (isNg) //{
{ // TrayManager.UpdateInStoreNG(currTrayNum, true, result);
TrayManager.UpdateInStoreNG(currTrayNum, true, result); // LogInfo("更新工单出库料[" + currTrayNum + "] [" + code + "]为NG料:" + result);
LogInfo("更新工单出库料[" + currTrayNum + "] [" + code + "]为NG料:" + result); // tray = TrayManager.GetTrayInfo(currTrayNum);
tray = TrayManager.GetTrayInfo(currTrayNum); // param = tray.InoutPar;
param = tray.InoutPar; // SecondMoveInfo.MoveParam = param.Clone();
SecondMoveInfo.MoveParam = param.Clone(); // return true;
return true; //}
} //else
else //{
{ // LogUtil.info(Name + "[" + currTrayNum + "] [" + tray.ToStr() + "] 获取尺寸失败,托盘继续流转");
//}
LogUtil.info(Name + "[" + currTrayNum + "] [" + tray.ToStr() + "] 获取尺寸失败,托盘继续流转");
}
} }
else if (param.IsNG) else if (param.IsNG)
{ {
......
...@@ -63,64 +63,64 @@ namespace OnlineStore.DeviceLibrary ...@@ -63,64 +63,64 @@ namespace OnlineStore.DeviceLibrary
} }
return codeStr; return codeStr;
} }
public static string GetTraySize(string deviceName, int robotIndex, string codeStr, out int outSize, out bool isNg) //public static string GetTraySize(string deviceName, int robotIndex, string codeStr, out int outSize, out bool isNg)
{ //{
outSize = 0; // outSize = 0;
isNg = false; // isNg = false;
string msg = ""; // string msg = "";
try // try
{ // {
if (String.IsNullOrEmpty(codeStr)) // if (String.IsNullOrEmpty(codeStr))
{ // {
return msg = deviceName + "未扫到条码"; // return msg = deviceName + "未扫到条码";
} // }
string logName = $"GetTraySize [{robotIndex }] [{codeStr}] :"; // string logName = $"GetTraySize [{robotIndex }] [{codeStr}] :";
if (string.IsNullOrEmpty(serverAddr)) // if (string.IsNullOrEmpty(serverAddr))
{ // {
LogUtil.error(deviceName + $"{logName}未找到服务器地址"); // LogUtil.error(deviceName + $"{logName}未找到服务器地址");
return msg; // return msg;
} // }
Dictionary<string, string> paramMap = new Dictionary<string, string>(); // Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("robotIndex", robotIndex.ToString());// 参数: robotIndex = 机器人编号,IP为51的机器人为1, 52的机器人为2, 53的机器人为3 // paramMap.Add("robotIndex", robotIndex.ToString());// 参数: robotIndex = 机器人编号,IP为51的机器人为1, 52的机器人为2, 53的机器人为3
paramMap.Add("barcode", codeStr);// barcode = 扫到的条码 // paramMap.Add("barcode", codeStr);// barcode = 扫到的条码
string server = GetAddr(Addr_getSize, paramMap); // string server = GetAddr(Addr_getSize, paramMap);
DateTime startTime = DateTime.Now; // DateTime startTime = DateTime.Now;
bool isTimeOut = false; // bool isTimeOut = false;
string resultStr = HttpHelper.Post(server, "", Encoding.UTF8, 5000, out isTimeOut); // 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) // if (isTimeOut)
{ // {
return msg = "获取尺寸超时"; // 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 = "没有收到服务器反馈"; // return msg = "没有收到服务器反馈";
} // }
else if (serverResult.code.Equals(0).Equals(false)) // else if (serverResult.code.Equals(0).Equals(false))
{ // {
// code: 0为正常,其他为异常, // // code: 0为正常,其他为异常,
//code不是0,直接NG // //code不是0,直接NG
isNg = true; // isNg = true;
return msg = $" [{ serverResult.code}]:" + serverResult.msg; // 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 + $"{ logName} 获得尺寸:" + outSize); // LogUtil.info(deviceName + $"{ logName} 获得尺寸:" + outSize);
} // }
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
LogUtil.error(deviceName + " ", ex); // LogUtil.error(deviceName + " ", ex);
} // }
return ""; // return "";
} //}
public static string UpdateTrayLoc(string deviceName, string barcode, string status, string locInfo) public static string UpdateTrayLoc(string deviceName, string barcode, string status, string locInfo)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!