Commit d3f8124f 张东亮

问题修复

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