public static bool setForkCtrlWithPrompt(ForkLiftWrapper fl, int ctrl) { string cmd = "cmd=pause;pauseStat=" + ctrl; try { fl.getAGVSocketClient().SendMessage(cmd); } catch { Console.WriteLine("setForkCtrlWithPrompt forklift " + fl.getForkLift().id + "cmd = " + cmd + "failed"); AGVLog.WriteInfo("setForkCtrlWithPrompt forklift " + fl.getForkLift().id + "cmd = " + cmd + "failed", new StackFrame(true)); } Console.WriteLine("setForkCtrlWithPrompt forklift " + fl.getForkLift().id + "cmd = " + cmd + "success"); AGVLog.WriteInfo("setForkCtrlWithPrompt forklift " + fl.getForkLift().id + "cmd = " + cmd + "success", new StackFrame(true)); return(true); }
public static bool setForkCtrl(ForkLiftWrapper fl, int ctrl) { string cmd = "cmd=pause;pauseStat=" + ctrl; int times = 0; while (times < 3) { try { fl.getAGVSocketClient().SendMessage(cmd); break; } catch { AGVMessage message = new AGVMessage(); message.setMessageType(AGVMessageHandler_TYPE_T.AGVMessageHandler_SENDPAUSE_ERR); message.setMessageStr("发送中断错误"); AGVMessageHandler.getMessageHandler().setMessage(message); } times++; } Console.WriteLine("setForkCtrl forklift " + fl.getForkLift().id + "cmd = " + cmd); AGVLog.WriteInfo("setForkCtrl forklift " + fl.getForkLift().id + "cmd = " + cmd, new StackFrame(true)); return(true); }