| | |
| | | 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);//小车移库任务 |