| | |
| | | |
| | | private void patrolOfMove(String agvNo) { |
| | | Long agvId = agvService.getAgvId(agvNo); |
| | | AgvDetail agvDetail = agvDetailService.selectMajorByAgvId(agvId); |
| | | if (0 < travelService.count(new LambdaQueryWrapper<Travel>() |
| | | .eq(Travel::getAgvId, agvId) |
| | | .eq(Travel::getState, TravelStateType.RUNNING.toString()))) { |
| | |
| | | if (!agvService.judgeEnable(agvId)) { |
| | | return; |
| | | } |
| | | Agv agv = agvService.getById(agvId); |
| | | Code destinationCode = this.getDestinationCode(agv, agvDetail); |
| | | AgvDetail agvDetail = agvDetailService.selectMajorByAgvId(agvId); |
| | | Code destinationCode = this.getDestinationCode(agvNo, agvDetail); |
| | | if (null == destinationCode) { |
| | | return; |
| | | } |
| | | if (mainLockWrapService.buildMinorTask(agv, TaskTypeType.MOVE, destinationCode.getData(), null)) { |
| | | log.info(agv.getUuid() + "开始走行演示..."); |
| | | if (mainLockWrapService.buildMinorTask(agvId, TaskTypeType.MOVE, destinationCode.getData(), null)) { |
| | | log.info(agvNo + "开始走行演示..."); |
| | | } |
| | | } |
| | | |
| | |
| | | * 评估HandlerController没有调用buildMajorTask,手动创建task的可行性 |
| | | * agv地图图标变化 |
| | | */ |
| | | public Code getDestinationCode(Agv agv, AgvDetail agvDetail) { |
| | | public Code getDestinationCode(String agvNo, AgvDetail agvDetail) { |
| | | Integer maxAgvCountInLane = configService.getVal("maxAgvCountInLane", Integer.class); |
| | | |
| | | Code startCode = codeService.getById(agvDetail.getRecentCode()); |
| | |
| | | |
| | | for (Code endCode : list) { |
| | | // valid lane |
| | | if (!allocateService.validCapacityOfLane(agv, endCode)) { |
| | | if (!allocateService.validCapacityOfLane(agvNo, endCode)) { |
| | | continue; |
| | | } |
| | | |