列车运行级别升级需ma的atp防护速度为正;计轴故障区段不会再显示通信车占用

This commit is contained in:
joylink_zhangsai 2021-09-28 18:14:28 +08:00
parent a345f73528
commit 8f43e51dba
4 changed files with 19 additions and 11 deletions

View File

@ -94,7 +94,7 @@ public class AtpSectionService {
if (parent != null) {
axle = parent;
}
if (axle.isAxleCounter() && !axle.isNctOccupied()) {
if (axle.isAxleCounter() && (!axle.isNctOccupied() || Section.AxleFault.FAULT.equals(axle.getFault()))) {
removes.add(atpSection);
continue;
}

View File

@ -21,7 +21,6 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
/**
* ATS追踪的列车信息
@ -382,7 +381,7 @@ public class TrainInfo extends MapElement {
this.communicable = train.isCommunicable();
if (headPosition.getSection().isSwitchTrack()) {
this.section = headPosition.getSection().getParent().getCode();
} else if (this.isCommunicable()) {
} else if (train.isCBTC()) {
this.section = headPosition.getLogicSection().getCode();
} else {
this.section = headPosition.getSection().getCode();

View File

@ -85,16 +85,10 @@ public class ATPLogicLoop {
atpService.updateRunLevel(train, RunLevel.IL, preselectionMode);
atpService.triggerSignalEB(train);
} else if (!train.isCBTC() && !train.isCbtcMaMiss() && defaultRunLevel.equals(RunLevel.CBTC)) {
boolean headSectionAxleFault = Section.AxleFault.FAULT
.equals(train.getHeadPosition().getSection().getFault()); //车头区段计轴故障
boolean tailSectionAxleFault = Section.AxleFault.FAULT
.equals(train.calculateTailPosition().getSection().getFault()); //车尾区段计轴故障
if (!headSectionAxleFault && !tailSectionAxleFault) {
atpService.updateRunLevel(train, RunLevel.CBTC, preselectionMode);
}
}
}
}
private void driveLogicRun(Simulation simulation, VirtualRealityTrain train) {
// MaService.Ma ma2 = train.getMa2();

View File

@ -1,6 +1,7 @@
package club.joylink.rtss.simulation.cbtc.onboard.ATP;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.simulation.cbtc.ATP.ground.MaService;
import club.joylink.rtss.simulation.cbtc.CI.CiApiService;
import club.joylink.rtss.simulation.cbtc.CI.device.CiStandService;
import club.joylink.rtss.simulation.cbtc.Simulation;
@ -447,10 +448,23 @@ public class ATPService {
if (!preselectionMode.isMatchTheRunLevel(runLevel)) {
return;
}
train.setRunLevel(runLevel);
switch (runLevel) {
case CBTC:
case ITC:
MaService.Ma ma = train.getMa2();
if (ma == null)
return;
SpeedCurve ebTriggerCurve = ma.getEbTriggerCurve();
float ebTriggerRemain = ma.calculateDistanceOfEbTriggerEnd();
ma.setEbTriggerCurve(ebTriggerCurve);
float totalDistance = ebTriggerCurve.getTotalDistance();
if (totalDistance < ebTriggerRemain) {
ebTriggerRemain = totalDistance;
}
float atpSpeed = ebTriggerCurve.getSpeedOf(ebTriggerRemain);
if (atpSpeed <= 0) {
return;
}
updateDriveMode(train, train.isAtoOn() ? DriveMode.AM : DriveMode.CM, preselectionMode);
break;
case IL:
@ -459,6 +473,7 @@ public class ATPService {
default:
throw new IllegalStateException("Unexpected value: " + runLevel);
}
train.setRunLevel(runLevel);
}
private void updateDriveMode(VirtualRealityTrain train, DriveMode driveMode) {