From e74add6a913a5fd6ea1de5fc62379e3f9b24b228 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期四, 08 十二月 2022 15:08:52 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/model/protocol/SteProtocol.java |   50 ++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/zy/core/model/protocol/SteProtocol.java b/src/main/java/com/zy/core/model/protocol/SteProtocol.java
index 726504c..dc815d7 100644
--- a/src/main/java/com/zy/core/model/protocol/SteProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/SteProtocol.java
@@ -70,6 +70,12 @@
      */
     public Float charge = 0.0F;
 
+    public void setCharge(Float charge) {
+        if (charge >= 0) {
+            this.charge = charge;
+        }
+    }
+
     /**
      * 婊$數
      */
@@ -185,6 +191,17 @@
      */
     public Short crnAllowRun;
 
+    /**
+     * 鍏呯數鐘舵��  1锛氬湪鍏呯數锛�0锛氫笉鍦ㄥ厖鐢�
+     */
+    private Short chargeStatus;
+
+    // 鍏ュ簱鍙栫┖
+    private Boolean inEmpty;
+
+    // 鍑哄簱鍙栫┖
+    private Boolean outEmpty;
+
     public void setStatus(Short status){
         this.status = status;
         this.statusType = SteStatusType.get(status);
@@ -229,23 +246,29 @@
             basSte.setSteErr(alarm.longValue());
         }
         basSte.setWrkNo(taskNo.intValue());
-        if (!Cools.isEmpty(row)) {
-            basSte.setRow(row.intValue());
-        }
-        if (!Cools.isEmpty(bay)) {
-            basSte.setBay(bay.intValue());
-        }
-        if (!Cools.isEmpty(lev)) {
-            basSte.setLev(lev.intValue());
-        }
+//        if (basSte.getPakMk().equals("N")) {
+//            if (!Cools.isEmpty(row)) {
+//                basSte.setRow(row.intValue());
+//            }
+//            if (!Cools.isEmpty(bay)) {
+//                basSte.setBay(bay.intValue());
+//            }
+//            if (!Cools.isEmpty(lev)) {
+//                basSte.setLev(lev.intValue());
+//            }
+//        }
         return basSte;
     }
 
     // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵��
     public Boolean isIdle() {
         boolean res = this.statusType.equals(SteStatusType.IDLE)
+                && this.mode == 1
                 && this.pakMk.equals("N")
-                && !isAlarm();
+                && !isAlarm()
+                && this.chargeStatus == 0
+                && isEnable()
+                ;
         if (!res) {
             return res;
         } else {
@@ -265,4 +288,11 @@
         return this.alarm > 1;
     }
 
+    public Boolean isEnable() {
+        if (Cools.isEmpty(row, bay, lev)) {
+            return false;
+        }
+        return row > 0 && bay > 0 && lev > 0;
+    }
+
 }

--
Gitblit v1.9.1