pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_C0_Up.java
@@ -3,6 +3,7 @@
import com.dy.common.mw.protocol.*;
import com.dy.common.mw.protocol.p206V1_0_0.*;
import com.dy.common.mw.protocol.p206V1_0_0.parse.global.GlParse;
import com.dy.common.mw.protocol.p206V1_0_0.upVos.DataCdC0Vo;
import com.dy.common.util.ByteUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -58,6 +59,7 @@
        confirmCommand.rtuAddr = para.rtuAddr ;//Rtu地址
        confirmCommand.commandId = Command.defaultId ;//命令ID,发起命令的客户端(web端)生成,以匹配命令结果
        confirmCommand.downCode = confirmComCode ;//下行命令功能码;
        confirmCommand.downCodeName = CodeV1_0_1.getCodeName(confirmComCode) ;//下行命令功能码名称;
        confirmCommand.downBuffer = data ;//下行命令数据
        confirmCommand.downBufHex = ByteUtil.bytes2Hex(data, true) ;//下行命令数据十六进制形式
        confirmCommand.hasResponse = false ;//是否有应答
@@ -119,99 +121,39 @@
        */
        if(hasWaterAmount){
            //瞬时流量:5字节BCD码,取值范围0~9999999.999,单位为m3/h。
            cdData.instantAmount = 0.0D ;
            int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.instantAmount += tpInt/1000.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.instantAmount += tpInt/10.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.instantAmount += tpInt * 10.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.instantAmount += tpInt * 1000.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.instantAmount += tpInt * 100000.0 ;
            int tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ;
            cdData.instantAmount = tpInt/1000.0 ;
            //累计流量:5字节BCD码,取值范围0~9999999999,单位为m3。
            cdData.totalAmount = 0.0D ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.totalAmount += tpInt;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.totalAmount += tpInt * 100.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.totalAmount += tpInt * 10000.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.totalAmount += tpInt * 1000000.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.totalAmount += tpInt * 100000000.0 ;
            index += 5 ;
            //累计流量:5字节BCD码,取值范围0~99999999.99,单位为m3。
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ;
            cdData.totalAmount = tpInt/100.0;
            index += 5 ;
            //损失流量:5字节BCD码,取值范围0~9999999999,单位为m3。
            cdData.lossAmount = 0.0D ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.lossAmount += tpInt;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.lossAmount += tpInt * 100.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.lossAmount += tpInt * 10000.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.lossAmount += tpInt * 1000000.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.lossAmount += tpInt * 100000000.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ;
            cdData.lossAmount = tpInt/100.0;
            index += 5 ;
        }
        if(hasWaterPress){
            //水压:4字节BCD码,取值范围0~999999.99,单位为KPa。
            cdData.waterPress = 0.0D ;
            int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.waterPress += tpInt/100.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.waterPress += tpInt;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.waterPress += tpInt * 100.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.waterPress += tpInt * 10000.0 ;
            int tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 3) ;
            cdData.waterPress = tpInt/100.0 ;
            index += 4 ;
        }
        if(hasEleVolt){
            //电池电压:2字节BCD码,取值范围0~99.99,单位为V。
            cdData.batteryVolt = 0.0D ;//蓄电池电压
            cdData.sunVolt = 0.0D ;//太阳能电压
            int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.batteryVolt += tpInt/100.0 ;
            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            index++ ;
            cdData.batteryVolt += tpInt;
//            //太阳能电压:4字节BCD码,取值范围0~99.99,单位为V。
//            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
//            index++ ;
//            cdData.sunVolt += tpInt/100.0 ;
//            tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
//            index++ ;
//            cdData.sunVolt += tpInt;
            //蓄电池电压
            int tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 1) ;
            cdData.batteryVolt = tpInt/100.0 ;
            index += 2 ;
        }
        if(hasSignal){
            //信号强度:1字节BCD码,取值范围0~99。
            cdData.signalValue = 0 ;
            int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
            cdData.signalValue = tpInt  ;
            index++ ;
            cdData.signalValue += tpInt  ;
        }
        if(hasAlarmStatus){
            //报警数据
@@ -223,14 +165,10 @@
        }
        //水价:2字节BCD码,取值范围0~99.99,单位为元。
        cdData.waterPrice = 0.0D ;//水价
        int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
        index++ ;
        cdData.waterPrice += tpInt/100.0 ;
        tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ;
        index++ ;
        cdData.waterPrice += tpInt;
        int tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 1) ;
        cdData.waterPrice = tpInt/100.0 ;
        index += 2 ;
        cdData.rtuDt = GlParse.parseTp(bs, index) ;
    }