自动化立体仓库 - WCS系统
Junjie
2023-06-28 97aa2cd09e92f73cd4dff3d99eaef64e748c80b3
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) {
                //托盘顶升命令
@@ -805,9 +816,6 @@
            }
        }
        LiftThread liftThread = (LiftThread) SlaveConnection.get(SlaveType.Lift, 1);
        LiftProtocol liftProtocol = liftThread.getLiftProtocol();
        //判断小车当前二维码是否为提升机二维码
        if (shuttleProtocol.getCurrentCode().intValue() == liftProtocol.getBarcode().intValue()) {
@@ -844,6 +852,9 @@
                if (!staProtocol.isLiftArrival()) {
                    return false;//站点提升机到位信号false,禁止下发命令
                }
                //条件满足,占用提升机
                liftProtocol.setTaskNo(wrkNo);
            }
        }
@@ -1046,6 +1057,7 @@
                return true;
            }else {
                if (liftProtocol.getPositionArrivalFeedback$() == shuttleLocNoLev) {
                    liftProtocol.setTaskNo(wrkNo);//给提升机写工作号,防止被占用
                    return true;//提升机到位
                }
                executeLift(liftThread, liftProtocol, redisCommand, shuttleLocNoLev);//调度提升机