【运行方向初始化处理】

This commit is contained in:
weizhihong 2022-06-15 09:12:26 +08:00
parent 8499b22642
commit 6bfb45f109
2 changed files with 3 additions and 6 deletions

View File

@ -1686,6 +1686,9 @@ public class InterlockBuilder2 {
model.setSectionList(sectionList); model.setSectionList(sectionList);
} }
model.modifyRunStatus(); model.modifyRunStatus();
if (model.getCurrentRouteList() != null) { // 获取默认方向
model.setRight(model.getCurrentRouteList().stream().anyMatch(Route::isRight));
}
Station station = (Station) elementMap.get(stationDirection.getStationCode()); Station station = (Station) elementMap.get(stationDirection.getStationCode());
model.setStation(station); model.setStation(station);
station.getStationDirectionMap().put(model.getLabelEnum(), model); station.getStationDirectionMap().put(model.getLabelEnum(), model);

View File

@ -167,9 +167,6 @@ public class StationDirection extends MapNamedElement {
this.runStatus = this.getDefaultReceiveAndDeliver(); this.runStatus = this.getDefaultReceiveAndDeliver();
this.defaultRunStatus = this.getDefaultReceiveAndDeliver(); this.defaultRunStatus = this.getDefaultReceiveAndDeliver();
this.currentRouteList = getNowRouteList(); this.currentRouteList = getNowRouteList();
if (DirectionRunModel.A.equals(this.runModel)) {
this.right = this.currentRouteList.stream().anyMatch(Route::isRight);
}
} }
public StationDirection(DraftMapStationDirection draftMapStationDirection) { public StationDirection(DraftMapStationDirection draftMapStationDirection) {
@ -180,9 +177,6 @@ public class StationDirection extends MapNamedElement {
this.defaultRunStatus = draftMapStationDirection.getRunStatus(); this.defaultRunStatus = draftMapStationDirection.getRunStatus();
this.currentRouteList = getNowRouteList(); this.currentRouteList = getNowRouteList();
this.isDataConfig = true; this.isDataConfig = true;
if (DirectionRunModel.A.equals(this.runModel)) {
this.right = this.currentRouteList.stream().anyMatch(Route::isRight);
}
} }
public StationDirection(String code, String name) { public StationDirection(String code, String name) {