| | |
| | | //移动托盘 |
| | | int workNo = commonService.getWorkNo(3);//获取任务号 |
| | | |
| | | Integer startSta = null; |
| | | Integer targetSta = null; |
| | | for (LiftStaProtocol liftStaProtocol : liftThread.getLiftStaProtocols()) { |
| | | if (liftStaProtocol.getStaNo() == param.getSourceStaNo()) { |
| | | startSta = liftStaProtocol.getStaNo(); |
| | | } |
| | | |
| | | if (liftStaProtocol.getLev() == param.getStaNo()) { |
| | | targetSta = liftStaProtocol.getStaNo(); |
| | | } |
| | | } |
| | | |
| | | if (startSta == null || targetSta == null) { |
| | | throw new CoolException("起点或目标点不存在"); |
| | | } |
| | | // LiftStaProtocol sourceLiftSta = NyLiftUtils.getLiftStaByStaNo(param.getSourceStaNo()); |
| | | // LiftStaProtocol liftSta = NyLiftUtils.getLiftStaByStaNo(param.getStaNo()); |
| | | // if (sourceLiftSta == null || liftSta == null) { |
| | | // throw new CoolException("源站或目标站不存在"); |
| | | // } |
| | | |
| | | //获取提升机命令 |
| | | NyLiftCommand liftCommand = NyLiftUtils.getLiftCommand(liftProtocol.getLiftNo().intValue(), NyLiftTaskModelType.MOVE_TRAY.id, startSta, targetSta, workNo); |
| | | NyLiftCommand liftCommand = NyLiftUtils.getLiftCommand(liftProtocol.getLiftNo().intValue(), NyLiftTaskModelType.MOVE_TRAY.id, param.getSourceStaNo(), param.getStaNo(), workNo); |
| | | ArrayList<NyLiftCommand> commands = new ArrayList<>(); |
| | | commands.add(liftCommand); |
| | | |
| | |
| | | } else { |
| | | throw new CoolException("命令下发失败"); |
| | | } |
| | | } else if (param.getLiftTaskMode() == 0) { |
| | | //提升机复位 |
| | | liftProtocol.setToken(0); |
| | | liftProtocol.setProtocolStatusType(LiftProtocolStatusType.IDLE); |
| | | } else { |
| | | throw new CoolException("未知命令"); |
| | | } |