【修改连挂后,故障车到达位置】
This commit is contained in:
parent
8cb9d9bb84
commit
c84538bc4f
|
@ -433,22 +433,29 @@ public class AtsTrainService {
|
|||
throw new SimulationException(SimulationExceptionType.System_Fault, "只能选列车或区段");
|
||||
}
|
||||
Section section = (Section) element;
|
||||
VirtualRealityTrain linkTrain = train.getLinkTrain();
|
||||
if (linkTrain != null) {
|
||||
Section linkTrainTargetSection = section.getNextRunningSectionOf(right);
|
||||
if (linkTrainTargetSection.isStandTrack()) {
|
||||
SectionPosition linkTrainTargetPosition = new SectionPosition(linkTrainTargetSection, linkTrainTargetSection.getStopPointByDirection(right));
|
||||
Float distance = CalculateService.calculateDistance(linkTrain.getHeadPosition(), linkTrainTargetPosition, right, false);
|
||||
if (distance == null) {
|
||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument, "无法到达的位置");
|
||||
}
|
||||
tempTargetPosition = CalculateService.calculateNextPositionByStartAndLen(headPosition, right, distance, false);
|
||||
} else {
|
||||
tempTargetPosition = new SectionPosition(section, section.getStopPointByDirection(right));
|
||||
}
|
||||
} else {
|
||||
tempTargetPosition = new SectionPosition(section, section.getStopPointByDirection(right));
|
||||
// VirtualRealityTrain linkTrain = train.getLinkTrain();
|
||||
// if (linkTrain != null) {
|
||||
// Section linkTrainTargetSection = section.getNextRunningSectionOf(right);
|
||||
// if (linkTrainTargetSection.isStandTrack()) {
|
||||
// SectionPosition linkTrainTargetPosition = new SectionPosition(linkTrainTargetSection, linkTrainTargetSection.getStopPointByDirection(right));
|
||||
// Float distance = CalculateService.calculateDistance(linkTrain.getHeadPosition(), linkTrainTargetPosition, right, false);
|
||||
// if (distance == null) {
|
||||
// throw new SimulationException(SimulationExceptionType.Illegal_Argument, "无法到达的位置");
|
||||
// }
|
||||
// tempTargetPosition = CalculateService.calculateNextPositionByStartAndLen(headPosition, right, distance, false);
|
||||
// } else {
|
||||
// tempTargetPosition = new SectionPosition(section, section.getStopPointByDirection(right));
|
||||
// }
|
||||
// } else {
|
||||
// tempTargetPosition = new SectionPosition(section, section.getStopPointByDirection(right));
|
||||
// }
|
||||
Section targetSection = section.getNextRunningSectionOf(right);
|
||||
SectionPosition trainTargetPosition = new SectionPosition(targetSection, targetSection.getStopPointByDirection(right));
|
||||
Float distance = CalculateService.calculateDistance(train.getHeadPosition(), trainTargetPosition, right, false);
|
||||
if (distance == null) {
|
||||
throw new SimulationException(SimulationExceptionType.Illegal_Argument, "无法到达的位置");
|
||||
}
|
||||
tempTargetPosition = new SectionPosition(section, section.getStopPointByDirection(right));
|
||||
} else {
|
||||
VirtualRealityTrain targetTrain = repository.getVRByCode(targetDeviceCode, VirtualRealityTrain.class);
|
||||
SectionPosition targetTrainTailPosition = targetTrain.calculateTailPosition();
|
||||
|
|
Loading…
Reference in New Issue