diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java index 4d40c4ae5..1a3c21bcb 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/ZCLogicLoop.java @@ -439,7 +439,7 @@ public class ZCLogicLoop { boolean lock = false; if (!CollectionUtils.isEmpty(settingRoutes)) { for (Route route : settingRoutes) { - if (route.isRouteSection(section) && route.isRight() == right) { + if (route.isRight() == right && (route.isRouteSection(section) || route.isRouteSection(tailSection))) { lock = true; List switches = screenSwitchesInFront(route, tailSection); if (!this.checkRouteSwitchPosition(route, switches) || !this.isFlsCheckPass(route.getFlsList(), switches)) { @@ -497,6 +497,12 @@ public class ZCLogicLoop { boolean right = route.isRight(); List
sectionList = route.getSectionList(); List sectionRelSwitches = new ArrayList<>(); + for (int i = 0; i < 10; i++) { + if (sectionList.contains(section)) + break; + else + section = section.getNextRunningSectionOf(right); + } while (sectionList.contains(section)) { if (section.getRelSwitch() != null) sectionRelSwitches.add(section.getRelSwitch());