Junjie
2023-06-29 1edc46cc37adb14e30c80c22491d770bfe9214d1
src/main/java/com/zy/core/thread/ShuttleThread.java
@@ -729,6 +729,9 @@
//            }
//        }
        LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, 1);
        LiftProtocol liftProtocol = liftThread.getLiftProtocol();
        List<ShuttleCommand> commands = redisCommand.getAssignCommand().getCommands();
        //当前步序
        int commandStep = redisCommand.getCommandStep();
@@ -744,6 +747,14 @@
                if (command.getDistCodeNum().intValue() == shuttleProtocol.getCurrentCode().intValue()) {
                    //上一条指令的目标位置和当前小车位置相同,则认定上一条任务完成
                    command.setComplete(true);
                    //上一条指令起点是提升机二维码,则清零提升机任务号
                    if (command.getStartCodeNum().intValue() == liftProtocol.getBarcode().intValue()) {
                        //判断提升机是否处于空闲
                        if (liftProtocol.isIdleNoTask()) {
                            liftProtocol.setTaskNo((short) 0);//清空任务号
                        }
                    }
                }
            } else if (command.getCommandWord().intValue() == 2) {
                //托盘顶升命令
@@ -793,6 +804,10 @@
            }
        }
        if (commands.size() == 0) {
            return false;
        }
        //取出命令
        ShuttleCommand command = commands.get(commandStep);
@@ -805,9 +820,6 @@
            }
        }
        LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, 1);
        LiftProtocol liftProtocol = liftThread.getLiftProtocol();
        //判断小车当前二维码是否为提升机二维码
        if (shuttleProtocol.getCurrentCode().intValue() == liftProtocol.getBarcode().intValue()) {
@@ -844,6 +856,9 @@
                if (!staProtocol.isLiftArrival()) {
                    return false;//站点提升机到位信号false,禁止下发命令
                }
                //条件满足,占用提升机
                liftProtocol.setTaskNo(wrkNo);
            }
        }
@@ -1046,6 +1061,7 @@
                return true;
            }else {
                if (liftProtocol.getPositionArrivalFeedback$() == shuttleLocNoLev) {
                    liftProtocol.setTaskNo(wrkNo);//给提升机写工作号,防止被占用
                    return true;//提升机到位
                }
                executeLift(liftThread, liftProtocol, redisCommand, shuttleLocNoLev);//调度提升机
@@ -1057,8 +1073,13 @@
    }
    private boolean executeLift(LiftThread liftThread, LiftProtocol liftProtocol, ShuttleRedisCommand redisCommand, Integer shuttleLocNoLev) {//调度提升机
        if (liftProtocol.getRunning()) {
            //提升机运行中,禁止下发
        if (!liftProtocol.isIdle()) {
            //提升机不空闲禁止下发
            return false;
        }
        if (liftProtocol.getPlatShuttleCheck()) {
            //提升机内有车禁止下发
            return false;
        }