From 99bf09fbc855590e209dda4cd2b6c725101cbe9c Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期五, 26 七月 2024 14:39:43 +0800 Subject: [PATCH] 1、完善代码,把开关阀类型编码改为BCD码; 2、制定并实现协议“定时关阀计划开阀(A1H)”和“定量关阀计划开阀(A2H)”. --- pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_3D_Down.java | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_3D_Down.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_3D_Down.java index 5387d72..b8c2557 100644 --- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_3D_Down.java +++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/Cd_3D_Down.java @@ -11,9 +11,9 @@ /** * @Author liurunyu - * @Date 2024/4/10 18:51 - * @LastEditTime 2024/4/10 18:51 - * @Description + * @Date 2024/4/10 18:26 + * @LastEditTime 2024/4/10 18:26 + * @Description 璁剧疆姘翠环 */ @AnnotationCodeDown(ifAny={ CodeV1_0_1.cd_3D @@ -77,11 +77,11 @@ throw new Exception("鏈彁渚涘懡浠ゅ弬鏁版暟鎹紝涓嶈兘鏋勯�犲姛鑳界爜涓�" + para.commandCode + "鐨勪笅琛屽懡浠�") ; }else{ index = 0 ; - byte[] bs = new byte[12] ; - String icCardNo = ((String)para.param) ; - Integer icCardNoInt = Integer.valueOf(icCardNo); - ByteUtilUnsigned.int2Bytes_LE(bs, icCardNoInt, index); - index += 4 ; + byte[] bs = new byte[10] ; + Double priceDb = ((Double)para.param) * 100 ; + Integer priceInt = priceDb.intValue() ; + ByteUtilUnsigned.short2Bytes_LE(bs, priceInt.shortValue(), index); + index += 2 ; GlCreate.createPw(bs, index); index += 2 ; GlCreate.createTp(bs, index); @@ -97,4 +97,4 @@ return bytes ; } -} \ No newline at end of file +} -- Gitblit v1.8.0