From 962a374a511a8a222067a2b8d06bc4c4c9052b29 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期五, 26 九月 2025 12:54:19 +0800
Subject: [PATCH] 1
---
src/main/java/com/zy/core/model/protocol/CrnProtocol.java | 176 +++++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 149 insertions(+), 27 deletions(-)
diff --git a/src/main/java/com/zy/core/model/protocol/CrnProtocol.java b/src/main/java/com/zy/core/model/protocol/CrnProtocol.java
index 00d6b1c..a3ac6cb 100644
--- a/src/main/java/com/zy/core/model/protocol/CrnProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/CrnProtocol.java
@@ -1,5 +1,6 @@
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;
@@ -11,6 +12,8 @@
*/
@Data
public class CrnProtocol {
+
+ private Integer crnNo;
/**
* 1 = 鎵嬪姩妯″紡
@@ -30,12 +33,12 @@
* 寮傚父鐮�
*/
public Short alarm;
-
+ public Short alarmTwo;
/**
* 浠诲姟鍙�
*/
public Short taskNo = 0;
-
+ public Short taskNoTwo = 0;
/**
* 鍫嗗灈鏈哄綋鍓嶇姸鎬�
* 0锛氱┖闂诧紝鏃犱换鍔�
@@ -49,23 +52,24 @@
* 90锛氫换鍔″畬鎴愮瓑寰匴CS纭
* 99锛氭姤璀�
*/
- public Short status;
+ public Short status = -1;
+ public Short statusTwo = -1;
/**
* 鐘舵�佹灇涓�
*/
public CrnStatusType statusType;
-
+ public CrnStatusType statusTypeTwo;
/**
* 鍫嗗灈鏈哄綋鍓嶅垪鍙�
*/
public Short bay;
-
+ public Short bayTwo;
/**
* 鍫嗗灈鏈哄綋鍓嶅眰鍙�
*/
public Short level;
-
+ public Short levelTwo;
/**
* 褰撳墠璐у弶浣嶇疆
* 0 = 璐у弶鍘熶綅
@@ -73,17 +77,21 @@
* 2 = 璐у弶鍦ㄥ彸渚�
*/
public Short forkPos;
+ public Short forkPosTwo;
- private CrnForkPosType forkPosType;
+ public CrnForkPosType forkPosType;
+ public CrnForkPosType forkPosTypeTwo;
/**
* 褰撳墠杞借揣鍙颁綅缃�
* 0 = 涓嬪畾浣�
* 1 = 涓婂畾浣�
*/
public Short liftPos;
+ public Short liftPosTwo;
public CrnLiftPosType liftPosType;
+ public CrnLiftPosType liftPosTypeTwo;
/**
* 璧拌鍦ㄥ畾浣�
@@ -91,66 +99,106 @@
* 1 = 涓嶅湪瀹氫綅
*/
public Short walkPos;
-
- /**
- * 鍫嗗灈鏈轰换鍔″畬鎴�
- */
- public Short taskFinish;
+ public Short walkPosTwo;
/**
* 杞借揣鍙版湁鐗�
*/
public Short loaded;
+ public Short loadedTwo;
- /**
- * 寮傚父鐮侊紙鏁板�兼樉绀猴級
- */
- private Short alarm1;
+
+ private Short temp1;
+
+ private CrnTemp1 crnTemp1;
+
+ private Short temp2;
+
+ private Short temp3;
+
+ private Short temp4;
/**
* 寮傚父1
*/
- private Short error1;
+ private boolean[] error1;
+
+ private CrnError1 crnError1;
/**
* 寮傚父2
*/
- private Short error2;
+ private boolean[] error2;
+
+ private CrnError2 crnError2;
/**
- * 淇濈暀
+ * 寮傚父3
*/
- private Short temp1;
+ private boolean[] error3;
+
+ private CrnError3 crnError3;
+
+ /**
+ * 寮傚父4
+ */
+ private boolean[] error4;
+
+ private CrnError4 crnError4;
+
+ /**
+ * 寮傚父5
+ */
+ private boolean[] error5;
+
+ private CrnError5 crnError5;
+
+ /**
+ * 寮傚父6
+ */
+ private boolean[] error6;
+
+ private CrnError6 crnError6;
/**
* X琛岃蛋绾块�熷害m/min
*/
- private Short xSpeed;
+ private Float xSpeed;
/**
* Y琛岃蛋绾块�熷害m/min
*/
- private Short ySpeed;
+ private Float ySpeed;
/**
* Z琛岃蛋绾块�熷害m/min
*/
- private Short zSpeed;
+ private Float zSpeed;
/**
* 鍫嗗灈鏈虹疮璁¤蛋琛岃窛绂籯m
*/
- public Integer xDistance;
+ public Float xDistance;
/**
* 鍫嗗灈鏈虹疮璁″崌闄嶈窛绂籯m
*/
- public Integer yDistance;
+ public Float yDistance;
/**
- * 鍫嗗灈鏈虹疮璁¤繍琛屾椂闀縣
+ * 鍫嗗灈鏈虹疮璁¤蛋琛屾椂闀縣
*/
- public Integer duration;
+ public Float xDuration;
+
+ /**
+ * 鍫嗗灈鏈虹疮璁″崌闄嶆椂闀縣
+ */
+ public Float yDuration;
+
+ /**
+ * 涓婁竴娆℃寚浠や笅鍙戞椂闂�
+ */
+ private Long lastCommandTime = System.currentTimeMillis();
public void setMode(Short mode) {
this.mode = mode;
@@ -172,6 +220,16 @@
this.forkPos = CrnForkPosType.get(type).id.shortValue();
}
+ public void setForkPosTwo(Short forkPosTwo) {
+ this.forkPosTwo = forkPosTwo;
+ this.forkPosTypeTwo = CrnForkPosType.get(forkPosTwo);
+ }
+
+ public void setForkPosTwo(CrnForkPosType typeTwo) {
+ this.forkPosTypeTwo = typeTwo;
+ this.forkPosTwo = CrnForkPosType.get(typeTwo).id.shortValue();
+ }
+
public void setLiftPos(Short liftPos) {
this.liftPos = liftPos;
this.liftPosType = CrnLiftPosType.get(liftPos);
@@ -182,14 +240,37 @@
this.liftPos = CrnLiftPosType.get(type).id.shortValue();
}
+ public void setLiftPosTwo(Short liftPosTwo) {
+ this.liftPosTwo = liftPosTwo;
+ this.liftPosTypeTwo = CrnLiftPosType.get(liftPosTwo);
+ }
+
+ public void setLiftPosTwo(CrnLiftPosType typeTwo) {
+ this.liftPosTypeTwo = typeTwo;
+ this.liftPosTwo = CrnLiftPosType.get(typeTwo).id.shortValue();
+ }
+
public void setStatus(Short status){
this.status = status;
this.statusType = CrnStatusType.get(status);
}
+ public void setStatusTwo(Short statusTwo){
+ this.statusTwo = statusTwo;
+ this.statusTypeTwo = CrnStatusType.get(statusTwo);
+ }
+
public void setStatus(CrnStatusType type){
this.statusType = type;
this.status = CrnStatusType.get(type).id.shortValue();
+ }
+
+ public Short getTemp1() {
+ return temp1;
+ }
+
+ public void setTemp1(Short temp1) {
+ this.temp1 = temp1;
}
/**
@@ -199,4 +280,45 @@
*/
private String lastIo = "I";
+
+ public BasCrnp toSqlModel(BasCrnp basCrnp){
+ if (alarm!=null) {
+ basCrnp.setCrnErr(alarm.longValue());
+ }
+ basCrnp.setWrkNo(taskNo.intValue());
+ basCrnp.setWrkNoTwo(taskNoTwo.intValue());
+ basCrnp.setCrnStatusOne(status.intValue());
+ basCrnp.setCrnStatusTwo(statusTwo.intValue());
+ return basCrnp;
+ }
+
+ public void setxSpeed(Short xSpeed) {
+ this.xSpeed = Float.valueOf(xSpeed);
+ }
+
+ public void setySpeed(Short ySpeed) {
+ this.ySpeed = Float.valueOf(ySpeed);
+ }
+
+ public void setzSpeed(Short zSpeed) {
+ this.zSpeed = Float.valueOf(zSpeed);
+ }
+
+ public void setxDistance(Short xDistance) {
+ this.xDistance = Float.valueOf(xDistance);
+ }
+
+ public void setyDistance(Short yDistance) {
+ this.yDistance = Float.valueOf(yDistance);
+ }
+
+ public void setxDuration(Short xDuration) {
+ this.xDuration = Float.valueOf(xDuration);
+ }
+
+ public void setyDuration(Short yDuration) {
+ this.yDuration = Float.valueOf(yDuration);
+ }
+
+
}
--
Gitblit v1.9.1