diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/MaService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/MaService.java index 5b0b2855b..a88d51a1d 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/MaService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/MaService.java @@ -416,6 +416,22 @@ public class MaService { // 道岔故障进路,直接构建返回 ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.Fault_Route)); } + // 反向锁闭区段 + if (right != route.getStart().isRight()) { // 列车方向和区段进路方向相反 + Signal aheadSignal = section.getSignalOf(right); + if (aheadSignal == null || aheadSignal.getLockedRoute() == null || + !aheadSignal.getLockedRoute().isOpen()) { + ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.Closed_Section)); + } + } + } else if(front) { + if (!section.isRouteLock() && !section.isOverlapLock()) {//列车前方区段未锁闭 + Signal aheadSignal = section.getSignalOf(right); + if (aheadSignal == null || aheadSignal.getLockedRoute() == null || + !aheadSignal.getLockedRoute().isOpen()) { + ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.Closed_Section)); + } + } } if (section.isClosed()) { // 关闭的区段 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java index 56a116f7b..95adfdafc 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/onboard/ATP/ATPService.java @@ -273,6 +273,8 @@ public class ATPService { // 车尾变车头,车头变车尾 train.setHeadPosition(newHeadPosition); train.setRight(!right); + // 清除旧的移动授权 + train.setMa2(null); } public void changeEndsProgress(VirtualRealityTrain train) {