| | |
| | | } |
| | | |
| | | WrkMastMapper wrkMastMapper = SpringUtils.getBean(WrkMastMapper.class); |
| | | WrkMast wrkMast = wrkMastMapper.selectByWorkNo(wrkNo.intValue()); |
| | | |
| | | Object o = redisUtil.get("shuttle_wrk_no_" + wrkNo); |
| | | if (o == null) { |
| | |
| | | } |
| | | |
| | | if (command.getRequest().getBody().get("requestType").equals("move")) { |
| | | ArrayList<int[]> whiteList = new ArrayList<>();//设置节点的白名单 |
| | | if (wrkMast != null && ((wrkMast.getIoType() > 100 && wrkMast.getIoType() < 200) || wrkMast.getIoType() == 11)) { |
| | | //出库任务,不检测首节点 |
| | | int[] startArr = NavigatePositionConvert.positionToXY(wrkMast.getSourceLocNo());//开始节点 |
| | | whiteList.add(startArr); |
| | | } |
| | | |
| | | //检测路径是否可行走 |
| | | if (!checkPath(command.getNodes(), nextNodes, redisCommand)) { |
| | | if (!checkPath(command.getNodes(), nextNodes, whiteList)) { |
| | | return false; |
| | | } |
| | | |
| | |
| | | * 检测路径是否可行走 |
| | | * 如果路径为目标库位,但不可行走,系统将尝试重新计算路径 |
| | | */ |
| | | private boolean checkPath(List<NavigateNode> currentNodes, List<NavigateNode> nextNodes, ShuttleRedisCommand redisCommand) { |
| | | private boolean checkPath(List<NavigateNode> currentNodes, List<NavigateNode> nextNodes, List<int[]> whitePoints) { |
| | | //检测路径是否可行走(检查路径锁定状态,检测路径是否有其他小车) |
| | | //检测当前行走路径,和下一步路径 |
| | | boolean checkPathIsAvailable = NavigateUtils.checkPathIsAvailable(currentNodes, shuttleProtocol.getShuttleNo().intValue(), Utils.getLev(shuttleProtocol.getCurrentLocNo())); |
| | | boolean checkPathIsAvailable = NavigateUtils.checkPathIsAvailable(currentNodes, shuttleProtocol.getShuttleNo().intValue(), Utils.getLev(shuttleProtocol.getCurrentLocNo()), whitePoints); |
| | | if (nextNodes == null) { |
| | | if (checkPathIsAvailable) { |
| | | return true;//可行走 |
| | | } |
| | | return false; |
| | | }else { |
| | | boolean checkPathIsAvailable2 = NavigateUtils.checkPathIsAvailable(nextNodes, shuttleProtocol.getShuttleNo().intValue(), Utils.getLev(shuttleProtocol.getCurrentLocNo())); |
| | | boolean checkPathIsAvailable2 = NavigateUtils.checkPathIsAvailable(nextNodes, shuttleProtocol.getShuttleNo().intValue(), Utils.getLev(shuttleProtocol.getCurrentLocNo()), whitePoints); |
| | | if (checkPathIsAvailable && checkPathIsAvailable2) { |
| | | return true;//可行走 |
| | | } |