| | |
| | | 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.DataCd84Vo; |
| | | import com.dy.common.util.ByteUtil; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | |
| | | dV1.subData = cdData ; |
| | | |
| | | short index = ProtocolConstantV206V1_0_0.dataIndex ; |
| | | cdData.opType = bs[index] ; |
| | | |
| | | index++ ; |
| | | cdData.cardType = bs[index] ; |
| | | |
| | | index++ ; |
| | | cdData.cardAddr = ByteUtil.bytes2Hex_LE(bs, false, index, 4) ; |
| | | |
| | | index += 4 ; |
| | | //用水户号数据格式:5字节BCD码低位在前高位在后。 |
| | | cdData.cardNo = ByteUtil.BCD2String_LE(bs, index, index + 4) ; |
| | | |
| | | index += 5 ; |
| | | |
| | | //用水户余额:用户余额4字节BCD码,取值范围0.00~999999.99,单位为元。 |
| | | cdData.remainMoney = 0.0D ; |
| | | int tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.remainMoney += tpInt/100.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.remainMoney += tpInt; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.remainMoney += tpInt * 100.0 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index) ; |
| | | index++ ; |
| | | cdData.remainMoney += tpInt * 10000.0 ; |
| | | int tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 3) ; |
| | | cdData.remainMoney = tpInt/100.0 ; |
| | | |
| | | index += 4 ; |
| | | //累计流量: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 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ; |
| | | cdData.totalAmount = tpInt/100.0; |
| | | |
| | | index += 5 ; |
| | | //瞬时流量:5字节BCD码,取值范围0~9999999.999,单位为m3/h。 |
| | | cdData.instantAmount = 0.0D ; |
| | | 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 ; |
| | | tpInt = ByteUtil.BCD2Int_LE(bs, index, index + 4) ; |
| | | cdData.instantAmount = tpInt/1000.0 ; |
| | | |
| | | index += 5 ; |
| | | cdData.alarmVo = GlParse.parseAlarm(bs, index) ; |
| | | index += 2 ; |
| | | cdData.stateVo = GlParse.parseState(bs, index) ; |
| | | index += 2 ; |
| | | |
| | | //控制器时钟 |
| | | cdData.rtuDt = GlParse.parseTp(bs, index) ; |