From 001f24d4efd7b818bc2224b976c82faf4f9e564c Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期五, 01 十一月 2024 11:25:00 +0800 Subject: [PATCH] 1、通信协议要增加版本号(目的为远程升级准备),原来没有版本号的协议默认为版本号为1,所以调整了程序命名; 2、流浪控制器与控制器数据库表都增加了协议版本号字段; 3、VO中Double和Float类型的属性增加注解@JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlParse.java | 35 ++++++++++++++++++++--------------- 1 files changed, 20 insertions(+), 15 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlParse.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlParse.java index 82e681d..e81594f 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlParse.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlParse.java @@ -53,29 +53,29 @@ /** * 鍒嗘瀽鐘舵�佷笌鎶ヨ - * @param bs - * @param index + * @param bs 涓婃姤鏁版嵁鐨勫瓧鑺傛暟缁� + * @param index 褰撳墠瑙f瀽鏁扮粍涓嬫爣浣嶇疆 * @return */ public static void parseAlarmAndState(byte[] bs, int index, AlarmVo vo){ byte b = bs[index] ; vo.statePump = (byte)(b & 0x1) ; - vo.alarmWaterRemain = (byte)(b >> 1 & 1) ; - vo.alarm0WaterRemain = (byte)(b >> 2 & 1) ; - vo.alarmExceedYear = (byte)(b >> 3 & 1) ; - vo.alarmWaterMeterFault = (byte)(b >> 4 & 1) ; - vo.alarmSteal = (byte)(b >> 5 & 1) ; - vo.alarmWaterMeterBreak = (byte)(b >> 6 & 1) ; - vo.alarmEleMeterFault = (byte)(b >> 7 & 1) ; + vo.alarmWaterRemain = (byte)((b >> 1) & 1) ; + vo.alarm0WaterRemain = (byte)((b >> 2) & 1) ; + vo.alarmExceedYear = (byte)((b >> 3) & 1) ; + vo.alarmWaterMeterFault = (byte)((b >> 4) & 1) ; + vo.alarmSteal = (byte)((b >> 5) & 1) ; + vo.alarmWaterMeterBreak = (byte)((b >> 6) & 1) ; + vo.alarmEleMeterFault = (byte)((b >> 7) & 1) ; b = bs[index + 1] ; vo.alarm0MoneyRemain = (byte)(b & 0x1) ; - vo.alarmInnerDoor = (byte)(b >> 1 & 1) ; - vo.alarmOuterDoor = (byte)(b >> 2 & 1) ; - vo.alarmEleMiss = (byte)(b >> 3 & 1) ; - vo.alarmEleExceed = (byte)(b >> 4 & 1) ; - vo.alarmEleLowVolt = (byte)(b >> 5 & 1) ; - vo.stateIcEnable = (byte)(b >> 6 & 1) ; + vo.alarmInnerDoor = (byte)((b >> 1) & 1) ; + vo.alarmOuterDoor = (byte)((b >> 2) & 1) ; + vo.alarmEleMiss = (byte)((b >> 3) & 1) ; + vo.alarmEleExceed = (byte)((b >> 4) & 1) ; + vo.alarmEleLowVolt = (byte)((b >> 5) & 1) ; + vo.stateIcEnable = (byte)((b >> 6) & 1) ; } public static String parseTp(byte[] bs, short index){ @@ -312,6 +312,11 @@ index += 8 ; cdData.startDt = GlParse.parseRtuDt(bs, index) ; + if(cdData.opResult == (byte)0x81){ + //澶辫触浜嗭紝涓嬮潰灏辨病鏈夋暟鎹簡 + return ; + } + index += 6 ; cdData.endDt = GlParse.parseRtuDt(bs, index) ; -- Gitblit v1.8.0