From 91eb4e46c6064e5930685a9af2d5ca22d95ae944 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 21 九月 2022 10:15:59 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/model/protocol/SteProtocol.java |  329 +++++++++++++++++++++++++++---------------------------
 1 files changed, 165 insertions(+), 164 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 29180c0..cab04bd 100644
--- a/src/main/java/com/zy/core/model/protocol/SteProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/SteProtocol.java
@@ -1,10 +1,10 @@
 package com.zy.core.model.protocol;
 
-import com.zy.asrs.entity.BasCrnp;
-import com.zy.core.enums.CrnForkPosType;
-import com.zy.core.enums.CrnLiftPosType;
-import com.zy.core.enums.CrnModeType;
-import com.zy.core.enums.CrnStatusType;
+import com.core.common.Cools;
+import com.zy.asrs.entity.BasSte;
+import com.zy.core.enums.SteHisTaskStatusType;
+import com.zy.core.enums.SteLocaType;
+import com.zy.core.enums.SteStatusType;
 import lombok.Data;
 
 /**
@@ -14,23 +14,25 @@
 public class SteProtocol {
 
     /**
-     * 1 = 鎵嬪姩妯″紡
-     * 2 = 鑷姩妯″紡
-     * 3 = 鐢佃剳妯″紡
+     * 璁惧鍙�
+     */
+    private Short steNo;
+
+    /**
+     * 1 = 鑱旀満妯″紡
+     * 0 = 鑴辨満妯″紡
      */
     public Short mode;
 
-    public CrnModeType modeType;
-
     /**
-     * 1 = 鎬ュ仠
+     IDLE(0, "绌洪棽"),
+     MOVING(1, "浣滀笟涓�"),
+     SOS(2, "鎶ヨ"),
+     WAITING(3, "浠诲姟瀹屾垚绛夊緟WCS纭"),
      */
-    public Short eStop;
+    public Short status;
 
-    /**
-     * 寮傚父鐮�
-     */
-    public Short alarm;
+    public SteStatusType statusType;
 
     /**
      * 浠诲姟鍙�
@@ -38,199 +40,175 @@
     public Short taskNo = 0;
 
     /**
-     * 鍫嗗灈鏈哄綋鍓嶇姸鎬�
-     * 0锛氱┖闂诧紝鏃犱换鍔�
-     * 1锛氬彇璐у畾浣嶄腑
-     * 2锛氬彇璐т腑
-     * 3锛氬彇璐у畬鎴愶紝鏀捐揣瀹氫綅涓�
-     * 4锛氭斁璐т腑
-     * 5锛氬洖鍘熺偣涓�
-     * 6锛氬弽鍘熺偣
-     * 7锛氬簱浣嶇Щ浣�
-     * 90锛氫换鍔″畬鎴愮瓑寰匴CS纭
-     * 99锛氭姤璀�
+     * 姝e湪鎵ц浠诲姟
      */
-    public Short status;
+    public Boolean execute;
 
     /**
-     * 鐘舵�佹灇涓�
+     * 浠诲姟瀹屾垚锛岀瓑寰匴CS纭
      */
-    public CrnStatusType statusType;
+    public Boolean waiting;
+
 
     /**
-     * 鍫嗗灈鏈哄綋鍓嶅垪鍙�
+     * 寮傚父鐮�1
+     */
+    public Short alarm;
+
+
+    /**
+     * 寮傚父鐮�2
+     */
+    public Short alarm0;
+
+    /**
+     * 鐢垫睜鐢甸噺
+     */
+    public Float charge = 0.0F;
+
+    /**
+     * 婊$數
+     */
+    public Boolean fullCharge;
+
+    /**
+     * 浣庣數閲�
+     */
+    public Boolean lowCharge;
+
+    /**
+     * 鐢垫睜棣堢數    0锛屾瑺鐢碉紝1浣庣數 2婊$數
+     */
+    public Short feed;
+
+    /**
+     * 褰撳墠浣嶇疆     1锛岃繎鐐癸紝2杩滅偣锛�3A鐐癸紝4B鐐�
+     */
+    public Short loca;
+
+    public SteLocaType locaType;
+
+    /**
+     * 杩戠偣璺濈
+     */
+    public Double closer;
+
+    /**
+     * 褰撳墠閫熷害
+     */
+    public Double speed = 0.0D;
+
+    /**
+     * 楂樹綆浣� 0锛屼綆浣嶏紝1楂樹綅
+     */
+    public Short pos;
+
+    /**
+     * 鏈夎揣 0锛屾病璐э紝1鏈夎揣
+     */
+    public Short load;
+
+    /**
+     * 鍦ㄨ建閬撲笂 0涓嶅湪锛�1鍦�
+     */
+    public Short track;
+
+    /**
+     * 浠诲姟绫诲瀷
+     */
+    public Short taskType;
+
+    /**
+     * 鎺�
+     */
+    public Short row;
+
+    /**
+     * 鍒�
      */
     public Short bay;
 
     /**
-     * 鍫嗗灈鏈哄綋鍓嶅眰鍙�
+     * 灞�
      */
