| | |
| | | vo.setLoading(p.getLoaded() != null && p.getLoaded() == 1 ? "有物" : "无物"); |
| | | vo.setLoadingTwo(p.getLoadedTwo() != null && p.getLoadedTwo() == 1 ? "有物" : "无物"); |
| | | vo.setBay(p.getBay()); |
| | | vo.setBayTwo(p.getBayTwo()); |
| | | vo.setLev(p.getLevel()); |
| | | vo.setLevTwo(p.getLevelTwo()); |
| | | vo.setForkOffset(p.getForkPosType() == null ? "-" : p.getForkPosType().desc); |
| | | vo.setForkOffsetTwo(p.getForkPosTypeTwo() == null ? "-" : p.getForkPosTypeTwo().desc); |
| | | vo.setLiftPos(p.getLiftPosType() == null ? "-" : p.getLiftPosType().desc); |
| | | vo.setLiftPosTwo(p.getLiftPosTypeTwo() == null ? "-" : p.getLiftPosTypeTwo().desc); |
| | | vo.setWalkPos(p.getWalkPos() != null && p.getWalkPos() == 0 ? "在定位" : "不在定位"); |
| | | vo.setWalkPosTwo(p.getWalkPosTwo() != null && p.getWalkPosTwo() == 0 ? "在定位" : "不在定位"); |
| | | vo.setTaskReceive(p.getTaskReceive() != null && p.getTaskReceive() == 1 ? "接收" : "无任务"); |
| | | vo.setTaskReceiveTwo(p.getTaskReceiveTwo() != null && p.getTaskReceiveTwo() == 1 ? "接收" : "无任务"); |
| | | vo.setXspeed(p.getXSpeed()); |
| | | vo.setYspeed(p.getYSpeed()); |
| | | vo.setZspeed(p.getZSpeed()); |
| | |
| | | return R.error("线程不存在"); |
| | | } |
| | | DualCrnCommand command = crnThread.getPickAndPutCommand(sourceLocNo, targetLocNo, 9999, crnNo, station); |
| | | MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(2, command)); |
| | | MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(3, command)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/dualcrn/command/pick") |
| | | @ManagerAuth(memo = "双工位堆垛机取货命令") |
| | | public R dualCrnCommandPick(@RequestBody DualCrnCommandParam param) { |
| | | if (Cools.isEmpty(param)) { |
| | | return R.error("缺少参数"); |
| | | } |
| | | Integer crnNo = param.getCrnNo(); |
| | | String targetLocNo = param.getTargetLocNo(); |
| | | Integer station = param.getStation(); |
| | | DualCrnThread crnThread = (DualCrnThread) SlaveConnection.get(SlaveType.DualCrn, crnNo); |
| | | if (crnThread == null) { |
| | | return R.error("线程不存在"); |
| | | } |
| | | DualCrnCommand command = crnThread.getPickCommand(targetLocNo, 9999, crnNo, station); |
| | | MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(3, command)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/dualcrn/command/put") |
| | | @ManagerAuth(memo = "双工位堆垛机放货命令") |
| | | public R dualCrnCommandPut(@RequestBody DualCrnCommandParam param) { |
| | | if (Cools.isEmpty(param)) { |
| | | return R.error("缺少参数"); |
| | | } |
| | | Integer crnNo = param.getCrnNo(); |
| | | String targetLocNo = param.getTargetLocNo(); |
| | | Integer station = param.getStation(); |
| | | DualCrnThread crnThread = (DualCrnThread) SlaveConnection.get(SlaveType.DualCrn, crnNo); |
| | | if (crnThread == null) { |
| | | return R.error("线程不存在"); |
| | | } |
| | | DualCrnCommand command = crnThread.getPutCommand(targetLocNo, 9999, crnNo, station); |
| | | MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(3, command)); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/dualcrn/command/move") |
| | | @ManagerAuth(memo = "双工位堆垛机移动命令") |
| | |
| | | } |
| | | DualCrnCommand command = crnThread.getMoveCommand(targetLocNo, 9999, crnNo); |
| | | if (station != null) { |
| | | command.setStation(station.shortValue()); |
| | | command.setStation(station); |
| | | } |
| | | MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(2, command)); |
| | | MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(3, command)); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return R.error("线程不存在"); |
| | | } |
| | | DualCrnCommand command = crnThread.getResetCommand(crnNo, station); |
| | | MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(2, command)); |
| | | MessageQueue.offer(SlaveType.DualCrn, crnNo, new Task(3, command)); |
| | | return R.ok(); |
| | | } |
| | | } |