| | |
| | | */ |
| | | 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){ |
| | | //报警数据 |
| | |
| | | } |
| | | |
| | | //水价: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) ; |
| | | |
| | | } |