移动授权计算bug修改

This commit is contained in:
joylink_zhangsai 2021-04-02 18:54:47 +08:00
parent 28f992fb7c
commit 8d3cfc90ba

View File

@ -128,19 +128,6 @@ public class ZCLogicLoop {
if (headPosition.getSection().isFault()) {
endList.add(new MovementAuthority.End(headPosition.getSection(), MovementAuthority.EndType.FAULT_SECTION));
}
// 前方列车
VirtualRealityTrain frontTrain = this.queryFrontTrain(train, trainList);
if (Objects.nonNull(frontTrain)) {
Section baseSection;
if (Objects.equals(frontTrain.isRight(), train.isRight())) {
baseSection = frontTrain.calculateTailPosition().getSection();
} else {
baseSection = frontTrain.getHeadPosition().getSection();
}
endList.add(new MovementAuthority.End(frontTrain,
MovementAuthority.EndType.FRONT_TRAIN,
baseSection));
}
int count = 0;
while (count < 50) {
++count;
@ -202,6 +189,19 @@ public class ZCLogicLoop {
section = temp;
}
// 前方列车
VirtualRealityTrain frontTrain = this.queryFrontTrain(train, trainList);
if (Objects.nonNull(frontTrain)) {
Section baseSection;
if (Objects.equals(frontTrain.isRight(), train.isRight())) {
baseSection = frontTrain.calculateTailPosition().getSection();
} else {
baseSection = frontTrain.getHeadPosition().getSection();
}
endList.add(new MovementAuthority.End(frontTrain,
MovementAuthority.EndType.FRONT_TRAIN,
baseSection));
}
return endList;
}