From c929083f415ef98765afec91d5a8c88be4450f5b Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期四, 30 五月 2024 09:16:11 +0800 Subject: [PATCH] 为甘肃嘉峪关项目基于靳总制定协议实现一款产品 --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_C2_Up.java | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_C2_Up.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_C2_Up.java index f15eed4..d5f5326 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_C2_Up.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V202404/parse/Cd_C2_Up.java @@ -3,6 +3,7 @@ import com.dy.common.mw.protocol.*; import com.dy.common.mw.protocol.p206V202404.*; +import com.dy.common.mw.protocol.p206V202404.parse.global.GlParse; import com.dy.common.mw.protocol.p206V202404.upVos.DataCd02Vo; import com.dy.common.mw.protocol.p206V202404.upVos.DataCdC2Vo; import com.dy.common.util.ByteUtil; @@ -53,7 +54,7 @@ para.data.subData==null?null:(((DataV202404)para.data.subData).subData), null); //鏋勯�犲簲绛� - byte[] data = new Cd_02_Down().doParse(downCpParams) ; + byte[] data = new Cd_C2_Down().doParse(downCpParams) ; MidResultToRtu confirmCommand = new MidResultToRtu() ; confirmCommand.protocolName = para.protocolName ;//鍗忚鍚嶇О @@ -84,7 +85,7 @@ */ protected void doParse(byte[] bs, int bsLen, String dataCode, Data data) throws Exception { DataV202404 dV1 = (DataV202404)data.getSubData() ; - DataCdC2Vo cdData = new DataCdC2Vo() ; + DataCdC2Vo cdData = new DataCdC2Vo(CodeV202404.getCodeName(dataCode)) ; dV1.subData = cdData ; int index = ProtocolConstantV206V202404.dataIndex ; cdData.controllerType = ByteUtil.bytes2Hex(bs, false, index, 1) ; @@ -106,5 +107,16 @@ cdData.success = true ; }else{ cdData.success = false ; - } } + } + + if(!cdData.success){ + return ; + } + + index++ ; + GlParse.parseRtuDt(bs, index); + + index+= 6 ; + GlParse.parseAlarmAndState(bs, index, cdData);//鍥涗釜瀛楄妭 + } } -- Gitblit v1.8.0