CZT
2023-08-30 a3f8ef130d998973a5d36bb196e1607827de81e8
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 {
    /**
     * 用来缓存,TCP设备执行时间记录key = TCP唯一标志,value = 当前执行时间
     */
    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;
    }
}