-    public Short level;
+    public Short lev;
 
     /**
-     * 褰撳墠璐у弶浣嶇疆
-     * 0 = 璐у弶鍘熶綅
-     * 1 = 璐у弶鍦ㄥ乏渚�
-     * 2 = 璐у弶鍦ㄥ彸渚�
+     * 杩囪处鎸囦护浠诲姟鍙�
      */
-    public Short forkPos;
-
-    public CrnForkPosType forkPosType;
+    public Integer hisTaskNo;
 
     /**
-     * 褰撳墠杞借揣鍙颁綅缃�
-     * 0 = 涓嬪畾浣�
-     * 1 = 涓婂畾浣�
+     * 杩囪处鎸囦护鐘舵��
+     * 0鍒濆 1鎵ц瀹屾垚 2鍒犻櫎
      */
-    public Short liftPos;
+    public Short hisTaskStatus;
 
-    public CrnLiftPosType liftPosType;
+    public SteHisTaskStatusType hisTaskStatusType;
 
     /**
-     * 璧拌鍦ㄥ畾浣�
-     * 0 = 鍦ㄥ畾浣�
-     * 1 = 涓嶅湪瀹氫綅
+     * 鐩樼偣鏁伴噺
      */
-    public Short walkPos;
+    public Short checkQty;
 
     /**
-     * 杞借揣鍙版湁鐗�
+     * 灏辩华鐘舵��  0鏈氨缁� 1灏辩华
      */
-    public Short loaded;
-
-    private Short temp1;
-
-    private CrnTemp1 crnTemp1;
-
-    private Short temp2;
-
-    private Short temp3;
-
-    private Short temp4;
+    public Short ready;
 
     /**
-     * 寮傚父1
+     * 鎵撳紑鍏呯數妗╁彿
      */
-    private boolean[] error1;
-
-    private CrnError1 crnError1;
+    public Short chargeNo;
 
     /**
-     * 寮傚父2
+     * 蹇冭烦鎸囦护 1-2姣忕鍒囨崲涓�娆�
      */
-    private boolean[] error2;
-
-    private CrnError2 crnError2;
+    public Short heart;
 
     /**
-     * 寮傚父3
+     * 鍫嗗灈鏈虹姝㈣繍琛� 1杩愯锛�0绂佹
      */
-    private boolean[] error3;
-
-    private CrnError3 crnError3;
+    public Short crnStopRun;
 
     /**
-     * 寮傚父4
+     * 鍫嗗灈鏈虹姝几鍙� 1杩愯锛�0绂佹
      */
-    private boolean[] error4;
-
-    private CrnError4 crnError4;
+    public Short crnStopFork;
 
     /**
-     * 寮傚父5
+     * 鍫嗗灈鏈烘惉绉诲厑璁� 0涓嶅厑璁�   1鍏佽
      */
