Merge remote-tracking branch 'origin/test' into ci-restruct

This commit is contained in:
walker-sheng 2021-08-30 17:22:06 +08:00
commit 05b61765f5
4 changed files with 29 additions and 2 deletions

View File

@ -190,6 +190,8 @@ public class MaService {
break;
}
case Closed_Section:
case UnLock_Section:
case Reverse_Lock_Section:
case Fault_Route:{
Section section = (Section) this.device;
eoa = new SectionPosition(section, right ? 0 : section.getLen());
@ -313,6 +315,10 @@ public class MaService {
ZC_Boundary,
/** 关闭的区段 */
Closed_Section,
/** 进路锁闭反向的区段 */
Reverse_Lock_Section,
/** 未锁闭的区段 */
UnLock_Section,
/** 进路联锁条件不再完备 */
Fault_Route,
/** 站台问题(屏蔽门或紧急停车) */
@ -416,6 +422,22 @@ public class MaService {
// 道岔故障进路直接构建返回
ma = this.checkAndUpdateMa(ma, new Ma(train, section, MaType.Fault_Route));
}
// 反向锁闭区段
if (front && 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.Reverse_Lock_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.UnLock_Section));
}
}
}
if (section.isClosed()) {
// 关闭的区段

View File

@ -34,6 +34,7 @@ public class SignalService {
public void blockade(Simulation simulation, Signal signal) {
if(!signal.isBlockade()) {
signal.setBlockade(true);
this.close(simulation, signal);
if (signal.getLockedRoute() != null) {
signal.setReblockade(true);
log.debug(signal.debugStr() + "因信号机封锁且有锁闭的进路而重复封锁");

View File

@ -498,9 +498,11 @@ public class TrainInfo extends MapElement {
this.actualArriveStandTrack = section.getCode();
this.actualArriveTime = arriveTime;
this.parking = true;
if (Objects.nonNull(this.planArriveTime)) {
if (!this.isPlanTrain()) {
this.dt = 0;
} else if (Objects.nonNull(this.planArriveTime)) {
this.dt = this.planArriveTime.toSecondOfDay() - arriveTime.toSecondOfDay();
} else if (this.isPlanTrain()) {
} else {
log.warn(String.format("列车[%s-%s|%s|%s]到达车站,没有计划到达,无法更新到达与计划误差时间",
groupNumber, serviceNumber, tripNumber, destinationCode));
}

View File

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