| | |
| | | private ShuttleStandbyService shuttleStandbyService; |
| | | @Autowired |
| | | private DictService dictService; |
| | | @Autowired |
| | | private NavigateUtils navigateUtils; |
| | | |
| | | public synchronized ShuttleThread searchIdleShuttle(Task task) { |
| | | String locNo = taskService.judgeInbound(task) ? task.getDestLoc() : task.getOriginLoc(); |
| | |
| | | |
| | | // 同楼层直接计算到目标库位 |
| | | //当前穿梭车线程到当前车子所在楼层的目标库位距离 |
| | | List<NavigateNode> currentShuttlePath = NavigateUtils.calc( |
| | | List<NavigateNode> currentShuttlePath = navigateUtils.calc( |
| | | currentLocNo |
| | | , locNo |
| | | , NavigationMapType.NORMAL.id |
| | |
| | | continue; |
| | | } |
| | | |
| | | Integer currDistance = NavigateUtils.getOriginPathAllDistance(currentShuttlePath);//计算当前路径行走总距离 |
| | | Integer currDistance = navigateUtils.getOriginPathAllDistance(currentShuttlePath);//计算当前路径行走总距离 |
| | | |
| | | // 挂载任务权重 |
| | | List<Task> tasks = taskService.selectWorkingByShuttle(Integer.valueOf(device.getDeviceNo()), null); |
| | |
| | | String targetLocNo = shuttleStandby.getDeviceLoc(); |
| | | |
| | | //当前穿梭车线程到当前车子所在楼层的提升机待机位距离 |
| | | List<NavigateNode> currentShuttlePath = NavigateUtils.calc( |
| | | List<NavigateNode> currentShuttlePath = navigateUtils.calc( |
| | | currentLocNo |
| | | , targetLocNo |
| | | , NavigationMapType.NORMAL.id |
| | |
| | | continue; |
| | | } |
| | | |
| | | Integer currDistance = NavigateUtils.getOriginPathAllDistance(currentShuttlePath);//计算当前路径行走总距离 |
| | | Integer currDistance = navigateUtils.getOriginPathAllDistance(currentShuttlePath);//计算当前路径行走总距离 |
| | | |
| | | // 不同楼层权重 |
| | | if (currentLev != Utils.getLev(locNo)) { |
| | |
| | | String recentLoc = null; |
| | | for (String loc : locNos) { |
| | | //当前穿梭车到避让位计算 |
| | | List<NavigateNode> currentShuttlePath = NavigateUtils.calc( |
| | | List<NavigateNode> currentShuttlePath = navigateUtils.calc( |
| | | currentLocNo |
| | | , loc |
| | | , NavigationMapType.NORMAL.id |
| | |
| | | continue; |
| | | } |
| | | |
| | | Integer currDistance = NavigateUtils.getOriginPathAllDistance(currentShuttlePath);//计算当前路径行走总距离 |
| | | Integer currDistance = navigateUtils.getOriginPathAllDistance(currentShuttlePath);//计算当前路径行走总距离 |
| | | if (currDistance < finalDistance) { |
| | | finalDistance = currDistance; |
| | | recentLoc = loc; |
| | |
| | | //分析出库路径待机库位 |
| | | public String analyzeOutPathWaitLoc(String startLoc, String targetLoc, Device shuttleDevice) { |
| | | //计算路径并分解成两段动作 |
| | | List<NavigateNode> nodeList = NavigateUtils.calc(startLoc, targetLoc, NavigationMapType.DFX.id, Utils.getShuttlePoints(Integer.parseInt(shuttleDevice.getDeviceNo()), Utils.getLev(startLoc))); |
| | | List<NavigateNode> nodeList = navigateUtils.calc(startLoc, targetLoc, NavigationMapType.DFX.id, Utils.getShuttlePoints(Integer.parseInt(shuttleDevice.getDeviceNo()), Utils.getLev(startLoc))); |
| | | if (nodeList == null) { |
| | | News.error("{} dash {} can't find navigate path!", startLoc, targetLoc); |
| | | return null; |
| | | } |
| | | //获取分段路径 |
| | | ArrayList<ArrayList<NavigateNode>> data = NavigateUtils.getSectionPath(nodeList); |
| | | ArrayList<ArrayList<NavigateNode>> data = navigateUtils.getSectionPath(nodeList); |
| | | if (data.size() <= 1) { |
| | | return startLoc;//两点之间只有一段路径,在起点位置等待 |
| | | } |