Merge remote-tracking branch 'origin/ats-restruct' into ats-restruct

This commit is contained in:
joylink_zhangsai 2021-08-04 15:16:20 +08:00
commit e0c7ad2150
3 changed files with 23 additions and 6 deletions

View File

@ -117,16 +117,24 @@ public class MaService {
} }
public float calculateDistanceOfAtoEnd() { public float calculateDistanceOfAtoEnd() {
boolean right = this.train.isRight();
float standard = this.calculateDistanceOfEbTriggerEnd() - Safety_Distance;
if (this.type.equals(MaType.Limit_Signal_With_Overlap) || if (this.type.equals(MaType.Limit_Signal_With_Overlap) ||
this.type.equals(MaType.Limit_Signal_Without_Overlap)) { this.type.equals(MaType.Limit_Signal_Without_Overlap)) {
Signal signal = (Signal) this.device; Signal signal = (Signal) this.device;
SectionPosition sectionPosition = new SectionPosition(signal.getSection(), signal.getOffset()); SectionPosition sectionPosition = new SectionPosition(signal.getSection(), signal.getOffset());
boolean right = this.train.isRight();
SectionPosition end = CalculateService.calculateNextPositionByStartAndLen(sectionPosition, !right, 2); SectionPosition end = CalculateService.calculateNextPositionByStartAndLen(sectionPosition, !right, 2);
return CalculateService.calculateDistance(this.train.getHeadPosition(), end, right); Float distance = CalculateService.calculateDistance(this.train.getHeadPosition(), end, right);
} else { if (distance < standard) {
return this.calculateDistanceOfEbTriggerEnd() - Safety_Distance; return distance;
} }
} else if(this.type.equals(MaType.Front_Train)) {
VirtualRealityTrain frontTrain = (VirtualRealityTrain) this.device;
if (frontTrain.isParkingAt()) {
return CalculateService.calculateDistance(this.train.getHeadPosition(), this.eoaPosition, right) - EB_Trigger;
}
}
return standard;
} }
public SectionPosition getEoaPosition() { public SectionPosition getEoaPosition() {
@ -250,6 +258,8 @@ public class MaService {
Fault_Route, Fault_Route,
/** 站台问题(屏蔽门或紧急停车) */ /** 站台问题(屏蔽门或紧急停车) */
Stand, Stand,
/** ITC终端信号 */
ITC_Signal,
} }
public void calculateMaOfCtcTrains(Simulation simulation) { public void calculateMaOfCtcTrains(Simulation simulation) {
@ -266,10 +276,17 @@ public class MaService {
System.out.println(ma.debugStr()); System.out.println(ma.debugStr());
} }
this.onboardAtpApiService.updateCtcMa(simulation, ma); this.onboardAtpApiService.updateCtcMa(simulation, ma);
} else {
} }
} }
} }
public Ma calculateAndUpdateItcMa(Simulation simulation, VirtualRealityTrain train) {
return null;
}
public Ma calculateCtcMa(Simulation simulation, VirtualRealityTrain train, Map<String, VirtualRealityTrain> trainMap) { public Ma calculateCtcMa(Simulation simulation, VirtualRealityTrain train, Map<String, VirtualRealityTrain> trainMap) {
SectionPosition headPosition = train.getHeadPosition(); SectionPosition headPosition = train.getHeadPosition();
SectionPosition tailPosition = train.getTailPosition(); SectionPosition tailPosition = train.getTailPosition();

View File

@ -409,7 +409,7 @@ public class AtsTrainLoadService {
this.trainOnlineAndBuildSupervise(simulation, loadedList); this.trainOnlineAndBuildSupervise(simulation, loadedList);
// 计算移动授权 // 计算移动授权
// this.maService.calculateMaOfCtcTrains(simulation); // this.maService.calculateMaOfCtcTrains(simulation);
this.zcLogicLoop.run(simulation); // this.zcLogicLoop.run(simulation);
// // 更新列车速度 // // 更新列车速度
// this.updateTrainSpeed(simulation); // this.updateTrainSpeed(simulation);
// 更新列车占用计轴区段 // 更新列车占用计轴区段

View File

@ -72,7 +72,7 @@ public class SpeedCurve {
float stopDistance = ma.calculateDistanceOfAtoEnd(); float stopDistance = ma.calculateDistanceOfAtoEnd();
float speedMax = Math.min(train.getAtoSpeedMax(), train.getSpeedLimit() * 0.9f); float speedMax = Math.min(train.getAtoSpeedMax(), train.getSpeedLimit() * 0.9f);
SpeedCurve atoStopCurve; SpeedCurve atoStopCurve;
if (train.isNextParking() || train.isHold()) { // 列车下一站停车 if (!train.isJump() && (train.isNextParking() || train.isHold())) { // 列车下一站停车
Section target = train.getTarget(); Section target = train.getTarget();
if (target != null) { if (target != null) {
float stopPoint = target.getStopPointByDirection(right); float stopPoint = target.getStopPointByDirection(right);