| | |
| | | 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; |
| | |
| | | String confirmComCode = para.upCode ; |
| | | ParseParamsForDownV1_0_1 downCpParams = new ParseParamsForDownV1_0_1() ; |
| | | downCpParams.setValue( |
| | | null, |
| | | ProtocolConstantV206V1_0_0.protocolName, |
| | | para.rtuAddr, |
| | | Command.defaultId, |
| | |
| | | protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception { |
| | | DataV1_0_1 dV1 = (DataV1_0_1)data.getSubData() ; |
| | | DataCd84Vo cdData = new DataCd84Vo() ; |
| | | dV1.dataCd84Vo = cdData ; |
| | | dV1.subData = cdData ; |
| | | |
| | | short index = ProtocolConstantV206V1_0_0.dataIndex ; |
| | | //用水户号数据格式:5字节BCD码低位在前高位在后。 |
| | | cdData.clientNum = ByteUtil.BCD2String_LE(bs, index, index + 4) ; |
| | | index += 5 ; |
| | | cdData.opType = bs[index] ; |
| | | |
| | | index++ ; |
| | | cdData.cardType = bs[index] ; |
| | | |
| | | index++ ; |
| | | cdData.cardAddr = ByteUtil.bytes2Hex(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.instantAmount += tpInt * 100000.0 ; |
| | | |
| | | cdData.alarmVo = GlParse.parseAlarm(bs, index) ; |
| | | index += 2 ; |
| | | cdData.stateVo = GlParse.parseState(bs, index) ; |
| | | index += 2 ; |
| | | |
| | | //控制器时钟 |
| | | cdData.rtuDt = GlParse.parseTp(bs, index) ; |
| | | //index += 6 ; |