From e6f86688b8f6fa0d03cf88012f80759cd290af27 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期四, 13 六月 2024 14:37:48 +0800 Subject: [PATCH] 1、靳总协议报警及状态解决完善代码; 2、报警及状态处理完善; --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlParse.java | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlParse.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlParse.java index 21e888e..0f0b19e 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlParse.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlParse.java @@ -1,7 +1,7 @@ package com.dy.common.mw.protocol.p206V1_0_0.parse.global; -import com.dy.common.mw.protocol.p206V1_0_0.DataAlarmVo; -import com.dy.common.mw.protocol.p206V1_0_0.DataStateVo; +import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataAlarmVo; +import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataStateVo; import com.dy.common.util.ByteUtil; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -14,12 +14,12 @@ DataAlarmVo avo = new DataAlarmVo() ; byte b = bs[index] ; index++ ; - avo.batteryVolt = (byte)(b & 0x2) ; - avo.loss = (byte)(b & 0x8) ; - avo.meter = (byte)(b & 0x20) ; + avo.batteryVolt = (byte)(b & 0x2 >> 1) ; + avo.meter = (byte)(b & 0x20 >> 5) ; b = bs[index] ; - avo.valve = (byte)(b & 0x20) ; + avo.loss = (byte)(b & 0x2 >> 1) ; + avo.valve = (byte)(b & 0x4 >> 2) ; return avo ; } @@ -27,9 +27,9 @@ DataStateVo avo = new DataStateVo() ; byte b = bs[index] ; index++ ; - avo.icCard = (byte)(b & 0x4) ; - avo.working = (byte)(b & 0x8) ; - avo.valve = (byte)(b & 0x20) ; + avo.icCard = (byte)(b & 0x4 >> 2) ; + avo.working = (byte)(b & 0x10 >> 4) ; + avo.powerType = (byte)(b & 0x40 >> 6) ; return avo ; } @@ -44,7 +44,7 @@ index++ ; dt = ByteUtil.BCD2String_BE(bs, index, index) + " " + dt ;//鏃� index++ ; - bs[index] = (byte)(bs[index] & 0x10); + //bs[index] = (byte)(bs[index] & 0x10); dt = ByteUtil.BCD2String_BE(bs, index, index) + "-" + dt ;//鏈� index++ ; dt = "20" + ByteUtil.BCD2String_BE(bs, index, index) + "-" + dt ;//骞� -- Gitblit v1.8.0