From 67be727c779e1af1058a70232a6bdd8db0bd59c9 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 25 二月 2025 08:33:14 +0800 Subject: [PATCH] 表阀一体机(王江海制定)通信协议:1、完善关阀类型;2、完善注释。 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/AlarmVo.java | 143 +++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 137 insertions(+), 6 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/AlarmVo.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/AlarmVo.java index 2b69dcf..c1729b0 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/AlarmVo.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/upVos/AlarmVo.java @@ -6,21 +6,152 @@ * @Description */ public class AlarmVo { + public static final byte DevOpenState = 1 ; + public static final byte DevCloseState = 0 ; public Byte statePump ; //娉�/闃�鐘舵�� (1锛氬紑娉�/闃�锛�0锛氬叧娉�/闃�) public Byte alarmWaterRemain ; //鍓╀綑姘撮噺鎶ヨ (1锛氬皬浜庢姤璀︿笂闄愭姤璀� 0锛氭甯�) public Byte alarm0WaterRemain ; //鍓╀綑姘撮噺涓�0鍏虫车/闃� (1锛氬墿浣欐按閲忎负0鍏虫车 0锛氭甯�) public Byte alarmExceedYear ; //骞村害瓒呴噰鎶ヨ (1锛氬勾鐢ㄦ按閲忓ぇ浜庨檺鍒舵按閲忔姤璀� 0锛氭甯�) public Byte alarmWaterMeterFault ; //澶栭儴娴侀噺璁℃晠闅� (1锛氭祦閲忚鏁呴殰鎶ヨ 0锛氭甯�) - public Byte alarmSteal ; //鍋锋按鎶ヨ (1锛氱粫寮�鎺у埗鍣ㄧ敤姘存姤璀� 0锛氭甯�) + public Byte alarmSteal ; //鍋锋按鎶ヨ (1锛氱粫寮�鎺у埗鍣ㄧ敤姘存姤璀� 0锛氭甯�)(2025-02-19锛氬搴旈澇鎬诲崗璁腑鐨勬紡鎹熸姤璀︼紝鍗冲叧闃�鎬佹椂鏈夋祦閲忎骇鐢�) public Byte alarmWaterMeterBreak ; //娴侀噺璁℃崯鍧忔姤璀� (1锛氭甯搁�氳浣嗙灛鏃朵负0鎶ヨ 0锛氭甯�) public Byte alarmEleMeterFault ; //鐢佃〃鏁呴殰鎶ヨ (1锛氬拰鐢佃〃閫氳鏂垨鏁版嵁涓嶆甯� 0锛氭甯�) - public Byte alarm0MoneyRemain ; //鍓╀綑閲戦涓�0鍏虫车/闃� (1锛氬墿浣欓噾棰濅负0鎶ヨ 0锛氭甯�) - public Byte alarmInnerDoor ; //鎺у埗鍣ㄥ唴闂ㄦ姤璀� (1锛氬唴闂ㄦ墦寮�鎶ヨ 0锛氭甯�) - public Byte alarmOuterDoor ; //鎺у埗鍣ㄥ闂ㄦ姤璀� (1锛氬闂ㄦ墦寮�鎶ヨ 0锛氭甯�) + public Byte alarm0MoneyRemain ; //鍓╀綑閲戦涓�0 (1锛氬墿浣欓噾棰濅负0鎶ヨ 0锛氭甯�) + public Byte alarmDoor; //鎺у埗鍣ㄥ唴闂ㄦ姤璀� (1锛氬唴闂ㄦ墦寮�鎶ヨ 0锛氭甯�) + public Byte alarmBatteryVolt; //鐢垫睜鐢靛帇浣庢姤璀� (1锛氱數姹犱綆鍏抽榾鎶ヨ 0锛氭甯�) public Byte alarmEleMiss ; //浜ゆ祦缂洪」鎶ヨ (1锛氫笁鐩哥己椤规姤璀� 0锛氭甯�) - public Byte alarmEleExceed ; //浜ゆ祦杩囨祦鎶ヨ (1锛氫氦娴佽繃娴佹姤璀� 0锛氭甯�) + public Byte alarmEleExceed ; //浜ゆ祦杩囨祦鎶ヨ (1锛氫氦娴佽繃娴佹姤璀� 0锛氭甯�) public Byte alarmEleLowVolt ; //涓夌浉鐢垫瑺鍘嬫姤璀� (1锛氭瑺鍘嬫姤璀� 0锛氭甯�) - public Byte stateIcEnable ; //IC鍗′娇鑳� (1銆両C鏈夊埛鍗℃敮鎸� 0锛氫笉鏀寔) + public Byte stateIcEnable ; //IC鍗′娇鑳� (1锛欼C鏈夊埛鍗℃敮鎸� 0锛氫笉鏀寔) + public Byte alarmBlockValve; //闃�闂ㄦ晠闅滄姤璀� (1:闃�闂ㄥ牭杞� 0锛氶榾闂ㄦ甯革紙涓嶅牭杞級) + public Byte stateOpClValve ; //闃�闂ㄥ紑鍏崇姸鎬� (1锛氬紑鍏抽榾涓嶅埌浣� 0锛氬紑鍏抽榾鍒颁綅) + + public boolean hasAlarm(){ + boolean flag = false ; + if((alarmBatteryVolt != null && alarmBatteryVolt == 1) || + (alarmWaterMeterFault != null && alarmWaterMeterFault == 1) || + (alarmWaterMeterBreak != null && alarmWaterMeterBreak == 1) || + (alarmSteal != null && alarmSteal == 1) || + (alarmBlockValve != null && alarmBlockValve == 1) ){ + flag = true ; + } + return flag ; + } + + public boolean hasAlarmExcludeLoss(){ + boolean flag = false ; + if((alarmBatteryVolt != null && alarmBatteryVolt == 1) || + (alarmWaterMeterFault != null && alarmWaterMeterFault == 1) || + (alarmWaterMeterBreak != null && alarmWaterMeterBreak == 1)|| + (alarmBlockValve != null && alarmBlockValve == 1) ){ + flag = true ; + } + return flag ; + } + + public String alarmContent(){ + String txt = "" ; + boolean hasTxt = false ; + if(alarmBatteryVolt != null && alarmBatteryVolt == 1){ + txt += (hasTxt?"銆�":"") + "鐢垫睜鐢靛帇浣庢姤璀�" ; + hasTxt = true ; + } + if(alarmWaterMeterFault != null && alarmWaterMeterFault == 1){ + txt += (hasTxt?"銆�":"") + "澶栭儴娴侀噺璁℃晠闅滄姤璀�" ; + hasTxt = true ; + } + if(alarmWaterMeterBreak != null && alarmWaterMeterBreak == 1){ + txt += (hasTxt?"銆�":"") + "娴侀噺璁℃晠闅滄姤璀�" ; + hasTxt = true ; + } + if(alarmSteal != null && alarmSteal == 1){ + txt += (hasTxt?"銆�":"") + "婕忔崯鎶ヨ" ; + hasTxt = true ; + } + if(alarmBlockValve != null && alarmBlockValve == 1){ + txt += (hasTxt?"銆�":"") + "闃�闂ㄦ晠闅滄姤璀�" ; + hasTxt = true ; + } + return txt ; + } + + public String alarmContentExcludeLoss(){ + String txt = "" ; + boolean hasTxt = false ; + if(alarmBatteryVolt != null && alarmBatteryVolt == 1){ + txt += (hasTxt?"銆�":"") + "鐢垫睜鐢靛帇浣庢姤璀�" ; + hasTxt = true ; + } + if(alarmWaterMeterFault != null && alarmWaterMeterFault == 1){ + txt += (hasTxt?"銆�":"") + "澶栭儴娴侀噺璁℃晠闅滄姤璀�" ; + hasTxt = true ; + } + if(alarmWaterMeterBreak != null && alarmWaterMeterBreak == 1){ + txt += (hasTxt?"銆�":"") + "娴侀噺璁℃晠闅滄姤璀�" ; + hasTxt = true ; + } + if(alarmBlockValve != null && alarmBlockValve == 1){ + txt += (hasTxt?"銆�":"") + "闃�闂ㄦ晠闅滄姤璀�" ; + hasTxt = true ; + } + return txt ; + } + public String toString(){ + StringBuffer sb = new StringBuffer() ; + sb.append(" 娉�/闃�鐘舵�� : ") ; + sb.append(statePump == null?"鏈煡":(statePump.byteValue()==1?"娉�/闃�寮�":(statePump.byteValue()==0?"娉�/闃�鍏�":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 鍓╀綑姘撮噺鎶ヨ : ") ; + sb.append(alarmWaterRemain == null?"鏈煡":(alarmWaterRemain.byteValue() == 0 ? "姝e父":(alarmWaterRemain.byteValue() == 1 ? "鎶ヨ":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 鍓╀綑0姘撮噺鍏虫车/闃� : ") ; + sb.append(alarm0WaterRemain == null?"鏈煡":(alarm0WaterRemain.byteValue() == 0 ? "姝e父":(alarm0WaterRemain.byteValue() == 1 ? "鍏虫车/闃�":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 骞村害瓒呴噰 : ") ; + sb.append(alarmExceedYear == null?"鏈煡":(alarmExceedYear.byteValue() == 0 ? "姝e父":(alarmExceedYear.byteValue() == 1 ? "鎶ヨ":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 娴侀噺璁℃晠闅� : ") ; + sb.append(alarmWaterMeterFault == null?"鏈煡":(alarmWaterMeterFault.byteValue() == 0 ? "姝e父":(alarmWaterMeterFault.byteValue() == 1 ? "鎶ヨ":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 鍋锋按 : ") ; + sb.append(alarmSteal == null?"鏈煡":(alarmSteal.byteValue() == 0 ? "姝e父":(alarmSteal.byteValue() == 1 ? "鎶ヨ":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 娴侀噺璁℃崯鍧� : ") ; + sb.append(alarmWaterMeterBreak == null?"鏈煡":(alarmWaterMeterBreak.byteValue() == 0 ? "姝e父":(alarmWaterMeterBreak.byteValue() == 1 ? "鎶ヨ":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 鐢佃〃鏁呴殰 : ") ; + sb.append(alarmEleMeterFault == null?"鏈煡":(alarmEleMeterFault.byteValue() == 0 ? "姝e父":(alarmEleMeterFault.byteValue() == 1 ? "鎶ヨ":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 鍓╀綑0閲戦鍏虫车/闃� : ") ; + sb.append(alarm0MoneyRemain == null?"鏈煡":(alarm0MoneyRemain.byteValue() == 0 ? "姝e父":(alarm0MoneyRemain.byteValue() == 1 ? "鍏虫车/闃�":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 鎺у埗鍣ㄥ唴闂� : ") ; + sb.append(alarmDoor == null?"鏈煡":(alarmDoor.byteValue() == 0 ? "姝e父":(alarmDoor.byteValue() == 1 ? "鎶ヨ":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 鐢垫睜鐢靛帇浣� : ") ; + sb.append(alarmBatteryVolt == null?"鏈煡":(alarmBatteryVolt.byteValue() == 0 ? "姝e父":(alarmBatteryVolt.byteValue() == 1 ? "鎶ヨ":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 浜ゆ祦缂洪」 : ") ; + sb.append(alarmEleMiss == null?"鏈煡":(alarmEleMiss.byteValue() == 0 ? "姝e父":(alarmEleMiss.byteValue() == 1 ? "鎶ヨ":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 浜ゆ祦杩囨祦 : ") ; + sb.append(alarmEleExceed == null?"鏈煡":(alarmEleExceed.byteValue() == 0 ? "姝e父":(alarmEleExceed.byteValue() == 1 ? "鎶ヨ":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 涓夌浉鐢垫瑺鍘� : ") ; + sb.append(alarmEleLowVolt == null?"鏈煡":(alarmEleLowVolt.byteValue() == 0 ? "姝e父":(alarmEleLowVolt.byteValue() == 1 ? "鎶ヨ":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" IC鍗″姛鑳� : ") ; + sb.append(stateIcEnable == null?"鏈煡":(stateIcEnable.byteValue() == 0 ? "鏃犳晥":(stateIcEnable.byteValue() == 1 ? "鏈夋晥":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 闃�闂ㄥ紑鍏崇姸鎬� : ") ; + sb.append(stateOpClValve == null?"鏈煡":(stateOpClValve.byteValue() == 0 ? "姝e父":(stateOpClValve.byteValue() == 1 ? "鏈埌浣�":"鏈煡"))) ; + sb.append("\n") ; + sb.append(" 闃�闂ㄥ牭杞姤璀� : ") ; + sb.append(alarmBlockValve == null?"鏈煡":(alarmBlockValve.byteValue() == 0 ? "姝e父":(alarmBlockValve.byteValue() == 1 ? "鎶ヨ":"鏈煡"))) ; + sb.append("\n") ; + + return sb.toString() ; + } } -- Gitblit v1.8.0