修改“驾驶”命令设置目的地时的bug

This commit is contained in:
joylink_zhangsai 2023-11-24 10:52:23 +08:00
parent 3e8ed7095e
commit 29b94f0f1b
1 changed files with 3 additions and 4 deletions

View File

@ -467,11 +467,10 @@ public class AtsTrainService {
throw new SimulationException(SimulationExceptionType.System_Fault, "只能选列车或区段");
}
Section section = (Section) element;
Section targetSection = section.getNextRunningSectionOf(right);
SectionPosition trainTargetPosition = new SectionPosition(targetSection,
targetSection.getStopPointByDirection(right));
SectionPosition trainTargetPosition = new SectionPosition(section,
section.getStopPointByDirection(right));
Float distance = CalculateService.calculateDistance(train.getHeadPosition(),
trainTargetPosition, right, false);
trainTargetPosition, right, true);
if (distance == null) {
throw new SimulationException(SimulationExceptionType.Illegal_Argument, "无法到达的位置");
}