车地通信异常情况下无法同步列车信息

This commit is contained in:
joylink_zhangsai 2023-11-27 10:06:43 +08:00
parent 787ecb5642
commit 300804dccc
1 changed files with 40 additions and 38 deletions

View File

@ -447,45 +447,47 @@ public class TrainInfo extends MapElement {
* @param train
*/
public TrainInfo tracking(VirtualRealityTrain train) {
this.runLevel = train.getRunLevel();
SectionPosition headPosition = train.getHeadPosition();
this.physicalSection = headPosition.getSection().getCode();
this.offsetp = headPosition.getPercent();
this.communicable = train.isCommunicable();
if (headPosition.getSection().isSwitchTrack()) {
this.section = headPosition.getSection().getParent().getCode();
} else if (train.isCBTC()) {
this.section = headPosition.getLogicSection().getCode();
} else {
this.section = headPosition.getSection().getCode();
}
this.right = train.isRight();
this.speed = train.getSpeed();
this.locationKM = train.getLocationKM();
this.doorOpen = !train.isAllDoorCloseAndLock();
this.driveMode = train.getDriveMode();
this.jump = train.isJump();
this.hold = train.isHold();
this.priorityRouteSet = train.isHold();
this.backUp = train.isBackUp();
this.orderStop = train.isOrderStop();
this.runningTime = train.getRunningTime();
if (train.isParkingAt()) {
List<Stand> standList = train.getHeadPosition().getSection().getStandList();
if (!CollectionUtils.isEmpty(standList)) {
this.parkingRemainTime = standList.get(0).getRemainTime();
}
} else {
this.parkingRemainTime = -1000;
}
if (speed == 0 && turnBackStatus.equals(TO) && headPosition.getSection().isTurnBackTrack()) {
this.turnBackStatus = STOP;
} else if (speed != 0 && this.turnBackStatus.equals(STOP)) {
this.turnBackStatus = EXIT;
}
this.preselectionMode = train.getPreselectionMode();
this.beAbout2Arrival = train.isBeAbout2Arrive();
this.groundCommunicable = train.isPowerOn();
if (groundCommunicable) { //车地通信正常的情况下才能同步列车信息
this.runLevel = train.getRunLevel();
SectionPosition headPosition = train.getHeadPosition();
this.physicalSection = headPosition.getSection().getCode();
this.offsetp = headPosition.getPercent();
this.communicable = train.isCommunicable();
if (headPosition.getSection().isSwitchTrack()) {
this.section = headPosition.getSection().getParent().getCode();
} else if (train.isCBTC()) {
this.section = headPosition.getLogicSection().getCode();
} else {
this.section = headPosition.getSection().getCode();
}
this.right = train.isRight();
this.speed = train.getSpeed();
this.locationKM = train.getLocationKM();
this.doorOpen = !train.isAllDoorCloseAndLock();
this.driveMode = train.getDriveMode();
this.jump = train.isJump();
this.hold = train.isHold();
this.priorityRouteSet = train.isHold();
this.backUp = train.isBackUp();
this.orderStop = train.isOrderStop();
this.runningTime = train.getRunningTime();
if (train.isParkingAt()) {
List<Stand> standList = train.getHeadPosition().getSection().getStandList();
if (!CollectionUtils.isEmpty(standList)) {
this.parkingRemainTime = standList.get(0).getRemainTime();
}
} else {
this.parkingRemainTime = -1000;
}
if (speed == 0 && turnBackStatus.equals(TO) && headPosition.getSection().isTurnBackTrack()) {
this.turnBackStatus = STOP;
} else if (speed != 0 && this.turnBackStatus.equals(STOP)) {
this.turnBackStatus = EXIT;
}
this.preselectionMode = train.getPreselectionMode();
this.beAbout2Arrival = train.isBeAbout2Arrive();
}
return this;
}