liurunyu
2024-05-13 0e877574ab499260677ab81c2c0298eb25fe4fd0
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/global/GlParse.java
@@ -1,9 +1,7 @@
package com.dy.common.mw.protocol.p206V202404.parse.global;
import com.dy.common.mw.protocol.p206V202404.ProtocolConstantV206V202404;
import com.dy.common.mw.protocol.p206V202404.upVos.DataCd80_5BVo;
import com.dy.common.mw.protocol.p206V202404.upVos.DataCd81Vo;
import com.dy.common.mw.protocol.p206V202404.upVos.DataCd93_A3_85Vo;
import com.dy.common.mw.protocol.p206V202404.upVos.*;
import com.dy.common.util.ByteUtil;
import com.dy.common.util.ByteUtilUnsigned;
import org.apache.logging.log4j.LogManager;
@@ -32,7 +30,7 @@
        String mm = ByteUtil.BCD2String_BE(bs, index, index) ;
        index++ ;
        String yy = ByteUtil.BCD2String_BE(bs, index, index) ;
        return yy + "-" + mm + "-" + dd + " " + HH + ":" + MM + ":" + ss ;
        return "20" + yy + "-" + mm + "-" + dd + " " + HH + ":" + MM + ":" + ss ;
    }
   /**
     * 分析IC卡编号
@@ -61,23 +59,23 @@
    public static void parseAlarmAndState(byte[] bs, int index, DataCd80_5BVo vo){
        byte b = bs[index] ;
        vo.statePump = (byte)(b & 0x1) ;
        vo.alarmWaterRemain = (byte)(b & 0x2) ;
        vo.alarm0WaterRemain = (byte)(b & 0x4) ;
        vo.alarmExceedYear = (byte)(b & 0x8) ;
        vo.alarmWaterMeterFault = (byte)(b & 0x10) ;
        vo.alarmSteal = (byte)(b & 0x20) ;
        vo.alarmWaterMeterBreak = (byte)(b & 0x40) ;
        vo.alarmEleMeterFault = (byte)(b & 0x80) ;
        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) ;
        index++ ;
        b = bs[index] ;
        vo.alarm0MoneyRemain = (byte)(b & 0x1) ;
        vo.alarmInnerDoor = (byte)(b & 0x2) ;
        vo.alarmOuterDoor = (byte)(b & 0x4) ;
        vo.alarmEleMiss = (byte)(b & 0x8) ;
        vo.alarmEleExceed = (byte)(b & 0x10) ;
        vo.alarmEleLowVolt = (byte)(b & 0x20) ;
        vo.stateIcEnable = (byte)(b & 0x40) ;
        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) ;
    }
    /**
     * 分析状态与报警
@@ -88,23 +86,50 @@
    public static void parseAlarmAndState(byte[] bs, int index, DataCd81Vo vo){
        byte b = bs[index] ;
        vo.statePump = (byte)(b & 0x1) ;
        vo.alarmWaterRemain = (byte)(b & 0x2) ;
        vo.alarm0WaterRemain = (byte)(b & 0x4) ;
        vo.alarmExceedYear = (byte)(b & 0x8) ;
        vo.alarmWaterMeterFault = (byte)(b & 0x10) ;
        vo.alarmSteal = (byte)(b & 0x20) ;
        vo.alarmWaterMeterBreak = (byte)(b & 0x40) ;
        vo.alarmEleMeterFault = (byte)(b & 0x80) ;
        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) ;
        index++ ;
        b = bs[index] ;
        vo.alarm0MoneyRemain = (byte)(b & 0x1) ;
        vo.alarmInnerDoor = (byte)(b & 0x2) ;
        vo.alarmOuterDoor = (byte)(b & 0x4) ;
        vo.alarmEleMiss = (byte)(b & 0x8) ;
        vo.alarmEleExceed = (byte)(b & 0x10) ;
        vo.alarmEleLowVolt = (byte)(b & 0x20) ;
        vo.stateIcEnable = (byte)(b & 0x40) ;
        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) ;
    }
    /**
     * 分析状态与报警
     * @param bs
     * @param index
     * @return
     */
    public static void parseAlarmAndState(byte[] bs, int index, DataCd84Vo 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) ;
        index++ ;
        b = bs[index] ;
        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) ;
    }
    /**
     * 分析状态与报警
@@ -115,23 +140,50 @@
    public static void parseAlarmAndState(byte[] bs, int index, DataCd93_A3_85Vo vo){
        byte b = bs[index] ;
        vo.statePump = (byte)(b & 0x1) ;
        vo.alarmWaterRemain = (byte)(b & 0x2) ;
        vo.alarm0WaterRemain = (byte)(b & 0x4) ;
        vo.alarmExceedYear = (byte)(b & 0x8) ;
        vo.alarmWaterMeterFault = (byte)(b & 0x10) ;
        vo.alarmSteal = (byte)(b & 0x20) ;
        vo.alarmWaterMeterBreak = (byte)(b & 0x40) ;
        vo.alarmEleMeterFault = (byte)(b & 0x80) ;
        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) ;
        index++ ;
        b = bs[index] ;
        vo.alarm0MoneyRemain = (byte)(b & 0x1) ;
        vo.alarmInnerDoor = (byte)(b & 0x2) ;
        vo.alarmOuterDoor = (byte)(b & 0x4) ;
        vo.alarmEleMiss = (byte)(b & 0x8) ;
        vo.alarmEleExceed = (byte)(b & 0x10) ;
        vo.alarmEleLowVolt = (byte)(b & 0x20) ;
        vo.stateIcEnable = (byte)(b & 0x40) ;
        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) ;
    }
   /**
     * 分析状态与报警
     * @param bs
     * @param index
     * @return
     */
    public static void parseAlarmAndState(byte[] bs, int index, DataCdC2Vo 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) ;
        index++ ;
        b = bs[index] ;
        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) ;
    }
    public static String parseTp(byte[] bs, short index){