#
lty
2025-09-23 0ae7648dae40c6b7efa15e276099da7a9213ad37
src/main/java/com/zy/core/model/protocol/StaProtocol.java
@@ -3,6 +3,9 @@
import com.zy.asrs.entity.BasDevp;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
 * 输送线plc单个站点详细信息
 * Created by vincent on 2020/8/6
@@ -131,5 +134,32 @@
        }
        return null;
    }
//    public Integer getNearbySta() {
//        if (getNearbySta == null) return 0;
//
//        // key: 站点号  value: 基准物理位置
//        Map<Integer, Integer> posMap = new HashMap<>();
//        posMap.put(1004, 6534);
//        posMap.put(1007, 33634);
//        posMap.put(1010, 75174);
//        posMap.put(1014, 102124);
//        posMap.put(1018, 138224);
//        posMap.put(1021, 178034);
//        posMap.put(1024, 219684);
//        posMap.put(1028, 246724);
//        posMap.put(1031, 288194);
//        posMap.put(1035, 315204);
//        int tolerance = 50; // 允许误差范围
//
//        for (Map.Entry<Integer, Integer> entry : posMap.entrySet()) {
//            int site = entry.getKey();
//            int basePos = entry.getValue();
//            if (Math.abs(getNearbySta - basePos) <= tolerance) {
//                return site;
//            }
//        }
//
//        return 0; // 没匹配到站点
//    }
}