| | |
| | | if (basCrnp.getInEnable().equals("Y")) { |
| | | // 入库 |
| | | if (this.crnStnToLoc(crn, crnProtocol)) { |
| | | crnProtocol.setLastIo("O"); |
| | | } |
| | | crnProtocol.setLastIo("O"); |
| | | } else if (basCrnp.getOutEnable().equals("Y")) { |
| | | // 出库 |
| | | if (this.locToCrnStn(crn, crnProtocol)) { |
| | | crnProtocol.setLastIo("I"); |
| | | } |
| | | crnProtocol.setLastIo("I"); |
| | | } |
| | | } |
| | | // 如果最近一次是出库模式 |
| | |
| | | if (basCrnp.getOutEnable().equals("Y")) { |
| | | // 出库 |
| | | if (this.locToCrnStn(crn, crnProtocol)) { |
| | | crnProtocol.setLastIo("I"); |
| | | } |
| | | crnProtocol.setLastIo("I"); |
| | | } else if (basCrnp.getInEnable().equals("Y")) { |
| | | // 入库 |
| | | if (this.crnStnToLoc(crn, crnProtocol)) { |
| | | crnProtocol.setLastIo("O"); |
| | | } |
| | | crnProtocol.setLastIo("O"); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (steNo != null) { |
| | | // 小车行走到堆垛机待搬移点 |
| | | if (wrkMast.getWrkSts() == 2L && wrkMast.getSteNo() == null) { |
| | | this.letCarBeReady(wrkMast, steNo, wrkMast.getLocNo()); |
| | | this.letCarBeWaiting(wrkMast, steNo, wrkMast.getLocNo()); |
| | | } |
| | | // 堆垛机将货放至小车上 3.小车待搬(小车不用搬运,已经在当前组库位) / 6.小车待入 ===>> 7.吊车入库中 |
| | | if (wrkMast.getWrkSts() == 3L || wrkMast.getWrkSts() == 6L) { |
| | |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 让小车从 远点 ====>> 待机 |
| | | * 等待堆垛机搬运 |
| | | */ |
| | | public void letCarBeWaiting(WrkMast wrkMast, Integer steNo, String locNo) { |
| | | // 获取穿梭车信息 |
| | | SteThread steThread = (SteThread) SlaveConnection.get(SlaveType.Ste, steNo); |
| | | SteProtocol steProtocol = steThread.getSteProtocol(); |
| | | if (steProtocol == null) { return; } |
| | | if (steProtocol.isIdle()) { |
| | | |
| | | // 命令下发区 -------------------------------------------------------------------------- |
| | | SteCommand steCommand = new SteCommand(); |
| | | steCommand.setSteNo(steNo); // 穿梭车编号 |
| | | steCommand.setTaskNo(9999); // 工作号 |
| | | steCommand.setTaskMode(SteTaskModeType.findWaiting(steProtocol.getRow().intValue())); // 任务模式: 去近点 等待堆垛机叉取 |
| | | |
| | | steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue()); |
| | | steCommand.setBay(steProtocol.getBay()); |
| | | steCommand.setLev(steProtocol.getLev()); |
| | | |
| | | if (!MessageQueue.offer(SlaveType.Ste, steNo, new Task(2, steCommand))) { |
| | | log.error("穿梭车命令下发失败,穿梭车号={},任务数据={}", steNo, JSON.toJSON(steCommand)); |
| | | } else { |
| | | // 修改工作档状态 绑定穿梭车 |
| | | wrkMast.setSteNo(steNo); |
| | | wrkMast.setModiTime(new Date()); |
| | | if (wrkMastMapper.updateById(wrkMast) == 0) { |
| | | log.error("修改工作档状态 绑定穿梭车 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | if (!steThread.confirmPos()) { |
| | | log.error("{}号穿梭车重新定位失败!作业工作档任务号:{}", wrkMast.getSteNo(), wrkMast.getWrkNo()); |
| | | } |
| | | // 穿梭车去待机位 |
| | | BasSte basSte = basSteService.selectById(wrkMast.getSteNo()); |
| | | SteCommand steCommand = new SteCommand(); |
| | | steCommand.setSteNo(wrkMast.getSteNo()); // 穿梭车编号 |
| | | steCommand.setTaskNo(9999); // 工作号 |
| | | steCommand.setTaskMode(SteTaskModeType.findWaiting(basSte.getRow())); // 任务模式: 去近点 等待堆垛机叉取 |
| | | // steCommand.setRow(Utils.getGroupRow(steProtocol.getRow().intValue()).shortValue()); |
| | | // steCommand.setBay(steProtocol.getBay()); |
| | | // steCommand.setLev(steProtocol.getLev()); |
| | | if (!MessageQueue.offer(SlaveType.Ste, wrkMast.getSteNo(), new Task(2, steCommand))) { |
| | | log.error("穿梭车待机位命令下发失败,穿梭车号={},任务数据={}", wrkMast.getSteNo(), JSON.toJSON(steCommand)); |
| | | } |
| | | } else { |
| | | log.error("修改工作档状态 5.迁出小车 => 6.小车待入 失败!!,工作号={}", wrkMast.getWrkNo()); |
| | | } |
| | |
| | | } |
| | | // 站点条件判断 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable() |
| | | && staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || staProtocol.getWorkNo() == 9999 || staProtocol.getWorkNo() == 9990 || staProtocol.getWorkNo() == 9997) && staProtocol.isPakMk()) { |
| | | && staProtocol.isEmptyMk() && (staProtocol.getWorkNo() == 0 || (staProtocol.getWorkNo() >= 9990 && staProtocol.getWorkNo() <= 9999) || staProtocol.getWorkNo() == 9997) && staProtocol.isPakMk()) { |
| | | |
| | | try { |
| | | LocTypeDto locTypeDto = new LocTypeDto(staProtocol); |