From 0f69561e397093b5165c4aac58530721d5c62178 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期一, 25 十一月 2024 11:03:16 +0800
Subject: [PATCH] #led

---
 zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java |  156 +++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 148 insertions(+), 8 deletions(-)

diff --git a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java b/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java
index cac9b7d..dd37a7e 100644
--- a/zy-asrs-wcs/src/main/java/com/zy/asrs/wcs/core/kernel/KernelService.java
+++ b/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,18 @@
             }
             motion.setTarget(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), target.getLev())));
             motion.setTarDrt(target.getStaNo());//鐩爣绔�
+
+            if (target.getDevpNo() != null) {
+                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;
@@ -104,6 +118,11 @@
             if (null != origin) {
                 motion.setOrigin(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), origin.getLev())));
             }
+
+            if (target.getTaskNo() != null) {
+                motion.setTaskNo(target.getTaskNo());
+            }
+
             motion.setTarget(String.valueOf(liftDispatcher.getLiftLevOffset(target.getLiftNo(), target.getLev())));
         }));
 
@@ -162,6 +181,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 +204,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;
@@ -233,8 +298,27 @@
                     motion.setTemp(String.valueOf(origin.getLiftNo()));//淇濆瓨鎻愬崌鏈哄彿
                     motion.setDockNo(String.valueOf(target.getStaNo()));
                     break;
+                case SHUTTLE_TRANSPORT_TO_CONVEYOR://绌挎杞﹁浇璐ц繘杈撻�佺嚎
+                    motion.setDockNo(String.valueOf(target.getStaNo()));
+                    break;
+                case SHUTTLE_MOVE_STANDBY://绌挎杞︾Щ鍔ㄥ埌寰呮満浣�
+                    motion.setTarget(null);//绛夊緟鑷姩鎼滅储
+                    motion.setTemp(target.getLocNo());//鍏ㄩ儴寰呮満浣�
+                    break;
                 default:
                     break;
+            }
+
+            if (target.getSync() != null) {
+                motion.setSync(target.getSync());
+            }
+
+            if (target.getReleaseShuttle() != null) {
+                motion.setReleaseShuttle(target.getReleaseShuttle());
+            }
+
+            if (target.getReleaseLift() != null) {
+                motion.setReleaseLift(target.getReleaseLift());
             }
 
         }));
@@ -278,14 +362,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;
+            }
 
         }));
 
@@ -355,4 +459,40 @@
         return motionList;
     }
 
+    // Map -----------------------------------------------------------------------------
+
+    /**
+     * 鍦板浘璺緞閿佸畾
+     */
+    public List<Motion> mapLockPath(MotionDto origin, MotionDto target) {
+        List<Motion> motionList = new ArrayList<>();
+
+        motionList.add(Motion.build(motion -> {
+            motion.setDeviceCtg(DeviceCtgType.MAP.val());
+            motion.setDevice(String.valueOf(target.getShuttleNo()));
+            motion.setMotionCtg(MotionCtgType.MAP_LOCK_PATH.val());
+
+            motion.setTarget(target.getLocNo());
+        }));
+
+        return motionList;
+    }
+
+    /**
+     * 鍦板浘璺緞瑙i攣
+     */
+    public List<Motion> mapUnlockPath(MotionDto origin, MotionDto target) {
+        List<Motion> motionList = new ArrayList<>();
+
+        motionList.add(Motion.build(motion -> {
+            motion.setDeviceCtg(DeviceCtgType.MAP.val());
+            motion.setDevice(String.valueOf(target.getShuttleNo()));
+            motion.setMotionCtg(MotionCtgType.MAP_UNLOCK_PATH.val());
+
+            motion.setTarget(target.getLocNo());
+        }));
+
+        return motionList;
+    }
+
 }

--
Gitblit v1.9.1