修改岔心所在计轴区段预复位成功后,预复位状态未清除的bug
This commit is contained in:
parent
2258062e9a
commit
f5c711da90
@ -136,29 +136,20 @@ public class VRTrainRunningService {
|
||||
return;
|
||||
|
||||
//进入计轴区段判断
|
||||
Section headAxleCounterSectionNew = headPositionNew.getSection();
|
||||
if (!headAxleCounterSectionNew.isAxleCounter()) {
|
||||
headAxleCounterSectionNew = headAxleCounterSectionNew.getParent();
|
||||
}
|
||||
if (!headAxleCounterSectionNew.isAxleCounter()) { //当是——物理区段-岔心-道岔计轴区段三层结构的时候需要多这次判断
|
||||
headAxleCounterSectionNew = headAxleCounterSectionNew.getParent();
|
||||
}
|
||||
if (headAxleCounterSectionNew != null && headAxleCounterSectionNew.isAxleCounter()) { //新的区段是计轴区段
|
||||
Section headSectionOld = headPosition.getSection();
|
||||
if (!headAxleCounterSectionNew.equals(headSectionOld) && !headAxleCounterSectionNew.equals(headSectionOld.getParent())) { //新计轴区段和老区段不一样
|
||||
Section headAxleCounterSectionNew = headPositionNew.getSection().findAxleCounterSection();
|
||||
if (headAxleCounterSectionNew != null) {
|
||||
Section headAxleCounterSection = headPosition.getSection().findAxleCounterSection();
|
||||
if (!headAxleCounterSectionNew.equals(headAxleCounterSection)) { //【车头所在计轴区段】发生变化
|
||||
headAxleCounterSectionNew.getVirtualAxleCounter().trainIn(trainRight);
|
||||
}
|
||||
}
|
||||
//离开计轴区段判断
|
||||
SectionPosition tailPositionOld = CalculateService.calculateNextPositionByStartAndLen(headPosition, !trainRight, train.getLen(), true);
|
||||
Section tailAxleCounterSection = tailPositionOld.getSection();
|
||||
if (!tailAxleCounterSection.isAxleCounter()) {
|
||||
tailAxleCounterSection = tailAxleCounterSection.getParent();
|
||||
}
|
||||
if (tailAxleCounterSection != null && tailAxleCounterSection.isAxleCounter()) { //老的车尾区段是计轴区段
|
||||
Section tailAxleCounterSection = tailPositionOld.getSection().findAxleCounterSection();
|
||||
if (tailAxleCounterSection != null) {
|
||||
SectionPosition tailPositionNew = CalculateService.calculateNextPositionByStartAndLen(headPositionNew, !trainRight, train.getLen(), true);
|
||||
Section tailSectionNew = tailPositionNew.getSection();
|
||||
if (!tailAxleCounterSection.equals(tailSectionNew) && !tailAxleCounterSection.equals(tailSectionNew.getParent())) { //老车尾计轴区段和新车尾区段不一样
|
||||
Section tailAxleCounterSectionNew = tailPositionNew.getSection().findAxleCounterSection();
|
||||
if (!tailAxleCounterSection.equals(tailAxleCounterSectionNew)) { //【车尾所在计轴区段】发生变化
|
||||
tailAxleCounterSection.getVirtualAxleCounter().trainOut(trainRight);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user