From 3b604eb218a3b167144cc6e5d9c86cd95e16157c Mon Sep 17 00:00:00 2001
From: yxFwq <1>
Date: 星期六, 10 五月 2025 08:08:24 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/model/protocol/JarProtocol.java |  106 +++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 91 insertions(+), 15 deletions(-)

diff --git a/src/main/java/com/zy/core/model/protocol/JarProtocol.java b/src/main/java/com/zy/core/model/protocol/JarProtocol.java
index 0488b50..cfa29a4 100644
--- a/src/main/java/com/zy/core/model/protocol/JarProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/JarProtocol.java
@@ -1,12 +1,16 @@
 package com.zy.core.model.protocol;
 
 import com.zy.asrs.entity.BasJar;
+import com.zy.core.enums.CrnModeType;
+import com.zy.core.enums.JarModeType;
 import com.zy.core.enums.JarStatusType;
 import lombok.Data;
 import lombok.extern.slf4j.Slf4j;
 
+import java.util.Date;
+
 /**
- * Created by vincent on 2020/8/7
+ * Created by vincent on 2024/6/21
  */
 @Slf4j
 @Data
@@ -23,11 +27,20 @@
      */
     public Integer mode;
 
+    public JarModeType modeType;
+
+
     /**
      IDLE(0, "绌洪棽"),
-     MOVING(1, "浣滀笟涓�"),
-     SOS(2, "鎶ヨ"),
-     WAITING(3, "浠诲姟瀹屾垚绛夊緟WCS纭"),
+     MOVING(1, "鍏ユ枡涓�"),
+     SOS(2, "纭寲涓�"),
+     WAITING1(3, "鍑烘枡涓�"),
+     WAITING2(4, "鍋滄"),
+     WAITING3(5, "杩涙枡闂ㄦ墦寮�涓�"),
+     WAITING4(6, "鍑烘枡闂ㄦ墦寮�涓�"),
+     WAITING5(7, "杩涙枡闂ㄥ叧闂腑"),
+     OFF_LINE(8, "鍑烘枡闂ㄥ叧闂腑"),
+     OTHER(100, "鍏跺畠"),
      */
     public Short status;
 
@@ -35,31 +48,37 @@
 
     /*
      * 宸﹂棬鐘舵��
+     * 杩涙枡闂�
      * */
     private boolean leftDoor;
 
     /*
      * 鍙抽棬鐘舵��
+     * 鍑烘枡闂�
      * */
     private boolean rightDoor;
 
     /*
      * 宸﹂棬鍙紑
+     * 杩涙枡闂�
      * */
     private boolean leftInEnable;
 
     /*
      * 宸﹂棬鍙叧
+     * 杩涙枡闂�
      * */
     private boolean leftOutEnable;
 
     /*
      * 鍙抽棬鍙紑
+     * 鍑烘枡闂�
      * */
     private boolean rightInEnable;
 
     /*
      * 鍙抽棬鍙叧
+     * 鍑烘枡闂�
      * */
     private boolean rightOutEnable;
 
@@ -67,6 +86,38 @@
      * 鑷姩
      * */
     private boolean autoing;
+
+    /*
+     * open the left door
+     * 杩涙枡闂�
+     * */
+    public Integer leftDoorOpen;
+
+    /*
+     * close the left door
+     * 杩涙枡闂�
+     * */
+    public Integer leftDoorClose;
+
+    /*
+     * open the right door
+     * 鍑烘枡闂�
+     * */
+    public Integer rightDoorOpen;
+
+    /*
+     * close the right door
+     * 鍑烘枡闂�
+     * */
+    public Integer rightDoorClose;
+
+    public Float jarTemperature;
+    public Float jarPressure;
+    public boolean holdingSign = false;
+    public boolean openDoorSign = false;
+    public boolean closeDoorSign = false;
+    public Short upStatus = 0;
+
 
 
     /**
@@ -84,23 +135,48 @@
         this.status = JarStatusType.get(type).id.shortValue();
     }
 
+    public void setMode(Integer mode) {
+        this.mode = mode;
+        this.modeType = JarModeType.get(mode);
+    }
+
+    public void setMode(JarModeType type) {
+        this.modeType = type;
+        this.mode = JarModeType.get(type).id;
+    }
 
     public BasJar toSqlModel(BasJar basJar){
         if (jarErr!=null) {
             basJar.setJarErr(jarErr);
         }
         basJar.setJarMode(mode);
-//        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());
-//            }
-//        }
+        basJar.setJarStatus(status.intValue());
+        basJar.setLeftDoor(leftDoor?"Y":"N");
+        basJar.setRightDoor(rightDoor?"Y":"N");
+        basJar.setLeftInEnable(leftInEnable?"Y":"N");
+        basJar.setLeftOutEnable(leftOutEnable?"Y":"N");
+        basJar.setRightInEnable(rightInEnable?"Y":"N");
+        basJar.setRightOutEnable(rightOutEnable?"Y":"N");
+        basJar.setAutoing(autoing?"Y":"N");
+        basJar.setJarTemperature(jarTemperature);
+        basJar.setJarPressure(jarPressure);
+        basJar.setLeftDoorOpen(leftDoorOpen);
+        basJar.setLeftDoorClose(leftDoorClose);
+        basJar.setRightDoorOpen(rightDoorOpen);
+        basJar.setRightDoorClose(rightDoorClose);
+        if (holdingSign){
+            basJar.setHoldingTime(new Date());
+            holdingSign = false;
+        }
+        if (openDoorSign){
+            basJar.setOpenTime(new Date());
+            openDoorSign = false;
+        }
+        if (closeDoorSign){
+            basJar.setCloseTime(new Date());
+            closeDoorSign = false;
+        }
+
         return basJar;
     }
 

--
Gitblit v1.9.1