| | |
| | | package com.ld.igds.protocol.modbus; |
| | | |
| | | import com.ld.igds.constant.Constant; |
| | | import com.ld.igds.util.ContextUtil; |
| | | |
| | | import java.util.HashMap; |
| | |
| | | public class ServerUtil { |
| | | |
| | | |
| | | /** |
| | | * 用来缓存,TCP设备执行时间记录key = TCP唯一标志,value = 当前执行时间 |
| | | */ |
| | | public static Map<String, Long> contextExeModbusTcp = new HashMap<>(); |
| | | |
| | | public static final String RUN_TAG = "RUN_TAG"; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |