From 7c6fb7f8113dc85dc74d41e5a6a80adf7edcc2a1 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期一, 19 九月 2022 14:35:58 +0800 Subject: [PATCH] # --- src/main/java/com/zy/core/model/protocol/SteProtocol.java | 37 +++++++++++++++++++++++++------------ 1 files changed, 25 insertions(+), 12 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 81a7f81..3593f8e 100644 --- a/src/main/java/com/zy/core/model/protocol/SteProtocol.java +++ b/src/main/java/com/zy/core/model/protocol/SteProtocol.java @@ -34,6 +34,11 @@ public SteStatusType statusType; /** + * 浠诲姟鍙� + */ + public Short taskNo = 0; + + /** * 姝e湪鎵ц浠诲姟 */ public Boolean execute; @@ -47,18 +52,18 @@ /** * 寮傚父鐮�1 */ - public Integer alarm; + public Short alarm; /** * 寮傚父鐮�2 */ - public Integer alarm0; + public Short alarm0; /** * 鐢垫睜鐢甸噺 */ - public Short charge; + public Float charge = 0.0F; /** * 婊$數 @@ -71,10 +76,9 @@ public Boolean lowCharge; /** - * 鐢垫睜棣堢數 0锛屾甯革紝1棣堢數 + * 鐢垫睜棣堢數 0锛屾瑺鐢碉紝1浣庣數 2婊$數 */ public Short feed; - /** * 褰撳墠浣嶇疆 1锛岃繎鐐癸紝2杩滅偣锛�3A鐐癸紝4B鐐� @@ -91,7 +95,7 @@ /** * 褰撳墠閫熷害 */ - public Double speed; + public Double speed = 0.0D; /** * 楂樹綆浣� 0锛屼綆浣嶏紝1楂樹綅 @@ -107,11 +111,6 @@ * 鍦ㄨ建閬撲笂 0涓嶅湪锛�1鍦� */ public Short track; - - /** - * 浠诲姟鍙� - */ - public Integer taskNo = 0; /** * 浠诲姟绫诲瀷 @@ -218,12 +217,26 @@ */ private String lastIo = "I"; + private String pakMk = "-"; public BasSte toSqlModel(BasSte basSte){ if (alarm!=null) { basSte.setSteErr(alarm.longValue()); } - basSte.setWrkNo(taskNo); + basSte.setWrkNo(taskNo.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