public void updateAlarm(int alarm) { Console.WriteLine(forkLift.forklift_number + "号车 alarm = " + alarm + "gAlarm =" + forkLift.gAlarm); if (alarm == 0) { forkLift.gAlarm++; } else if (alarm == 1) { forkLift.gAlarm = 0; } Console.WriteLine(forkLift.forklift_number + "号车 alarm = " + alarm + "gAlarm =" + forkLift.gAlarm); if (forkLift.gAlarm > AGVConstant.AGVALARM_TIME) //防撞信号 检测超过12次,弹出报警提示 { string msg = forkLift.forklift_number + "触发防撞,暂停所有AGV"; AGVLog.WriteError(msg, new StackFrame(true)); AGVMessage message = new AGVMessage(); message.setMessageType(AGVMessageHandler_TYPE_T.AGVMessageHandler_AGV_ALARM); message.setMessageStr(msg); TaskexeDao.getDao().InsertTaskexePause(""); TaskexeDao.getDao().InsertTaskexeSysInfo(msg); forkLift.gAlarm = 0; AGVMessageHandler.getMessageHandler().setMessage(message); } }
private void handleLiftComException() { AGVMessage message = new AGVMessage(); message.setMessageType(AGVMessageHandler_TYPE_T.AGVMessageHandler_LIFT_COM); message.setMessageStr("升降机PLC端口异常,请检查,当前处于系统暂停"); AGVMessageHandler.getMessageHandler().setMessage(message); //发送消息 isStop = true; //结束串口读取线程 }
private void sheduleLift() { AGVMessage message = new AGVMessage(); if (ElevatorFactory.getElevator().getOutCommand() == COMMAND_FROME2S.LIFT_OUT_COMMAND_UP_DOWN) //楼上楼下都有货 { AGVLog.WriteWarn("升降机楼上楼下都有货,楼上的车被暂停", new StackFrame(true)); message.setMessageType(AGVMessageHandler_TYPE_T.AGVMEASAGE_LIFT_UPDOWN); message.setMessageStr("升降机楼上楼下都有货,楼上的车被暂停"); AGVMessageHandler.getMessageHandler().setMessage(message); //发送消息 } else if (ElevatorFactory.getElevator().getOutCommand() > COMMAND_FROME2S.LIFT_OUT_COMMAND_UP_DOWN) //升降机 卡货 { AGVLog.WriteWarn("升降机卡货,系统被暂停", new StackFrame(true)); message.setMessageType(AGVMessageHandler_TYPE_T.AGVMessageHandler_LIFT_BUG); message.setMessageStr("升降机卡货,系统被暂停"); AGVMessageHandler.getMessageHandler().setMessage(message); //发送消息 } }
private void checkForkliftPauseStat(ForkLiftWrapper fl, int pause_stat) { if (fl.getForkLift().shedulePause != pause_stat) { setCtrlTimes++; if (setCtrlTimes > 10) { setCtrlTimes = 0; AGVMessage message = new AGVMessage(); message.setMessageType(AGVMessageHandler_TYPE_T.AGVMessageHandler_SENDPAUSE_ERR); message.setMessageStr("检测中断错误"); } } }
private void flReconnect(ForkLiftWrapper forkLiftWrapper, bool status) { if (status) //如果接收成功 { forkLiftWrapper.getAGVSocketClient().startRecvMsg(); //重新启动接收程序线程 } else { AGVLog.WriteError(forkLiftWrapper.getForkLift().forklift_number + "号车 连接错误", new StackFrame(true)); AGVMessage message = new AGVMessage(); message.setMessageType(AGVMessageHandler_TYPE_T.AGVMessageHandler_NET_ERR); message.setMessageStr(forkLiftWrapper.getForkLift().forklift_number + "号车 连接错误"); AGVMessageHandler.getMessageHandler().setMessage(message); } }
private void checkForkliftPauseStat(ForkLiftWrapper fl, int pause_stat) { if (fl.getForkLift().shedulePause != pause_stat) //车的暂停状态与返回值不一样,说明没有发送成功 { setCtrlTimes++; if (setCtrlTimes > 10) { //setForkCtrl(fl, fl.isPaused); //重新发送车子暂停状态 //报警,需要人工处理 setCtrlTimes = 0; AGVMessage message = new AGVMessage(); message.setMessageType(AGVMessageHandler_TYPE_T.AGVMessageHandler_SENDPAUSE_ERR); message.setMessageStr("检测中断错误"); //AGVInitialize.getInitialize().getAGVMessageHandler().setMessage(message); } } }
private void _updateAgvPanel() { AGVMessage message = new AGVMessage(); foreach (AGVPanel ap_s in agvPanelList) { ap_s.updatePanel(); if (ap_s.getForkLiftWrapper().getForkLift().isUsed == 1 && ap_s.getForkLiftWrapper().getBatteryInfo().isBatteryLowpower()) { message.setMessageType(AGVMessageHandler_TYPE_T.AGVMessageHandler_LOWPOWER); message.setMessageStr(ap_s.getForkLiftWrapper().getForkLift().forklift_number + "号车电量低于20%, 请等待已发送的任务完成,然后更换电池,切勿立即关闭程序"); lowpowerBattery = true; } } if (lowpowerBattery) { AGVMessageHandler.getMessageHandler().setMessage(message); } }
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); }
private void checkPausePosition(ForkLiftWrapper fl) { if (fl.getForkLift().shedulePause == 1) { if (fl.getPosition().getArea() == 3 && fl.getPosition().getPx() > AGVConstant.BORDER_X_3 + AGVConstant.BORDER_X_3_DEVIATION_PLUS) //从区域3进入区域2的时候, 如果没有暂停成功或暂停慢了,重新启动车子,并报警 { Console.WriteLine(fl.getForkLift().forklift_number + "号车 pause position = " + fl.getPosition().getPx()); fl.getPosition().setArea(2); fl.getForkLift().shedulePause = 0; AGVMessage message = new AGVMessage(); message.setMessageType(AGVMessageHandler_TYPE_T.AGVMessageHandler_SENDPAUSE_ERR); message.setMessageStr("第二分界线 检测中断错误"); AGVLog.WriteError("第二分界线 检测中断错误", new StackFrame(true)); AGVMessageHandler.getMessageHandler().setMessage(message); } else if (fl.getPosition().getArea() == 2 && fl.getPosition().getPx() > AGVConstant.BORDER_X_2 + AGVConstant.BORDER_X_2_DEVIATION_PLUS) //从区域2进入区域1的时候, 如果没有暂停成功或暂停慢了,重新启动车子,并报警 { Console.WriteLine(fl.getForkLift().forklift_number + "号车 pause position = " + fl.getPosition().getPx()); fl.getPosition().setArea(1); fl.getForkLift().shedulePause = 0; AGVMessage message = new AGVMessage(); message.setMessageType(AGVMessageHandler_TYPE_T.AGVMessageHandler_SENDPAUSE_ERR); message.setMessageStr("第一分界线 检测中断错误"); AGVLog.WriteError("第一分界线 检测中断错误", new StackFrame(true)); AGVMessageHandler.getMessageHandler().setMessage(message); } else if (fl.getPosition().getArea() == 2 && fl.getPosition().getPx() < AGVConstant.BORDER_X_3 - AGVConstant.BORDER_X_3_DEVIATION_PLUS) //从区域2进入区域3的时候,暂停没成功或暂停慢了, 报警,需要手动启动 { Console.WriteLine(fl.getForkLift().forklift_number + "号车 pause position = " + fl.getPosition().getPx()); fl.getPosition().setArea(3); fl.getForkLift().shedulePause = 0; AGVMessage message = new AGVMessage(); message.setMessageType(AGVMessageHandler_TYPE_T.AGVMessageHandler_SENDPAUSE_ERR); message.setMessageStr("第二分界线 检测中断错误"); AGVLog.WriteError("第二分界线 检测中断错误", new StackFrame(true)); AGVMessageHandler.getMessageHandler().setMessage(message); } else if (fl.getPosition().getArea() == 1 && fl.getPosition().getPx() < AGVConstant.BORDER_X_2 - AGVConstant.BORDER_X_2_DEVIATION_PLUS) //从区域2进入区域3的时候,暂停没成功或暂停慢了, 报警,需要手动启动 { Console.WriteLine(fl.getForkLift().forklift_number + "号车 pause position = " + fl.getPosition().getPx()); fl.getPosition().setArea(2); fl.getForkLift().shedulePause = 0; AGVMessage message = new AGVMessage(); message.setMessageType(AGVMessageHandler_TYPE_T.AGVMessageHandler_SENDPAUSE_ERR); message.setMessageStr("第二分界线 检测中断错误"); AGVLog.WriteError("第一分界线 检测中断错误", new StackFrame(true)); AGVMessageHandler.getMessageHandler().setMessage(message); } } }