| | |
| | | wrkMast.setWrkSts(WrkStsType.CHARGE_SHUTTLE_COMPLETE.sts); |
| | | shuttleThread.setSyncTaskNo(0); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Shuttle), shuttleProtocol.getShuttleNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.SHUTTLE_POWER_COMPLETE);//触发通知 |
| | | } else if (wrkMast.getWrkSts() == WrkStsType.MOVE_IN_NO_LIFT_1.sts) { |
| | | wrkMast.setWrkSts(WrkStsType.MOVE_IN_NO_LIFT_2.sts); |
| | | shuttleThread.setSyncTaskNo(0); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Shuttle), shuttleProtocol.getShuttleNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.SHUTTLE_POWER_COMPLETE);//触发通知 |
| | | } else if (wrkMast.getWrkSts() == WrkStsType.MOVE_IN_NO_LIFT_3.sts) { |
| | | } |
| | | // else if (wrkMast.getWrkSts() == WrkStsType.MOVE_IN_NO_LIFT_1.sts) { |
| | | // wrkMast.setWrkSts(WrkStsType.MOVE_IN_NO_LIFT_2.sts); |
| | | // shuttleThread.setSyncTaskNo(0); |
| | | // notifyUtils.notify(String.valueOf(SlaveType.Shuttle), shuttleProtocol.getShuttleNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.SHUTTLE_POWER_COMPLETE);//触发通知 |
| | | // } |
| | | else if (wrkMast.getWrkSts() == WrkStsType.MOVE_IN_NO_LIFT_3.sts) { |
| | | wrkMast.setWrkSts(WrkStsType.MOVE_IN_NO_LIFT_4.sts); |
| | | shuttleThread.setSyncTaskNo(0); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Shuttle), shuttleProtocol.getShuttleNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.SHUTTLE_POWER_COMPLETE);//触发通知 |
| | |
| | | shuttleThread.setSyncTaskNo(0); |
| | | notifyUtils.notify(String.valueOf(SlaveType.Shuttle), shuttleProtocol.getShuttleNo(), String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.SHUTTLE_POWER_COMPLETE);//触发通知 |
| | | } |
| | | |
| | | |
| | | |
| | | else { |
| | |
| | | } else if (wrkMast.getWrkSts() == WrkStsType.MOVE_IN_NO_LIFT_9.sts) { |
| | | //提升机至小车层 ==> 提升机至小车层完成 |
| | | wrkMast.setWrkSts(WrkStsType.MOVE_IN_NO_LIFT_10.sts); |
| | | }else if (wrkMast.getWrkSts() == WrkStsType.MOVE_OUT_NO_LIFT_8.sts) { |
| | | //提升机至小车层 ==> 提升机至小车层完成 |
| | | wrkMast.setWrkSts(WrkStsType.MOVE_OUT_NO_LIFT_9.sts); |
| | | }else if (wrkMast.getWrkSts() == WrkStsType.MOVE_OUT_NO_LIFT_4.sts) { |
| | | //提升机至小车层 ==> 提升机至小车层完成 |
| | | wrkMast.setWrkSts(WrkStsType.MOVE_OUT_NO_LIFT_5.sts); |
| | | } |
| | | |
| | | wrkMast.setModiTime(new Date()); |
| | |
| | | import com.zy.core.model.command.ShuttleCommand; |
| | | import com.zy.core.model.protocol.LiftProtocol; |
| | | import com.zy.core.model.protocol.ShuttleProtocol; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.thread.DevpThread; |
| | | import com.zy.core.thread.LiftThread; |
| | | import com.zy.core.thread.ShuttleThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | if (shuttleProtocol == null) { |
| | | return false; |
| | | } |
| | | |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | if (devpThread == null) { |
| | | return false; |
| | | } |
| | | StaProtocol staProtocol = devpThread.getStation().get(Utils.getLev(wrkMast.getSourceLocNo()) == 1 ? 1015 : 1026); |
| | | if (!staProtocol.isLoading()) { |
| | | log.info("{}任务,{}号输送线无物", wrkMast.getWrkNo(), wrkMast.getSourceStaNo()); |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}号输送线无物", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); |
| | | return false; |
| | | } |
| | | //TODO |
| | | // if (!staProtocol.getFinishWorkNo().equals(wrkMast.getWrkNo())) { |
| | | // log.info( "{}任务,{}号输送线的工作号和工作档不匹配", wrkMast.getWrkNo(), wrkMast.getSourceStaNo()); |
| | | // News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}号输送线的工作号和工作档不匹配", wrkMast.getWrkNo(), wrkMast.getSourceStaNo()); |
| | | // return false; |
| | | // } |
| | | //小车处于空闲状态 |
| | | if (!shuttleThread.isIdle()) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}小车,小车忙碌中", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo()); |
| | |
| | | Date now = new Date(); |
| | | |
| | | //小车移动至站点 301.生成小车移库任务 ==> 302.小车移动至站点中 |
| | | if (wrkMast.getWrkSts() == WrkStsType.MOVE_IN_NO_LIFT_2.sts) { |
| | | if (wrkMast.getWrkSts() == WrkStsType.MOVE_IN_NO_LIFT_1.sts) { |
| | | //获取四向穿梭车线程 |
| | | ShuttleThread shuttleThread = (ShuttleThread) SlaveConnection.get(SlaveType.Shuttle, wrkMast.getShuttleNo()); |
| | | if (shuttleThread == null) { |
| | |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}小车,小车忙碌中", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo()); |
| | | return false; |
| | | } |
| | | |
| | | if (!shuttleProtocol.getCurrentLocNo().equals(wrkMast.getSourceLocNo())) { |
| | | return false; |
| | | } |
| | | |
| | | //获取穿梭车最近且空闲的提升机 |
| | | LiftThread liftThread = LiftUtils.getRecentLift(shuttleProtocol.getCurrentLocNo()); |
| | |
| | | List<ShuttleCommand> commands = new ArrayList<>(); |
| | | Integer mapType = NavigationMapType.NORMAL.id; |
| | | |
| | | if (!liftStandByLocNo.equals(wrkMast.getSourceLocNo())) { |
| | | //获取小车到提升机待机位行走命令 |
| | | List<ShuttleCommand> moveCommands = shuttleOperaUtils.getStartToTargetCommands(shuttleProtocol.getCurrentLocNo(), liftStandByLocNo, mapType, assignCommand, shuttleThread); |
| | | if (moveCommands == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}小车,路径计算失败", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo()); |
| | | return false;//路径解锁失败 |
| | | } |
| | | commands.addAll(moveCommands); |
| | | |
| | | //获取小车到提升机待机位行走命令 |
| | | List<ShuttleCommand> moveCommands = shuttleOperaUtils.getStartToTargetCommands(shuttleProtocol.getCurrentLocNo(), liftStandByLocNo, mapType, assignCommand, shuttleThread); |
| | | if (moveCommands == null) { |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}小车,路径计算失败", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo()); |
| | | return false;//路径解锁失败 |
| | | } |
| | | commands.addAll(moveCommands); |
| | | |
| | | List<ShuttleCommand> liftCommand = shuttleOperaUtils.getShuttleLiftCommand(assignCommand, shuttleThread, true); |
| | | if (liftCommand == null) { |
| | |
| | | return false;//提升机内无小车 |
| | | } |
| | | |
| | | //判断提升机内是否有托盘 |
| | | if (!liftProtocol.getHasTray()) { |
| | | News.info("{}任务,{}号提升机,提升机内无托盘,禁止派发", wrkMast.getWrkNo(), liftProtocol.getLiftNo()); |
| | | return false;//提升机内无小车 |
| | | } |
| | | |
| | | |
| | | //判断提升机楼层 |
| | | if (liftProtocol.getLev() == Utils.getLev(shuttleProtocol.getCurrentLocNo())) { |
| | |
| | | return false;//提升机内无小车 |
| | | } |
| | | |
| | | //判断提升机内是否有托盘 |
| | | if (!liftProtocol.getHasTray()) { |
| | | News.info("{}任务,{}号提升机,提升机内无托盘,禁止派发", wrkMast.getWrkNo(), liftProtocol.getLiftNo()); |
| | | return false;//提升机内无小车 |
| | | } |
| | | |
| | | |
| | | //判断提升机楼层 |
| | | if (liftProtocol.getLev() != Utils.getLev(shuttleProtocol.getCurrentLocNo())) { |
| | |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}小车,小车忙碌中,禁止派发", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo()); |
| | | return false; |
| | | } |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | if (devpThread == null) { |
| | | return false; |
| | | } |
| | | StaProtocol staProtocol = devpThread.getStation().get(Utils.getLev(wrkMast.getSourceLocNo()) == 1 ? 1015 : 1026); |
| | | if (!staProtocol.isLoading()) { |
| | | log.error("{}任务,{}号输送线无物", wrkMast.getWrkNo(), wrkMast.getSourceStaNo()); |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}号输送线无物", wrkMast.getWrkNo(), wrkMast.getSourceStaNo()); |
| | | return false; |
| | | } |
| | | //TODO |
| | | // if (!staProtocol.getFinishWorkNo().equals(wrkMast.getWrkNo())) { |
| | | // log.error("{}任务,{}号输送线的工作号和工作档不匹配", wrkMast.getWrkNo(), wrkMast.getSourceStaNo()); |
| | | // News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}号输送线的工作号和工作档不匹配", wrkMast.getWrkNo(), wrkMast.getSourceStaNo()); |
| | | // return false; |
| | | // } |
| | | |
| | | if (!shuttleProtocol.getCurrentLocNo().equals(wrkMast.getSourceLocNo())){ |
| | | if (!shuttleProtocol.getCurrentLocNo().equals(wrkMast.getSourceLocNo())) { |
| | | return false; |
| | | } |
| | | |
| | |
| | | import com.zy.core.model.command.ShuttleCommand; |
| | | import com.zy.core.model.protocol.LiftProtocol; |
| | | import com.zy.core.model.protocol.ShuttleProtocol; |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.thread.DevpThread; |
| | | import com.zy.core.thread.LiftThread; |
| | | import com.zy.core.thread.ShuttleThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | */ |
| | | public void shuttleMoveExecute(WrkMast wrkMast) { |
| | | //判断目标库位是否在1层或5层 |
| | | if (Utils.getLev(wrkMast.getLocNo()) == 1 || Utils.getLev(wrkMast.getLocNo()) == 5) { |
| | | if (Utils.getLev(wrkMast.getSourceLocNo()) == 1 || Utils.getLev(wrkMast.getSourceLocNo()) == 5) { |
| | | boolean stepMoveSta = this.shuttleMoveExecuteTransportLiftStepCallShuttle2(wrkMast);//呼叫小车至取货点 |
| | | if (!stepMoveSta) { |
| | | return; |
| | |
| | | return false; |
| | | } |
| | | |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | if (devpThread == null) { |
| | | return false; |
| | | } |
| | | int lev = Utils.getLev(wrkMast.getLocNo()); |
| | | StaProtocol staProtocol2 = devpThread.getStation().get(lev == 1 ? 1014 : 1025); |
| | | //TODO |
| | | // if (!staProtocol2.isOutEnable()) { |
| | | // log.error("{}任务,{}号输送线不可出", wrkMast.getWrkNo(), lev == 1 ? 1014 : 1025); |
| | | // News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}号输送线不可出", wrkMast.getWrkNo(), lev == 1 ? 1014 : 1025); |
| | | // return false; |
| | | // } |
| | | StaProtocol staProtocol = devpThread.getStation().get(lev == 1 ? 1015 : 1026); |
| | | if (staProtocol.isLoading()) { |
| | | log.error("{}任务,{}号输送线有物", wrkMast.getWrkNo(), wrkMast.getSourceStaNo()); |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}号输送线有物", wrkMast.getWrkNo(), wrkMast.getSourceStaNo()); |
| | | return false; |
| | | } |
| | | |
| | | if (shuttleProtocol.getCurrentLocNo().equals(wrkMast.getSourceLocNo())) { |
| | | //小车在取货点 |
| | | wrkMast.setWrkSts(WrkStsType.MOVE_OUT_NO_LIFT_2.sts);//小车移动到提升机中 301.生成小车移库任务 ==> 呼叫小车至取货点 |
| | | wrkMast.setWrkSts(WrkStsType.MOVE_OUT_NO_LIFT_1.sts);//小车移动到提升机中 301.生成小车移库任务 ==> 呼叫小车至取货点 |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setSystemMsg("");//清空消息 |
| | | wrkMastService.updateById(wrkMast); |
| | |
| | | return false;//提升机内无小车 |
| | | } |
| | | |
| | | if (Utils.getLev(shuttleProtocol.getCurrentLocNo()) != Utils.getLev(wrkMast.getLocNo())) { |
| | | ShuttleAssignCommand assignCommand = new ShuttleAssignCommand(); |
| | | assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo()); // 四向穿梭车编号 |
| | | assignCommand.setTaskMode(ShuttleTaskModeType.UPDATE_LOCATION.id);//更新坐标 |
| | | assignCommand.setTaskNo(wrkMast.getWrkNo());//任务号 |
| | | assignCommand.setAuto(true);//自动模式 |
| | | assignCommand.setSourceLocNo(shuttleProtocol.getCurrentLocNo());//源库位 |
| | | assignCommand.setLocNo(wrkMast.getLocNo());//目标库位 |
| | | |
| | | //更新小车坐标 |
| | | ShuttleCommand command = shuttleThread.getUpdateLocationCommand(wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | ArrayList<ShuttleCommand> commands = new ArrayList<>(); |
| | | commands.add(command); |
| | | |
| | | assignCommand.setCommands(commands); |
| | | shuttleAction.assignWork(shuttleProtocol.getShuttleNo(), assignCommand); |
| | | return false; |
| | | } |
| | | |
| | | ShuttleAssignCommand assignCommand = new ShuttleAssignCommand(); |
| | | assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo()); // 四向穿梭车编号 |
| | | assignCommand.setTaskMode(ShuttleTaskModeType.MOVE_LOC_NO.id);//小车移库任务 |
| | |
| | | if (shuttleProtocol == null) { |
| | | return false; |
| | | } |
| | | |
| | | // if (Utils.getLev(shuttleProtocol.getCurrentLocNo()) != Utils.getLev(wrkMast.getLocNo())) { |
| | | // ShuttleAssignCommand assignCommand = new ShuttleAssignCommand(); |
| | | // assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo()); // 四向穿梭车编号 |
| | | // assignCommand.setTaskMode(ShuttleTaskModeType.UPDATE_LOCATION.id);//更新坐标 |
| | | // assignCommand.setTaskNo(wrkMast.getWrkNo());//任务号 |
| | | // assignCommand.setAuto(true);//自动模式 |
| | | // assignCommand.setSourceLocNo(shuttleProtocol.getCurrentLocNo());//源库位 |
| | | // assignCommand.setLocNo(wrkMast.getLocNo());//目标库位 |
| | | // |
| | | // //更新小车坐标 |
| | | // ShuttleCommand command = shuttleThread.getUpdateLocationCommand(wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | // ArrayList<ShuttleCommand> commands = new ArrayList<>(); |
| | | // commands.add(command); |
| | | // |
| | | // assignCommand.setCommands(commands); |
| | | // shuttleAction.assignWork(shuttleProtocol.getShuttleNo(), assignCommand); |
| | | // return false; |
| | | // } |
| | | |
| | | |
| | | //小车处于空闲状态 |
| | | if (!shuttleThread.isIdle()) { |
| | |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}小车,小车忙碌中", wrkMast.getWrkNo(), shuttleProtocol.getShuttleNo()); |
| | | return false; |
| | | } |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 1); |
| | | if (devpThread == null) { |
| | | return false; |
| | | } |
| | | int lev = Utils.getLev(wrkMast.getLocNo()); |
| | | StaProtocol staProtocol2 = devpThread.getStation().get(lev == 1 ? 1014 : 1025); |
| | | //TODO |
| | | // if (!staProtocol2.isOutEnable()) { |
| | | // log.error("{}任务,{}号输送线不可出", wrkMast.getWrkNo(), lev == 1 ? 1014 : 1025); |
| | | // News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}号输送线不可出", wrkMast.getWrkNo(), lev == 1 ? 1014 : 1025); |
| | | // return false; |
| | | // } |
| | | StaProtocol staProtocol = devpThread.getStation().get(lev == 1 ? 1015 : 1026); |
| | | if (staProtocol.isLoading()) { |
| | | log.error("{}任务,{}号输送线有物", wrkMast.getWrkNo(), wrkMast.getSourceStaNo()); |
| | | News.taskInfo(wrkMast.getWrkNo(), "{}任务,{}号输送线有物", wrkMast.getWrkNo(), wrkMast.getSourceStaNo()); |
| | | return false; |
| | | } |
| | | |
| | | if (shuttleProtocol.getCurrentLocNo().equals(wrkMast.getSourceLocNo())) { |
| | | //小车在取货点 |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (!shuttleProtocol.getCurrentLocNo().equals(wrkMast.getSourceLocNo())) { |
| | | return false; |
| | | } |
| | | |
| | | ShuttleAssignCommand assignCommand = new ShuttleAssignCommand(); |
| | | assignCommand.setShuttleNo(shuttleProtocol.getShuttleNo()); // 四向穿梭车编号 |
| | | assignCommand.setTaskMode(ShuttleTaskModeType.MOVE_LOC_NO.id);//小车移库任务 |
| | |
| | | |
| | | //无提升机入库 |
| | | MOVE_IN_NO_LIFT_1(371, "呼叫小车移动至输送线"), |
| | | MOVE_IN_NO_LIFT_2(372, "小车移动至输送线完成"), |
| | | //MOVE_IN_NO_LIFT_2(372, "小车移动至输送线完成"), |
| | | MOVE_IN_NO_LIFT_3(373, "小车移动至待机点"), |
| | | MOVE_IN_NO_LIFT_4(374, "小车移动至待机点完成"), |
| | | MOVE_IN_NO_LIFT_5(375, "提升机至小车层"), |