【筛选实训设备修改】
This commit is contained in:
parent
0ab197318f
commit
9426b1165b
@ -20,7 +20,7 @@ public enum MapDeviceRule {
|
|||||||
@Override
|
@Override
|
||||||
public List<Station> filterMapDeviceList(Simulation simulation) {
|
public List<Station> filterMapDeviceList(Simulation simulation) {
|
||||||
List<Station> stationList = simulation.getBuildParams().getMap().getGraphDataNew().getStationList()
|
List<Station> stationList = simulation.getBuildParams().getMap().getGraphDataNew().getStationList()
|
||||||
.stream().filter(s -> s.isVisible() && s.isCentralized() && s.isCiStation())
|
.stream().filter(s -> s.isVisible() && s.isCentralized() && s.isCiStation() && !s.isDepot())
|
||||||
.sorted(Comparator.comparing(MapStationNewVO::getSn))
|
.sorted(Comparator.comparing(MapStationNewVO::getSn))
|
||||||
.map(MapStationNewVO::getCode)
|
.map(MapStationNewVO::getCode)
|
||||||
.map(code -> simulation.getRepository().getByCode(code, Station.class))
|
.map(code -> simulation.getRepository().getByCode(code, Station.class))
|
||||||
@ -56,11 +56,15 @@ public enum MapDeviceRule {
|
|||||||
ROUTE_LIST("进路列表") {
|
ROUTE_LIST("进路列表") {
|
||||||
@Override
|
@Override
|
||||||
public List<Route> filterMapDeviceList(Simulation simulation) {
|
public List<Route> filterMapDeviceList(Simulation simulation) {
|
||||||
boolean routeLikeHa1 = simulation.getRepository().getConfig().isRouteLikeHa1();
|
|
||||||
boolean railway = simulation.getRepository().getConfig().isRailway();
|
boolean railway = simulation.getRepository().getConfig().isRailway();
|
||||||
List<Route> routeList = simulation.getRepository().getRouteList().stream().filter(route -> {
|
List<Route> routeList = simulation.getRepository().getRouteList().stream().filter(route -> {
|
||||||
if (route.getStart() == null || route.getStart().isVirtual()
|
if (route.getStart() == null || route.getStart().isVirtual()) {
|
||||||
|| (route.getStart().getStation()!= null && route.getStart().getStation().isDepot())) {
|
return false;
|
||||||
|
}
|
||||||
|
if (route.getStart().getStation()!= null && route.getStart().getStation().isDepot()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (route.getStart().getDeviceStation()!= null && route.getStart().getDeviceStation().isDepot()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (route.isGuide()) { // 引导进路跳过
|
if (route.isGuide()) { // 引导进路跳过
|
||||||
@ -138,7 +142,8 @@ public enum MapDeviceRule {
|
|||||||
SECTION_AXLE_COUNTER_LIST("道岔计轴区段列表") {
|
SECTION_AXLE_COUNTER_LIST("道岔计轴区段列表") {
|
||||||
@Override
|
@Override
|
||||||
public List<Section> filterMapDeviceList(Simulation simulation) {
|
public List<Section> filterMapDeviceList(Simulation simulation) {
|
||||||
List<Section> sectionList = querySectionListByFunction(simulation, Section::isSwitchAxleCounterSection);
|
List<Section> sectionList = querySectionListByFunction(simulation,
|
||||||
|
(section) -> section.isAxleCounter() && !section.isSwitchAxleCounterSection());
|
||||||
return generateRandomElement(sectionList, NUMBER);
|
return generateRandomElement(sectionList, NUMBER);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user