From 80d1f0fc9f35d5b84ee464b15c911214b2f69a73 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期五, 21 七月 2023 14:23:05 +0800
Subject: [PATCH] write5

---
 src/main/java/com/zy/core/model/protocol/LiftProtocol.java |   86 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 84 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/core/model/protocol/LiftProtocol.java b/src/main/java/com/zy/core/model/protocol/LiftProtocol.java
index 391a366..a080395 100644
--- a/src/main/java/com/zy/core/model/protocol/LiftProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/LiftProtocol.java
@@ -22,7 +22,7 @@
     /**
      * 鎻愬崌鏈哄唴閮ㄤ簩缁寸爜
      */
-    private Short barcode = 1699;
+    private Short barcode = 1661;
 
     /**
      * 浠诲姟鍙�
@@ -246,6 +246,29 @@
     }
 
     // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵��
+    public Boolean isIdle(Short taskNo) {
+        if(this.taskNo == null
+                || this.liftLock == null
+                || this.ready == null
+                || this.running == null
+                || this.mode == null
+                || this.pakMk == null
+        ){
+            return false;
+        }
+
+        boolean res = (this.taskNo == 0 || this.taskNo.intValue() == taskNo.intValue())
+                && !this.liftLock
+//                && this.ready
+                && !this.running
+                && this.mode
+                && this.pakMk.equals(true)
+                && !this.securityMk
+                ;
+        return res;
+    }
+
+    // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵��
     public Boolean isIdle() {
         if(this.taskNo == null
                 || this.liftLock == null
@@ -268,9 +291,68 @@
         return res;
     }
 
+    // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵�侊紝涓嶅垽鏂换鍔″彿
+    public Boolean isIdleNoTask() {
+        if(this.taskNo == null
+                || this.liftLock == null
+                || this.ready == null
+                || this.running == null
+                || this.mode == null
+                || this.pakMk == null
+        ){
+            return false;
+        }
+
+        boolean res = !this.liftLock
+//                && this.ready
+                && !this.running
+                && this.mode
+                && this.pakMk
+                && !this.securityMk
+                ;
+        return res;
+    }
+
     public void setPositionArrivalFeedback(Short position) {
-        this.lev = position;//灞傞珮
+        Short lev = null;
+        switch (position) {
+            case 1:
+                lev = 1;
+                break;
+            case 4:
+                lev = 2;
+                break;
+            case 8:
+                lev = 3;
+                break;
+            case 16:
+                lev = 4;
+                break;
+        }
+        this.lev = lev;//灞傞珮
         this.positionArrivalFeedback = position;//浣嶇疆鍒拌揪鍙嶉
     }
 
+    public Integer getPositionArrivalFeedback$() {
+        if (this.positionArrivalFeedback == null) {
+            return null;
+        }
+
+        switch (this.positionArrivalFeedback) {
+            case 1:
+                return 1;
+            case 2:
+                return 2;
+            case 4:
+                return 3;
+            case 8:
+                return 4;
+            case 16:
+                return 5;
+        }
+
+        return null;
+    }
+
+
 }

--
Gitblit v1.9.1