-    private boolean[] error5;
-
-    private CrnError5 crnError5;
-
-    /**
-     * 寮傚父6
-     */
-    private boolean[] error6;
-
-    private CrnError6 crnError6;
-
-    /**
-     * X琛岃蛋绾块�熷害m/min
-     */
-    private Float xSpeed;
-
-    /**
-     * Y琛岃蛋绾块�熷害m/min
-     */
-    private Float ySpeed;
-
-    /**
-     * Z琛岃蛋绾块�熷害m/min
-     */
-    private Float zSpeed;
-
-    /**
-     * 鍫嗗灈鏈虹疮璁¤蛋琛岃窛绂籯m
-     */
-    public Float xDistance;
-
-    /**
-     * 鍫嗗灈鏈虹疮璁″崌闄嶈窛绂籯m
-     */
-    public Float yDistance;
-
-    /**
-     * 鍫嗗灈鏈虹疮璁¤蛋琛屾椂闀縣
-     */
-    public Float xDuration;
-
-    /**
-     * 鍫嗗灈鏈虹疮璁″崌闄嶆椂闀縣
-     */
-    public Float yDuration;
-
-    public void setMode(Short mode) {
-        this.mode = mode;
-        this.modeType = CrnModeType.get(mode);
-    }
-
-    public void setMode(CrnModeType type) {
-        this.modeType = type;
-        this.mode = CrnModeType.get(type).id.shortValue();
-    }
-
-    public void setForkPos(Short forkPos) {
-        this.forkPos = forkPos;
-        this.forkPosType = CrnForkPosType.get(forkPos);
-    }
-
-    public void setForkPos(CrnForkPosType type) {
-        this.forkPosType = type;
-        this.forkPos = CrnForkPosType.get(type).id.shortValue();
-    }
-
-    public void setLiftPos(Short liftPos) {
-        this.liftPos = liftPos;
-        this.liftPosType = CrnLiftPosType.get(liftPos);
-    }
-
-    public void setLiftPos(CrnLiftPosType type) {
-        this.liftPosType = type;
-        this.liftPos = CrnLiftPosType.get(type).id.shortValue();
-    }
+    public Short crnAllowRun;
 
     public void setStatus(Short status){
         this.status = status;
-        this.statusType = CrnStatusType.get(status);
+        this.statusType = SteStatusType.get(status);
     }
 
-    public void setStatus(CrnStatusType type){
+    public void setStatus(SteStatusType type){
         this.statusType = type;
-        this.status = CrnStatusType.get(type).id.shortValue();
+        this.status = SteStatusType.get(type).id.shortValue();
     }
 
-    public Short getTemp1() {
-        return temp1;
+    public void setLoca(Short loca){
+        this.loca = loca;
+        this.locaType = SteLocaType.get(loca);
     }
 
-    public void setTemp1(Short temp1) {
-        this.temp1 = temp1;
+    public void setLoca(SteLocaType type){
+        this.locaType = type;
+        this.loca = SteLocaType.get(type).id.shortValue();
+    }
+
+    public void setHisTaskStatus(Short hisTaskStatus){
+        this.hisTaskStatus = hisTaskStatus;
+        this.hisTaskStatusType = SteHisTaskStatusType.get(hisTaskStatus);
+    }
+
+    public void setHisTaskStatus(SteHisTaskStatusType type){
+        this.hisTaskStatusType = type;
+        this.hisTaskStatus = SteHisTaskStatusType.get(type).id.shortValue();
     }
 
     /**
@@ -240,12 +218,35 @@
      */
     private String lastIo = "I";
 
+    private String pakMk = "-";
 
-    public BasCrnp toSqlModel(BasCrnp basCrnp){
+    public BasSte toSqlModel(BasSte basSte){
         if (alarm!=null) {
-            basCrnp.setCrnErr(alarm.longValue());
+            basSte.setSteErr(alarm.longValue());
         }
-        basCrnp.setWrkNo(taskNo.intValue());
-        return basCrnp;
+        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());
+        }
+        return basSte;
     }
+
+    // 鏄惁澶勪簬绌洪棽寰呭懡鐘舵��
+    public Boolean isIdle() {
+        return this.statusType.equals(SteStatusType.IDLE)
+                && this.pakMk.equals("N")
+                && !isAlarm();
+    }
+
+    // 鏄惁澶勪簬鎶ヨ鐘舵��
+    public Boolean isAlarm() {
+        return this.alarm > 1;
+    }
+
 }

--
Gitblit v1.9.1