车辆段联锁生成-出段/进段信号机

This commit is contained in:
Jade 2021-09-27 17:40:30 +08:00
parent 6872f9b7bf
commit 7f6d9c863d
2 changed files with 25 additions and 6 deletions

View File

@ -147,10 +147,12 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
generatedRouteList.addAll(this.generateRouteDepot(signal, routeCodeGenerator, generateConfig, errorList)); generatedRouteList.addAll(this.generateRouteDepot(signal, routeCodeGenerator, generateConfig, errorList));
} else if (signal.getType().equals(Signal.SignalType.SHUNTING)) { } else if (signal.getType().equals(Signal.SignalType.SHUNTING)) {
generatedRouteList.addAll(this.generateRouteDepot(signal, routeCodeGenerator, generateConfig, errorList)); generatedRouteList.addAll(this.generateRouteDepot(signal, routeCodeGenerator, generateConfig, errorList));
} else if (signal.getType().equals(Signal.SignalType.INBOUND)) {
generatedRouteList.addAll(this.generateRouteDepot(signal, routeCodeGenerator, generateConfig, errorList));
} }
} }
log.info(String.format("生成一般进路[%s]条", generatedRouteList.size())); log.info(String.format("生成一般进路[%s]条", generatedRouteList.size()));
// // 进路敌对关系构建 // 进路敌对关系构建
this.buildRouteConflict(generatedRouteList); this.buildRouteConflict(generatedRouteList);
if (!CollectionUtils.isEmpty(errorList)) { if (!CollectionUtils.isEmpty(errorList)) {
@ -748,7 +750,9 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
Signal clickEnd; Signal clickEnd;
SignalAspect signalAspect; SignalAspect signalAspect;
if (startSignalType.equals(endSignalType) && Signal.SignalType.SHUNTING2.equals(startSignalType)) { if ((Signal.SignalType.SHUNTING2.equals(endSignalType) && Signal.SignalType.SHUNTING2.equals(startSignalType))
|| (Signal.SignalType.SHUNTING2.equals(endSignalType) && Signal.SignalType.INBOUND.equals(startSignalType))
|| (Signal.SignalType.OUTBOUND.equals(endSignalType) && Signal.SignalType.SHUNTING2.equals(startSignalType))) {
// 列车进路 // 列车进路
signalAspect = SignalAspect.Y; signalAspect = SignalAspect.Y;
if (Objects.nonNull(endOpSignal) && endOpSignalType.equals(startSignalType)) { if (Objects.nonNull(endOpSignal) && endOpSignalType.equals(startSignalType)) {
@ -1931,15 +1935,17 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
boolean right = startSignal.isRight(); boolean right = startSignal.isRight();
if (!CollectionUtils.isEmpty(tempPath.getSectionList())) { if (!CollectionUtils.isEmpty(tempPath.getSectionList())) {
Signal signal = tempPath.getLastSection().getSignalOf(right); Signal signal = tempPath.getLastSection().getSignalOf(right);
if (startSignal.getType().equals(Signal.SignalType.SHUNTING2)) { if (startSignal.getType().equals(Signal.SignalType.INBOUND)
// 同向类型相同信号机, // 列车兼调车信号机 -> 列车兼调车信号机 || startSignal.getType().equals(Signal.SignalType.SHUNTING2)) {
if (Objects.nonNull(signal) && signal.getType().equals(startSignal.getType())) { // 进段信号机 -> 列车兼调车信号机 列车兼调车信号机 -> 列车兼调车信号机, 列车兼调车信号机 -> 出段信号机
if (Objects.nonNull(signal) && (signal.getType().equals(Signal.SignalType.SHUNTING2)
|| signal.getType().equals(Signal.SignalType.OUTBOUND))) {
routePathList.add(tempPath); routePathList.add(tempPath);
return; return;
} }
if (Objects.isNull(section)) { if (Objects.isNull(section)) {
Signal lastSignal = tempPath.getLastSection().getSignalOf(!right); Signal lastSignal = tempPath.getLastSection().getSignalOf(!right);
if (Objects.nonNull(lastSignal) && lastSignal.getType().equals(startSignal.getType())) { if (Objects.nonNull(lastSignal) && lastSignal.getType().equals(Signal.SignalType.SHUNTING2)) {
routePathList.add(tempPath); routePathList.add(tempPath);
} }
return; return;
@ -1964,6 +1970,11 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator {
routePathList.add(tempPath); routePathList.add(tempPath);
return; return;
} }
// 调车信号机 -> 出段信号机
if (signal.getType().equals(Signal.SignalType.OUTBOUND)) {
routePathList.add(tempPath);
return;
}
} }
if (Objects.isNull(section)) { if (Objects.isNull(section)) {
// 尽头有反向信号机 // 尽头有反向信号机

View File

@ -662,6 +662,14 @@ public class Signal extends DelayUnlockDevice {
* 列车兼调车信号机 * 列车兼调车信号机
*/ */
SHUNTING2, SHUNTING2,
/**
* 进段信号机
*/
INBOUND,
/**
* 出段信号机
*/
OUTBOUND,
} }
public enum SignalFault implements DeviceFault { public enum SignalFault implements DeviceFault {