From c3434b1fe0132372b34ff0a46d84e6129a094bfc Mon Sep 17 00:00:00 2001
From: L <L@132>
Date: 星期四, 28 八月 2025 08:43:15 +0800
Subject: [PATCH] *
---
src/main/java/com/zy/core/model/protocol/RgvProtocol.java | 212 ++++++++++++++++++++++++++++-------------------------
1 files changed, 112 insertions(+), 100 deletions(-)
diff --git a/src/main/java/com/zy/core/model/protocol/RgvProtocol.java b/src/main/java/com/zy/core/model/protocol/RgvProtocol.java
index d14bd52..8e984e1 100644
--- a/src/main/java/com/zy/core/model/protocol/RgvProtocol.java
+++ b/src/main/java/com/zy/core/model/protocol/RgvProtocol.java
@@ -18,9 +18,9 @@
* 2 = 鑷姩妯″紡
* 3 = 鐢佃剳妯″紡
*/
- public Short mode;
+ public Short mode = -1;
- public RgvModeType modeType;
+ public RgvModeType modeType = RgvModeType.NONE;
/**
* RGV褰撳墠鐘舵��
@@ -28,41 +28,32 @@
* 1锛氫綔涓氫腑
* 2锛氭姤璀�
*/
- public Short status;
+ public Short status = -1;
/**
* 鐘舵�佹灇涓�
*/
- public RgvStatusType statusType;
+ public RgvStatusType statusType = RgvStatusType.NONE;
/**
- * 宸ヤ綅1浠诲姟鍙�
+ * 浠诲姟鍙�
*/
- public Short taskNo1 = 0;
+ public Long taskNo = 0L;
/**
- * RGV宸ヤ綅1褰撳墠鐘舵��
- * 0锛氱┖闂诧紝鏃犱换鍔�
- * 11锛氬彇璐т腑
- * 12锛氭斁璐т腑
- * 10锛氫换鍔″畬鎴愮瓑寰匴CS纭
+ * 鏈夌墿
*/
- public Short status1;
-
- /**
- * 鐘舵�佹灇涓�
- */
- public RgvStatusType statusType1;
-
- /**
- * 宸ヤ綅1鏈夌墿
- */
- public Short loaded1;//0 鏃犵墿锛�1 鏈夌墿
+ public Short loaded = -1;//0 鏃犵墿锛�1 鏈夌墿
/**
* RGV褰撳墠浣嶇疆
*/
- public Short RgvPos;
+ public Long RgvPos = 0L;
+
+ /**
+ * RGV鐩殑浣嶇疆
+ */
+ public Long RgvPosDestination = 0L;
/**
* 璧拌鍦ㄥ畾浣�
@@ -71,51 +62,10 @@
*/
public Short walkPos;
- ////////////////////// 宸ヤ綅2瀹氫箟 //////////////////////////////////////////////////
- /**
- * 宸ヤ綅2浠诲姟鍙�
- */
- public Short taskNo2 = 0;
-
- /**
- * RGV宸ヤ綅2褰撳墠鐘舵��
- * 0锛氱┖闂诧紝鏃犱换鍔�
- * 11锛氬彇璐т腑
- * 12锛氭斁璐т腑
- * 10锛氫换鍔″畬鎴愮瓑寰匴CS纭
- */
- public Short status2;
-
- /**
- * 鐘舵�佹灇涓�
- */
- public RgvStatusType statusType2;
-
- /**
- * 宸ヤ綅2鏈夌墿
- */
- public Short loaded2; //0 鏃犵墿锛�1 涓�灞傛棤鐗╀簩灞傛湁鐗╋紙鍙兘鎷嗗彔锛� 锛�2涓�灞傛湁鐗╀簩灞傛棤鐗� 锛堝彧鑳芥弧鏀撅級锛�3 1銆�2灞傞兘鏈夌墿 4锛氾紙锛夊彧鍏佽鎷嗙洏
- ///////////////////////////////////////////////////////////////////////////////////////
-
/**
* 寮傚父鐮�
*/
public Short alarm;
-
- /**
- * 蹇冭烦鎸囦护 1-2姣忕鍒囨崲涓�娆�
- */
- public Short heart;
-
- private Short temp1;
-
- private Short temp2;
-
- private Short temp3;
-
- private Short temp4;
-
- private Short temp5;
/**
* X琛岃蛋琛岄�熷害m/min
@@ -123,14 +73,54 @@
private Float xSpeed;
/**
- * 鍫嗗灈鏈虹疮璁¤蛋琛岃窛绂籯m
+ * 绱璧拌璺濈km
*/
public Float xDistance;
/**
- * 鍫嗗灈鏈虹疮璁¤蛋琛屾椂闀縣
+ * 绱璧拌鏃堕暱h
*/
public Float xDuration;
+
+ /**
+ * 杞﹁韩
+ */
+ public Long carBodyJiaoMing = 2000L;
+
+ /**
+ * 杞﹁韩
+ */
+ public Long carBodyKunPeng = 15000L;
+
+ /**
+ * 鏄惁鍚敤
+ */
+ public boolean statusEnable;//0\1\2
+
+
+
+ // 鎬ュ仠
+ private boolean err1;
+
+ // 鏈夌墿鏃犺祫鏂�
+ private boolean err2;
+
+ // 鍛戒护閿欒璧拌閾炬潯鍐茬獊
+ private boolean err3;
+
+ // 鐩爣涓鸿秴杩囪蛋琛屾瀬闄�
+ private boolean err4;
+
+ // 鍙橀鍣ㄥ紓甯�
+ private boolean err5;
+
+ // 鍏夌數寮傚父
+ private boolean err6;
+ //灏忚溅妯″紡鍒囨崲閿欒
+ private boolean err7;
+ //鍏朵粬鏈煡寮傚父
+ private boolean err8;
+ private String errorRgv;
public void setMode(Short mode) {
this.mode = mode;
@@ -152,41 +142,20 @@
this.status = RgvStatusType.get(type).id.shortValue();
}
- public void setStatus1(Short status1){
- this.status1 = status1;
- this.statusType1 = RgvStatusType.get(status1);
- }
-
- public void setStatus1(RgvStatusType type1){
- this.statusType1 = type1;
- this.status1 = RgvStatusType.get(type1).id.shortValue();
- }
-
- public void setStatus2(Short status2){
- this.status2 = status2;
- this.statusType2 = RgvStatusType.get(status2);
- }
-
- public void setStatus2(RgvStatusType type2){
- this.statusType2 = type2;
- this.status2 = RgvStatusType.get(type2).id.shortValue();
- }
-
- /**
- * 鏈�杩戜竴娆″叆鍑哄簱绫诲瀷
- * I:鍏ュ簱
- * O:鍑哄簱
- */
- private String lastIo = "I";
-
-
public BasRgv toSqlModel(BasRgv basRgv){
if (alarm!=null) {
basRgv.setRgvErr(alarm.longValue());
}
- basRgv.setWrkNo1(taskNo1.intValue());
- basRgv.setWrkNo2(taskNo2.intValue());
+ basRgv.setWrkNo1(taskNo.intValue());
return basRgv;
+ }
+
+ public long getRgvPosDestinationOrPos(boolean sign){
+ if (!sign){
+ return RgvPosDestination>RgvPos? RgvPosDestination:RgvPos;
+ } else {
+ return RgvPosDestination<RgvPos? RgvPosDestination:RgvPos;
+ }
}
public void setxSpeed(Short xSpeed) {
@@ -201,10 +170,53 @@
this.xDuration = Float.valueOf(xDuration);
}
- public Integer getRgvPosI(){
- //闇�瑕佹牴鎹幇鍦烘敼閫� 鏍规嵁璇诲埌鐨勫�艰幏鍙栧搴旂珯鐐逛綅缃�
- if (RgvPos==null) return 0;
- return RgvPos.intValue();
+ public int getAlarm$(){
+ if (err1){
+ return 1;
+ }
+ if (err2){
+ return 2;
+ }
+ if (err3){
+ return 3;
+ }
+ if (err4){
+ return 4;
+ }
+ if (err5){
+ return 5;
+ }
+ if (err6){
+ return 6;
+ }
+ if (err7){
+ return 7;
+ }
+ if (err8){
+ return 8;
+ }
+ return 0;
+ }
+ public String getAlarmM(){
+ switch (getAlarm$()){
+ case 1:
+ return "鎬ュ仠";
+ case 2:
+ return "鏈夌墿鏃犺祫鏂�";
+ case 3:
+ return "鍛戒护閿欒璧拌閾炬潯鍐茬獊";
+ case 4:
+ return "鐩爣涓鸿秴杩囪蛋琛屾瀬闄�";
+ case 5:
+ return "鍙橀鍣ㄥ紓甯�";
+ case 6:
+ return "鍏夌數寮傚父";
+ case 7:
+ return "灏忚溅妯″紡鍒囨崲閿欒";
+ case 8:
+ return "鍏跺畠鏈煡寮傚父";
+ }
+ return "姝e父";
}
}
--
Gitblit v1.9.1