修改列车移动授权——添加未锁闭区段作为移动授权终点逻辑

This commit is contained in:
walker-sheng 2021-08-30 17:08:56 +08:00
parent f838bd8ba3
commit 20f23b5468
2 changed files with 18 additions and 0 deletions

View File

@ -416,6 +416,22 @@ public class MaService {
// 道岔故障进路直接构建返回 // 道岔故障进路直接构建返回
ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.Fault_Route)); 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()) { if (section.isClosed()) {
// 关闭的区段 // 关闭的区段

View File

@ -273,6 +273,8 @@ public class ATPService {
// 车尾变车头车头变车尾 // 车尾变车头车头变车尾
train.setHeadPosition(newHeadPosition); train.setHeadPosition(newHeadPosition);
train.setRight(!right); train.setRight(!right);
// 清除旧的移动授权
train.setMa2(null);
} }
public void changeEndsProgress(VirtualRealityTrain train) { public void changeEndsProgress(VirtualRealityTrain train) {