MA计算ato距离逻辑调整
This commit is contained in:
parent
a3634dda76
commit
1f6b77b26a
@ -117,16 +117,24 @@ public class MaService {
|
||||
}
|
||||
|
||||
public float calculateDistanceOfAtoEnd() {
|
||||
boolean right = this.train.isRight();
|
||||
float standard = this.calculateDistanceOfEbTriggerEnd() - Safety_Distance;
|
||||
if (this.type.equals(MaType.Limit_Signal_With_Overlap) ||
|
||||
this.type.equals(MaType.Limit_Signal_Without_Overlap)) {
|
||||
Signal signal = (Signal) this.device;
|
||||
SectionPosition sectionPosition = new SectionPosition(signal.getSection(), signal.getOffset());
|
||||
boolean right = this.train.isRight();
|
||||
SectionPosition end = CalculateService.calculateNextPositionByStartAndLen(sectionPosition, !right, 2);
|
||||
return CalculateService.calculateDistance(this.train.getHeadPosition(), end, right);
|
||||
} else {
|
||||
return this.calculateDistanceOfEbTriggerEnd() - Safety_Distance;
|
||||
Float distance = CalculateService.calculateDistance(this.train.getHeadPosition(), end, right);
|
||||
if (distance < standard) {
|
||||
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() {
|
||||
@ -250,6 +258,8 @@ public class MaService {
|
||||
Fault_Route,
|
||||
/** 站台问题(屏蔽门或紧急停车) */
|
||||
Stand,
|
||||
/** ITC终端信号 */
|
||||
ITC_Signal,
|
||||
}
|
||||
|
||||
public void calculateMaOfCtcTrains(Simulation simulation) {
|
||||
@ -266,10 +276,17 @@ public class MaService {
|
||||
System.out.println(ma.debugStr());
|
||||
}
|
||||
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) {
|
||||
SectionPosition headPosition = train.getHeadPosition();
|
||||
SectionPosition tailPosition = train.getTailPosition();
|
||||
|
@ -409,7 +409,7 @@ public class AtsTrainLoadService {
|
||||
this.trainOnlineAndBuildSupervise(simulation, loadedList);
|
||||
// 计算移动授权
|
||||
// this.maService.calculateMaOfCtcTrains(simulation);
|
||||
this.zcLogicLoop.run(simulation);
|
||||
// this.zcLogicLoop.run(simulation);
|
||||
// // 更新列车速度
|
||||
// this.updateTrainSpeed(simulation);
|
||||
// 更新列车占用计轴区段
|
||||
|
Loading…
Reference in New Issue
Block a user