From b15920d5a66d379c9fd9cb15fcc48f0f078e7c77 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期一, 28 十月 2024 14:52:53 +0800 Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DriverV1_0_1.java | 23 ++++++++++++++++++----- 1 files changed, 18 insertions(+), 5 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DriverV1_0_1.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DriverV1_0_1.java index 97fe99c..aa554a5 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DriverV1_0_1.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/DriverV1_0_1.java @@ -23,6 +23,20 @@ downCpParams = new ParseParamsForDownV1_0_1() ; } + /** + * 娓呯┖鑷繁 + */ + @Override + public void clear() { + if(this.upCpParams != null){ + this.upCpParams.clear(); + } + if(this.downCpParams != null){ + this.downCpParams.clear(); + } + this.reportOrResponse_trueOrFalse = null ; + this.rtuAddrInData = null ; + } /** * 鎵弿璇嗗埆鍔熻兘鐮佹敞瑙g被 @@ -43,7 +57,7 @@ */ @Override public MidResult[] parseData(Boolean isLowPower, String rtuAddr, byte[] upBuffer, String upHex, DriverParserDataCallback callback, Object... params) { - reportOrResponse_trueOrFalse = null ; + this.clear(); boolean isFail = false ; String upCode = null ; try{ @@ -74,8 +88,7 @@ upData.setSubData(dV1_0_1) ; - this.upCpParams.clear(); - this.upCpParams.setValue(ProtocolConstantV206V1_0_0.protocolName, + this.upCpParams.setValue(ProtocolConstantV206V1_0_0.protocolName, rtuAddr, upCode, upHex, @@ -98,7 +111,7 @@ isFail = true ; return new MidResult[]{(new MidResultError(ProtocolConstantV206V1_0_0.protocolName, rtuAddr, "涓ラ噸閿欒锛屽垎鏋怰tu鏁版嵁鍑洪敊锛佹暟鎹负锛�" + upHex + (e.getMessage() == null?"":("锛屽嚭閿欎俊鎭細" + e.getMessage())), e))} ; } finally{ - callback.callback(rtuAddr, upCode, upHex, reportOrResponse_trueOrFalse, isFail, rtuAddrInData); + callback.callback(rtuAddr, upCode, CodeV1_0_1.getCodeName(upCode), upHex, reportOrResponse_trueOrFalse, isFail, rtuAddr); } } @@ -110,6 +123,7 @@ */ @Override public MidResult[] createCommand(Boolean isLowPower, Command command, Object... params) { + this.clear(); String RtuResultSendWebUrl = command.getRtuResultSendWebUrl() ; if(RtuResultSendWebUrl == null || RtuResultSendWebUrl.trim().equals("")){ return new MidResult[]{(new MidResultError(ProtocolConstantV206V1_0_0.protocolName, null, "涓ラ噸閿欒锛屽懡浠や腑rtu杩斿洖鍛戒护缁撴灉鍙戝悜鐩殑鍦皐eb URL涓虹┖锛屼笉鑳芥瀯寤轰换浣曞懡浠わ紒", null))} ; @@ -121,7 +135,6 @@ try { String commandCode = command.getCode() ; - this.downCpParams.clear(); this.downCpParams.setValue( RtuResultSendWebUrl, ProtocolConstantV206V1_0_0.protocolName, -- Gitblit v1.8.0