From 420908594a3a926765c37cb1c6bd20ba74556109 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期四, 25 七月 2024 16:07:43 +0800 Subject: [PATCH] 1、完善协议解析(RTU地址解析); 2、测试系统增加设置RTU地址的命令测试。 --- pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/CommandP206V1_0_0Ctrl.java | 65 +++++++++++++++++++++++++++++--- 1 files changed, 58 insertions(+), 7 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/CommandP206V1_0_0Ctrl.java b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/CommandP206V1_0_0Ctrl.java index b15fe11..48e0a22 100644 --- a/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/CommandP206V1_0_0Ctrl.java +++ b/pipIrr-platform/pipIrr-web/pipIrr-mwTest-web/src/main/java/com/dy/pipIrrMwTestWeb/p206V1_0_0/CommandP206V1_0_0Ctrl.java @@ -29,20 +29,36 @@ if(com == null){ rt = this.connect() ;//杩炴帴閫氫俊涓棿浠舵祴璇� }else{ - if(com.equals("21")){ + if(com.equals("10")){ + rt = this.cd10() ; + }else if(com.equals("21")){ rt = this.cd21() ; }else if(com.equals("37")){ rt = this.cd37() ; + }else if(com.equals("67")){ + rt = this.cd67() ; }else if(com.equals("38")){ rt = this.cd38() ; + }else if(com.equals("68")){ + rt = this.cd68() ; }else if(com.equals("39")){ rt = this.cd39() ; + }else if(com.equals("69")){ + rt = this.cd69() ; }else if(com.equals("3A")){ rt = this.cd3A() ; + }else if(com.equals("6A")){ + rt = this.cd6A() ; }else if(com.equals("3B")){ rt = this.cd3B() ; + }else if(com.equals("6B")){ + rt = this.cd6B() ; }else if(com.equals("3C")){ rt = this.cd3C() ; + }else if(com.equals("65")){ + rt = this.cd65() ; + }else if(com.equals("91")){ + rt = this.cd91() ; }else if(com.equals("92")){ rt = this.cd92() ; }else if(com.equals("93")){ @@ -58,12 +74,19 @@ return rt ; } + /** * 娴嬭瘯杩為�氭�� * @return */ private BaseResponse connect(){ return this.sendTest() ; + } + + private BaseResponse cd10(){ + Com10Vo comVo = new Com10Vo() ; + comVo.rtuAddr = "532328059995" ;//鍓�6浣嶆槸琛屾斂鍖哄垝鐮侊紝鍚�6浣嶆槸搴忓垪鍙锋渶澶ф槸065535 + return this.sendCom2Mw(this.command(CodeV1_0_1.cd_10, comVo, null)) ; } private BaseResponse cd21(){ @@ -75,8 +98,12 @@ private BaseResponse cd37(){ Com37Vo comVo = new Com37Vo() ; - comVo.seconds = 20 ; + comVo.seconds = 20 ;//鍗曚綅绉� return this.sendCom2Mw(this.command(CodeV1_0_1.cd_37, comVo, null)) ; + } + private BaseResponse cd67(){ + Com37Vo comVo = new Com37Vo() ; + return this.sendCom2Mw(this.command(CodeV1_0_1.cd_67, comVo, null)) ; } private BaseResponse cd38(){ @@ -85,10 +112,18 @@ return this.sendCom2Mw(this.command(CodeV1_0_1.cd_38, comVo, null)) ; } + private BaseResponse cd68(){ + return this.sendCom2Mw(this.command(CodeV1_0_1.cd_68, null, null)) ; + } + private BaseResponse cd39(){ Com39Vo comVo = new Com39Vo() ; - comVo.batteryVoltAlarm = 1.0 ;//鐢垫睜鐢靛帇鎶ヨ鍊�(澶т簬0.1) + comVo.batteryVoltAlarm = 7.0 ;//鐢垫睜鐢靛帇鎶ヨ鍊�(澶т簬0.1) return this.sendCom2Mw(this.command(CodeV1_0_1.cd_39, comVo, null)) ; + } + + private BaseResponse cd69(){ + return this.sendCom2Mw(this.command(CodeV1_0_1.cd_69, null, null)) ; } private BaseResponse cd3A(){ @@ -97,16 +132,32 @@ return this.sendCom2Mw(this.command(CodeV1_0_1.cd_3A, comVo, null)) ; } + private BaseResponse cd6A(){ + return this.sendCom2Mw(this.command(CodeV1_0_1.cd_6A, null, null)) ; + } + private BaseResponse cd3B(){ Com3BVo comVo = new Com3BVo() ; - comVo.second = 30 ;//闃�闂ㄨ秴鏃舵椂闂�(绉�)(澶т簬1) + comVo.second = 120 ;//闃�闂ㄨ秴鏃舵椂闂�(绉�)(澶т簬1) return this.sendCom2Mw(this.command(CodeV1_0_1.cd_3B, comVo, null)) ; + } + + private BaseResponse cd6B(){ + return this.sendCom2Mw(this.command(CodeV1_0_1.cd_6B, null, null)) ; } private BaseResponse cd3C(){ Com3CVo comVo = new Com3CVo() ; - comVo.minute = 10 ;//鑷姤鍛ㄦ湡(鍒嗛挓)(澶т簬0) + comVo.minute = 60 ; return this.sendCom2Mw(this.command(CodeV1_0_1.cd_3C, comVo, null)) ; + } + + private BaseResponse cd65(){ + return this.sendCom2Mw(this.command(CodeV1_0_1.cd_65, null, null)) ; + } + + private BaseResponse<String> cd91() { + return this.sendCom2Mw(this.command(CodeV1_0_1.cd_91, null, null)) ; } private BaseResponse cd92(){ @@ -120,7 +171,7 @@ //APP杩滅▼寮�闃� private BaseResponse cd97(){ Com97Vo comVo = new Com97Vo() ; - comVo.icCardNo = CommandP206V1_0_0Ctrl.icCardNo ; + comVo.icCardNo = CommandP206V1_0_0Ctrl.vsIcCardNo; comVo.moneyRemain = 234.56 ; comVo.waterPrice = 1.2 ; return this.sendCom2Mw(this.command(CodeV1_0_1.cd_97, comVo, null)) ; @@ -128,7 +179,7 @@ //APP杩滅▼鍏抽榾 private BaseResponse cd98(){ Com98Vo comVo = new Com98Vo() ; - comVo.icCardNo = CommandP206V1_0_0Ctrl.icCardNo ; + comVo.icCardNo = CommandP206V1_0_0Ctrl.vsIcCardNo; return this.sendCom2Mw(this.command(CodeV1_0_1.cd_98, comVo, null)) ; } -- Gitblit v1.8.0