自动化立体仓库 - WCS系统
#
Junjie
2023-10-13 5f685f89bf6501325b6129ecf709b988369eeedd
src/main/java/com/zy/core/thread/NyShuttleThread.java
@@ -370,6 +370,7 @@
        }
        WrkMastMapper wrkMastMapper = SpringUtils.getBean(WrkMastMapper.class);
        WrkMast wrkMast = wrkMastMapper.selectByWorkNo(wrkNo.intValue());
        Object o = redisUtil.get("shuttle_wrk_no_" + wrkNo);
        if (o == null) {
@@ -465,8 +466,15 @@
        }
        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;
            }
@@ -636,17 +644,17 @@
     * 检测路径是否可行走
     * 如果路径为目标库位,但不可行走,系统将尝试重新计算路径
     */
    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;//可行走
            }