#
whycq
2024-07-15 b058b8c8be2267c2a0ba4e3916871ede64f53c47
zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java
@@ -55,13 +55,15 @@
                motion.setOrigin(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), origin.getLev())));
            }
            motion.setTarget(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), target.getLev())));
        }));
//        if (target.getUpdateLiftNo() != null && target.getWrkNo() != null) {
//            if (target.getUpdateLiftNo()) {
//
//            }
//        }
            if (target.getSync() != null) {
                motion.setSync(target.getSync());
            }
            if (target.getReleaseLift() != null) {
                motion.setReleaseLift(target.getReleaseLift());
            }
        }));
        return motionList;
    }
@@ -84,6 +86,15 @@
            }
            motion.setTarget(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), target.getLev())));
            motion.setTarDrt(target.getStaNo());//目标站
            motion.setDockNo(String.valueOf(target.getDevpNo()));//输送线ID
            if (target.getSync() != null) {
                motion.setSync(target.getSync());
            }
            if (target.getReleaseLift() != null) {
                motion.setReleaseLift(target.getReleaseLift());
            }
        }));
        return motionList;
@@ -162,6 +173,14 @@
            motion.setDeviceCtg(DeviceCtgType.LIFT.val());
            motion.setDevice(String.valueOf(target.getLiftNo()));
            motion.setMotionCtg(MotionCtgType.LIFT_LOCK.val());
            if (target.getSync() != null) {
                motion.setSync(target.getSync());
            }
            if (target.getReleaseLift() != null) {
                motion.setReleaseLift(target.getReleaseLift());
            }
        }));
        return motionList;
@@ -177,6 +196,44 @@
            motion.setDeviceCtg(DeviceCtgType.LIFT.val());
            motion.setDevice(String.valueOf(target.getLiftNo()));
            motion.setMotionCtg(MotionCtgType.LIFT_UNLOCK.val());
            if (target.getSync() != null) {
                motion.setSync(target.getSync());
            }
            if (target.getReleaseLift() != null) {
                motion.setReleaseLift(target.getReleaseLift());
            }
        }));
        return motionList;
    }
    /**
     * 提升机-小车已到位
     */
    public List<Motion> liftShuttleArrival(MotionDto origin, MotionDto target) {
        List<Motion> motionList = new ArrayList<>();
        motionList.add(Motion.build(motion -> {
            motion.setDeviceCtg(DeviceCtgType.LIFT.val());
            motion.setDevice(String.valueOf(target.getLiftNo()));
            motion.setMotionCtg(MotionCtgType.LIFT_SHUTTLE_ARRIVAL.val());
        }));
        return motionList;
    }
    /**
     * 提升机-小车已驶离
     */
    public List<Motion> liftShuttleLeave(MotionDto origin, MotionDto target) {
        List<Motion> motionList = new ArrayList<>();
        motionList.add(Motion.build(motion -> {
            motion.setDeviceCtg(DeviceCtgType.LIFT.val());
            motion.setDevice(String.valueOf(target.getLiftNo()));
            motion.setMotionCtg(MotionCtgType.LIFT_SHUTTLE_LEAVE.val());
        }));
        return motionList;
@@ -278,14 +335,34 @@
        return motionList;
    }
    public List<Motion> shuttleCharge(MotionDto origin, MotionDto target) {
    /**
     * 穿梭车动作
     */
    public List<Motion> shuttleAction(MotionDto origin, MotionDto target, MotionCtgType motionCtgType) {
        List<Motion> motionList = new ArrayList<>();
        motionList.add(Motion.build(motion -> {
            motion.setDeviceCtg(DeviceCtgType.SHUTTLE.val());
            motion.setDevice(String.valueOf(target.getShuttleNo()));
            motion.setMotionCtg(MotionCtgType.SHUTTLE_CHARGE_ON.val());
            motion.setMotionCtg(motionCtgType.val());
            switch (motionCtgType) {
                case SHUTTLE_PALLET_LIFT://托盘顶升
                    break;
                case SHUTTLE_PALLET_DOWN://托盘下降
                    break;
                case SHUTTLE_CHARGE_ON://充电开
                    break;
                case SHUTTLE_CHARGE_OFF://充电关
                    break;
                default:
                    break;
            }
        }));