From d3553d8dd6fc00634ac32228e5b8e4d0624eda11 Mon Sep 17 00:00:00 2001 From: CZT <czt18638530771@163.com> Date: 星期三, 30 八月 2023 11:10:51 +0800 Subject: [PATCH] 调整Modbus配置-解决轴流风机与轴流窗不在同一个分机配置的问题 --- igds-protocol-modbus/src/main/java/com/ld/igds/protocol/modbus/ServerUtil.java | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/igds-protocol-modbus/src/main/java/com/ld/igds/protocol/modbus/ServerUtil.java b/igds-protocol-modbus/src/main/java/com/ld/igds/protocol/modbus/ServerUtil.java index b31119c..11a7979 100644 --- a/igds-protocol-modbus/src/main/java/com/ld/igds/protocol/modbus/ServerUtil.java +++ b/igds-protocol-modbus/src/main/java/com/ld/igds/protocol/modbus/ServerUtil.java @@ -1,5 +1,6 @@ package com.ld.igds.protocol.modbus; +import com.ld.igds.constant.Constant; import com.ld.igds.util.ContextUtil; import java.util.HashMap; @@ -11,10 +12,9 @@ public class ServerUtil { - /** - * 鐢ㄦ潵缂撳瓨锛孴CP璁惧鎵ц鏃堕棿璁板綍key = TCP鍞竴鏍囧織锛寁alue = 褰撳墠鎵ц鏃堕棿 - */ - public static Map<String, Long> contextExeModbusTcp = new HashMap<>(); + + public static final String RUN_TAG = "RUN_TAG"; + /** @@ -38,4 +38,17 @@ return contextStatusMap; } + + + + + + public static int getAddrExe(String temp) { + if (Constant.YN_N.equals(temp)) return 65535; + if (temp.length() > 4) { + temp = temp.substring(temp.length() - 4); + } + return Integer.valueOf(temp) - 1; + } + } -- Gitblit v1.9.3