Commit d3f8124f 张东亮

问题修复

1 个父辈 fc530fa1
...@@ -47,22 +47,22 @@ namespace DeviceLibrary ...@@ -47,22 +47,22 @@ namespace DeviceLibrary
{ {
//if (!Monitor.TryEnter(serverConnectTimer)) //if (!Monitor.TryEnter(serverConnectTimer))
//{ //{
try try
{ {
if (!server.StartsWith("http")) if (!server.StartsWith("http"))
return; return;
if (!RobotManage.isRunning) if (!RobotManage.isRunning)
ProcessMsg(Msg.msg); ProcessMsg(Msg.msg);
SendLineStatus(); SendLineStatus();
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.info($"ServerConnectTimer_Elapsed:{ex}"); LogUtil.info($"ServerConnectTimer_Elapsed:{ex}");
} }
finally finally
{ {
//Monitor.Exit(serverConnectTimer); //Monitor.Exit(serverConnectTimer);
} }
//} //}
} }
...@@ -148,7 +148,7 @@ namespace DeviceLibrary ...@@ -148,7 +148,7 @@ namespace DeviceLibrary
LogUtil.info(JsonHelper.SerializeObject(operation)); LogUtil.info(JsonHelper.SerializeObject(operation));
if (RobotManage.InoutDebugMode) if (RobotManage.InoutDebugMode)
return true; return true;
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 5000,true); Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 5000, true);
if (resultOperation == null) if (resultOperation == null)
{ {
...@@ -484,10 +484,10 @@ namespace DeviceLibrary ...@@ -484,10 +484,10 @@ namespace DeviceLibrary
map[ParamDefine.singleReelIn] = ParamDefine.enable; map[ParamDefine.singleReelIn] = ParamDefine.enable;
} }
} }
map[ParamDefine.SendEmptyShelf]= ParamDefine.disable; map[ParamDefine.SendEmptyShelf] = ParamDefine.disable;
map[ParamDefine.SendFullShelf] =ParamDefine.disable; map[ParamDefine.SendFullShelf] = ParamDefine.disable;
map[ParamDefine.NeedEmptySHelf]= ParamDefine.disable; map[ParamDefine.NeedEmptySHelf] = ParamDefine.disable;
map[ParamDefine.NeedFullShelf]= ParamDefine.disable; map[ParamDefine.NeedFullShelf] = ParamDefine.disable;
if (RobotManage.mainMachine?.StringState == MainMachine.StringStateE.None) if (RobotManage.mainMachine?.StringState == MainMachine.StringStateE.None)
{ {
//map[ParamDefine.NeedEmptySHelf] = ParamDefine.enable; //map[ParamDefine.NeedEmptySHelf] = ParamDefine.enable;
...@@ -507,7 +507,7 @@ namespace DeviceLibrary ...@@ -507,7 +507,7 @@ namespace DeviceLibrary
return map; return map;
} }
public Dictionary<string,string> GetAgvBtnStatus() public Dictionary<string, string> GetAgvBtnStatus()
{ {
//mimo呼叫agv按钮 //mimo呼叫agv按钮
Dictionary<string, string> map = new Dictionary<string, string>(); Dictionary<string, string> map = new Dictionary<string, string>();
...@@ -669,7 +669,7 @@ namespace DeviceLibrary ...@@ -669,7 +669,7 @@ namespace DeviceLibrary
} }
else else
{ {
if(plateH==0 || plateW==0) if (plateH == 0 || plateW == 0)
{ {
plateW = position.BagWidth; plateW = position.BagWidth;
plateH = position.BagHigh; plateH = position.BagHigh;
...@@ -696,14 +696,16 @@ namespace DeviceLibrary ...@@ -696,14 +696,16 @@ namespace DeviceLibrary
/// <param name="deviceName"></param> /// <param name="deviceName"></param>
/// <param name="barcode"></param> /// <param name="barcode"></param>
/// <returns></returns> /// <returns></returns>
public string cancelPutInTask(string deviceName, string barcode) public bool cancelPutInTask(string deviceName, string barcode, out string msg)
{ {
string msg = ""; msg = "";
try try
{ {
Dictionary<string, string> paramMap = new Dictionary<string, string>(); Dictionary<string, string> paramMap = new Dictionary<string, string>
paramMap.Add("barcode", barcode); {
{ "barcode", barcode }
};
string server = GetAddr(Addr_cancelPutInTask, paramMap); string server = GetAddr(Addr_cancelPutInTask, paramMap);
DateTime startTime = DateTime.Now; DateTime startTime = DateTime.Now;
...@@ -714,20 +716,26 @@ namespace DeviceLibrary ...@@ -714,20 +716,26 @@ namespace DeviceLibrary
if (data == null) if (data == null)
{ {
return msg = deviceName + " cancelPutInTask【 " + barcode + "】 没有收到服务器反馈"; msg = deviceName + " cancelPutInTask【 " + barcode + "】 没有收到服务器反馈";
return false;
} }
else if (data.code.Equals(0).Equals(false)) else if (data.code.Equals(0).Equals(true) )
{ {
return msg = deviceName + " cancelPutInTask【 " + barcode + "】 :" + data.msg; return true;
} }
else if (data.code.Equals(2002).Equals(true)|| data.code.Equals(2003).Equals(true))
return ""; {
msg = deviceName + " cancelPutInTask【 " + barcode + "】 :" + data.msg;
return true;
}
msg = deviceName + " cancelPutInTask【 " + barcode + "】 :" + data.msg;
return false;
} }
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(deviceName + " " + ex.ToString()); LogUtil.error(deviceName + " " + ex.ToString());
} }
return msg; return false;
} }
private static string GetAddr(string addr, Dictionary<string, string> paramsMap) private static string GetAddr(string addr, Dictionary<string, string> paramsMap)
{ {
......
...@@ -456,14 +456,14 @@ namespace DeviceLibrary ...@@ -456,14 +456,14 @@ namespace DeviceLibrary
break; break;
case MoveStep.StoreTS14: case MoveStep.StoreTS14:
MoveInfo.NextMoveStep(MoveStep.StoreTS15); MoveInfo.NextMoveStep(MoveStep.StoreTS15);
//if (Common.IsInstore(storeMoveType) && !(mainMachine?.StoreMoveInfo?.MoveParam.IsNg ?? false)) if (Common.IsInstore(storeMoveType) && !(mainMachine?.StoreMoveInfo?.MoveParam.IsNg ?? false))
//{ {
// if (!mainMachine.ServerCM.SendStoreState(mainMachine?.StoreMoveInfo?.MoveParam?.PosID, StoreStatus.InStoreEnd)) if (!mainMachine.ServerCM.SendStoreState(mainMachine?.StoreMoveInfo?.MoveParam?.PosID, StoreStatus.InStoreEnd))
// { {
// Msg.add(crc.GetString("Res0008", "服务器连接异常"), MsgLevel.warning); Msg.add(crc.GetString("Res0008", "服务器连接异常"), MsgLevel.warning);
// return false; return false;
// } }
//} }
InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed); InOut_Axis.AbsMove(MoveInfo, Config.InOut_P1, Config.InOut_P1_speed);
MoveInfo.log($"{storeMoveType}:进出轴去待机点P1[{Config.InOut_P1}]"); MoveInfo.log($"{storeMoveType}:进出轴去待机点P1[{Config.InOut_P1}]");
break; break;
......
...@@ -40,21 +40,21 @@ namespace DeviceLibrary ...@@ -40,21 +40,21 @@ namespace DeviceLibrary
/// <param name="reason"></param> /// <param name="reason"></param>
public void DisableInstorePos(string reason= "入库中,放料前急停屏蔽库位") public void DisableInstorePos(string reason= "入库中,放料前急停屏蔽库位")
{ {
try //try
{ //{
if (boxTransport != null) // if (boxTransport != null)
{ // {
if (boxTransport.IsInstore)//&& !boxTransport.IsPutOnOut // if (boxTransport.IsInstore)//&& !boxTransport.IsPutOnOut
{ // {
ServerCommunication.DisablePos(Name, StoreMoveInfo.MoveParam?.WareCode, StoreMoveInfo.MoveParam?.PosID, reason); // ServerCommunication.DisablePos(Name, StoreMoveInfo.MoveParam?.WareCode, StoreMoveInfo.MoveParam?.PosID, reason);
} // }
} // }
} //}
catch (Exception e) //catch (Exception e)
{ //{
LogUtil.error($"DisableInstorePos error", e); // LogUtil.error($"DisableInstorePos error", e);
} //}
} }
void StoreProcess() void StoreProcess()
{ {
...@@ -191,13 +191,13 @@ namespace DeviceLibrary ...@@ -191,13 +191,13 @@ namespace DeviceLibrary
} }
break; break;
case MoveStep.StoreInNG_01: case MoveStep.StoreInNG_01:
string msg = ServerCM.cancelPutInTask(Name, StoreMoveInfo.MoveParam.WareCode); bool rtn = ServerCM.cancelPutInTask(Name, StoreMoveInfo.MoveParam.WareCode,out string msg);
if (string.IsNullOrEmpty(msg)) if (rtn)
{ {
StoreMoveInfo.NextMoveStep(MoveStep.StoreInNG_02); StoreMoveInfo.NextMoveStep(MoveStep.StoreInNG_02);
CloseFlipDoor(StoreMoveInfo); CloseFlipDoor(StoreMoveInfo);
CodeManager.TestHasRight = true; CodeManager.TestHasRight = true;
StoreMoveInfo.log($"取消[{StoreMoveInfo.MoveParam.WareCode}]入库任务"); StoreMoveInfo.log($"取消[{StoreMoveInfo.MoveParam.WareCode}]入库任务:{msg}");
} }
break; break;
case MoveStep.StoreInNG_02: case MoveStep.StoreInNG_02:
......
...@@ -23,6 +23,7 @@ namespace TheMachine ...@@ -23,6 +23,7 @@ namespace TheMachine
[STAThread] [STAThread]
static void Main() static void Main()
{ {
Config.LoadMyConfig(new Setting_Init().GetType()); Config.LoadMyConfig(new Setting_Init().GetType());
//ConfigHelper.Config.Set("CamTestReel_debug", true); //ConfigHelper.Config.Set("CamTestReel_debug", true);
//CodeManager.TestHasReel("", out string a, out string b); //CodeManager.TestHasReel("", out string a, out string b);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!