| | |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | |
| | | StaProtocol staProtocol = devpThread.getStation().get(rackInStn.getStaNo()); |
| | | StaProtocol staProtocol105 = devpThread.getStation().get(105); |
| | | staProtocol105.setWorkNo((short) 752); |
| | | staProtocol105.setStaNo((short) 100); |
| | | |
| | | StaProtocol staProtocol106 = devpThread.getStation().get(106); |
| | | staProtocol106.setWorkNo((short) 753); |
| | | staProtocol106.setStaNo((short) 100); |
| | | // StaProtocol staProtocol105 = devpThread.getStation().get(105); |
| | | // staProtocol105.setWorkNo((short) 752); |
| | | // staProtocol105.setStaNo((short) 100); |
| | | // |
| | | // StaProtocol staProtocol106 = devpThread.getStation().get(106); |
| | | // staProtocol106.setWorkNo((short) 753); |
| | | // staProtocol106.setStaNo((short) 100); |
| | | |
| | | if (staProtocol == null) { |
| | | continue; |
| | |
| | | //提升机当前楼层 |
| | | int liftLev = liftProtocol.getLev().intValue(); |
| | | if (liftLev != 1) { |
| | | //提升机不在1层 |
| | | LiftCommand command1 = new LiftCommand(); |
| | | command1.setLiftNo(liftProtocol.getLiftNo());//提升机号 |
| | | command1.setTaskNo(liftProtocol.getTaskNo());//任务号 |
| | | command1.setRun((short) 1);//升降 |
| | | command1.setDistPosition((short) 1);//目标楼层1层 |
| | | command1.setLiftLock(true);//锁定提升机 |
| | | |
| | | //提升机不在1层,获取到1层的提升机命令 |
| | | LiftCommand command1 = liftThread.getLiftUpDownCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), (short) 1); |
| | | commands.add(command1);//将命令添加进list |
| | | } |
| | | |
| | | //输送线将货物运进来 |
| | | LiftCommand command2 = new LiftCommand(); |
| | | command2.setLiftNo(liftProtocol.getLiftNo());//提升机号 |
| | | command2.setTaskNo(liftProtocol.getTaskNo());//任务号 |
| | | command2.setRun((short) 6);//输送线运作 |
| | | command2.setLiftLock(true);//锁定提升机 |
| | | |
| | | //输送线将货物运进来(正转) |
| | | LiftCommand command2 = liftThread.getLiftTurnCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), 1); |
| | | commands.add(command2);//将命令添加进list |
| | | |
| | | //提升机前往目标楼层 |
| | | LiftCommand command3 = new LiftCommand(); |
| | | command3.setLiftNo(liftProtocol.getLiftNo());//提升机号 |
| | | command3.setTaskNo(liftProtocol.getTaskNo());//任务号 |
| | | command3.setRun((short) 1);//升降 |
| | | command3.setDistPosition((short) wrkMastLocNoLey);//工作档目标楼层 |
| | | command3.setLiftLock(true);//锁定提升机 |
| | | |
| | | //提升机前往目标楼层(工作档目标楼层) |
| | | LiftCommand command3 = liftThread.getLiftUpDownCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), (short) wrkMastLocNoLey); |
| | | commands.add(command3);//将命令添加进list |
| | | |
| | | //提升机到达指定楼层,输送线将货物移出去 |
| | | //提升机到达指定楼层,输送线将货物移出去(反转) |
| | | //输送线将货物移出去 |
| | | LiftCommand command4 = new LiftCommand(); |
| | | command4.setLiftNo(liftProtocol.getLiftNo());//提升机号 |
| | | command4.setTaskNo(liftProtocol.getTaskNo());//任务号 |
| | | command4.setRun((short) 3);//输送线运作 |
| | | command4.setLiftLock(true);//锁定提升机 |
| | | |
| | | LiftCommand command4 = liftThread.getLiftTurnCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), 2); |
| | | commands.add(command4);//将命令添加进list |
| | | }else { |
| | | liftProtocol.setShuttleNo(wrkMast.getShuttleNo().shortValue());//设置四向穿梭车号 |
| | |
| | | int liftLev = liftProtocol.getLev().intValue(); |
| | | if (liftLev != currentLocNoLey) { |
| | | //不同楼层 |
| | | LiftCommand command1 = new LiftCommand(); |
| | | command1.setLiftNo(liftProtocol.getLiftNo());//提升机号 |
| | | command1.setTaskNo(liftProtocol.getTaskNo());//任务号 |
| | | command1.setRun((short) 1);//升降 |
| | | command1.setDistPosition((short) currentLocNoLey);//目标楼层(穿梭车所在楼层) |
| | | command1.setLiftLock(true);//锁定提升机 |
| | | |
| | | //获取目标楼层(穿梭车所在楼层)命令 |
| | | LiftCommand command1 = liftThread.getLiftUpDownCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), (short) currentLocNoLey); |
| | | commands.add(command1);//将命令添加进list |
| | | } |
| | | |
| | | //输送线将四向穿梭车移动进来 |
| | | LiftCommand command2 = new LiftCommand(); |
| | | command2.setLiftNo(liftProtocol.getLiftNo());//提升机号 |
| | | command2.setTaskNo(liftProtocol.getTaskNo());//任务号 |
| | | command2.setRun((short) 6);//输送线运作 |
| | | command2.setLiftLock(true);//锁定提升机 |
| | | |
| | | //输送线将四向穿梭车移动进来(正转) |
| | | LiftCommand command2 = liftThread.getLiftTurnCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), 1); |
| | | commands.add(command2);//将命令添加进list |
| | | |
| | | if (liftLev != currentLocNoLey) { |
| | | //提升机前往目标楼层 |
| | | LiftCommand command3 = new LiftCommand(); |
| | | command3.setLiftNo(liftProtocol.getLiftNo());//提升机号 |
| | | command3.setTaskNo(liftProtocol.getTaskNo());//任务号 |
| | | command3.setRun((short) 1);//升降 |
| | | command3.setDistPosition((short) wrkMastLocNoLey);//工作档目标楼层 |
| | | command3.setLiftLock(true);//锁定提升机 |
| | | |
| | | //提升机前往目标楼层(工作档目标楼层) |
| | | LiftCommand command3 = liftThread.getLiftUpDownCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), (short) wrkMastLocNoLey); |
| | | commands.add(command3);//将命令添加进list |
| | | } |
| | | |
| | | //提升机到达指定楼层,输送线将四向穿梭车移出去 |
| | | //输送线将四向穿梭车移动出去 |
| | | LiftCommand command4 = new LiftCommand(); |
| | | command4.setLiftNo(liftProtocol.getLiftNo());//提升机号 |
| | | command4.setTaskNo(liftProtocol.getTaskNo());//任务号 |
| | | command4.setRun((short) 3);//输送线运作 |
| | | command4.setLiftLock(true);//锁定提升机 |
| | | |
| | | //输送线将四向穿梭车移动出去(反转) |
| | | LiftCommand command4 = liftThread.getLiftTurnCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), 2); |
| | | commands.add(command4);//将命令添加进list |
| | | } |
| | | |
| | |
| | | int liftLev = liftProtocol.getLev().intValue(); |
| | | if (liftLev != currentLev) { |
| | | //穿梭车和提升机处于不同楼层 |
| | | LiftCommand command1 = new LiftCommand(); |
| | | command1.setLiftNo(liftProtocol.getLiftNo());//提升机号 |
| | | command1.setTaskNo(liftProtocol.getTaskNo());//任务号 |
| | | command1.setRun((short) 1);//升降 |
| | | command1.setDistPosition(currentLev.shortValue());//目标楼层(穿梭车所在楼层) |
| | | command1.setLiftLock(true);//锁定提升机 |
| | | //获取目标楼层(穿梭车所在楼层)命令 |
| | | LiftCommand command1 = liftThread.getLiftUpDownCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), currentLev.shortValue()); |
| | | commands.add(command1);//将命令添加进list |
| | | } |
| | | |
| | | //输送线将四向穿梭车移动进来 |
| | | LiftCommand command2 = new LiftCommand(); |
| | | command2.setLiftNo(liftProtocol.getLiftNo());//提升机号 |
| | | command2.setTaskNo(liftProtocol.getTaskNo());//任务号 |
| | | command2.setRun((short) 6);//输送线运作 |
| | | command2.setLiftLock(true);//锁定提升机 |
| | | |
| | | //输送线将四向穿梭车移动进来(正转) |
| | | LiftCommand command2 = liftThread.getLiftTurnCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), 1); |
| | | commands.add(command2);//将命令添加进list |
| | | |
| | | //提升机前往目标楼层 |
| | | LiftCommand command3 = new LiftCommand(); |
| | | command3.setLiftNo(liftProtocol.getLiftNo());//提升机号 |
| | | command3.setTaskNo(liftProtocol.getTaskNo());//任务号 |
| | | command3.setRun((short) 1);//升降 |
| | | command3.setDistPosition(chargeLocNoLev.shortValue());//充电库位目标楼层 |
| | | command3.setLiftLock(true);//锁定提升机 |
| | | |
| | | //获取充电库位目标楼层命令 |
| | | LiftCommand command3 = liftThread.getLiftUpDownCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), chargeLocNoLev.shortValue()); |
| | | commands.add(command3);//将命令添加进list |
| | | |
| | | //提升机到达指定楼层,输送线将四向穿梭车移出去 |
| | | //输送线将四向穿梭车移动出去 |
| | | LiftCommand command4 = new LiftCommand(); |
| | | command4.setLiftNo(liftProtocol.getLiftNo());//提升机号 |
| | | command4.setTaskNo(liftProtocol.getTaskNo());//任务号 |
| | | command4.setRun((short) 3);//输送线运作 |
| | | command4.setLiftLock(true);//锁定提升机 |
| | | |
| | | //输送线将四向穿梭车移动出去(反转) |
| | | LiftCommand command4 = liftThread.getLiftTurnCommand(liftProtocol.getLiftNo(), liftProtocol.getTaskNo(), 2); |
| | | commands.add(command4);//将命令添加进list |
| | | |
| | | wrkCharge.setWrkSts(54L);//提升机搬运中 |