车辆段联锁生成-构建进路

This commit is contained in:
Jade 2021-09-16 15:52:46 +08:00
parent 9ade3a2ba3
commit a9e8b2d74d

View File

@ -746,8 +746,10 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
Signal nextOpSignal = Objects.nonNull(nextSection) ? nextSection.getSignalOf(!right) : null; Signal nextOpSignal = Objects.nonNull(nextSection) ? nextSection.getSignalOf(!right) : null;
Signal clickEnd; Signal clickEnd;
SignalAspect signalAspect;
if (startSignalType.equals(endSignalType) && Signal.SignalType.SHUNTING2.equals(startSignalType)) { if (startSignalType.equals(endSignalType) && Signal.SignalType.SHUNTING2.equals(startSignalType)) {
// 列车进路 // 列车进路
signalAspect = SignalAspect.Y;
if (Objects.nonNull(endOpSignal) && endOpSignalType.equals(startSignalType)) { if (Objects.nonNull(endOpSignal) && endOpSignalType.equals(startSignalType)) {
clickEnd = endOpSignal; clickEnd = endOpSignal;
} else { } else {
@ -755,6 +757,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
} }
} else { } else {
// 调车进路 // 调车进路
signalAspect = SignalAspect.W;
if (Objects.nonNull(nextOpSignal)) { if (Objects.nonNull(nextOpSignal)) {
// 下个区段反向信号机存在则使用 // 下个区段反向信号机存在则使用
clickEnd = nextOpSignal; clickEnd = nextOpSignal;
@ -772,12 +775,12 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
// 构建进路 // 构建进路
String code = routeCodeGenerator.next(); String code = routeCodeGenerator.next();
String name = String.format("%s-%s", startSignal.getShowName(), endName); String name = String.format("%s-%s", startSignal.getShowName(), endName);
Route route = this.buildRoute(code, name, startSignal, endSignal, clickEnd, sectionPath, Route route = this.buildRouteDepot(code, name, startSignal, endSignal, clickEnd, sectionPath, signalAspect);
null, config.isRouteSignalAlwaysGreen(), config.isRouteInterlockDoNotIncludeStandHoldTrain());
routeList.add(route); routeList.add(route);
} }
} else { } else {
errorList.add(String.format("以[%s(%s)]为始端信号的进路未搜索到", startSignal.getShowName(), startSignal.getCode())); errorList.add(String.format("以[%s(%s)]为始端信号(%s)的进路未搜索到", startSignal.getShowName(),
startSignal.getCode(), startSignal.getType()));
} }
return routeList; return routeList;
} }
@ -1493,6 +1496,24 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
return route; return route;
} }
/**
* 构建车辆段进路
*/
private Route buildRouteDepot(String code, String name, Signal start, Signal end,
Signal endButton, SectionPath sectionPath, SignalAspect signalAspect) {
Route route = new Route(code, name);
route.setInterlockStation(start.getInterlockStation());
route.setStart(start);
route.setDestination(end);
route.setDestinationButtonSignal(endButton);
route.setSectionList(sectionPath.getSectionList());
route.setSwitchList(sectionPath.getSwitchList());
route.setAspect(signalAspect);
route.setPsdList(Collections.emptyList());
route.setEspList(Collections.emptyList());
return route;
}
/** /**
* 根据路径创建延续保护 * 根据路径创建延续保护
* *