diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java index 17b109320..fa074111b 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java @@ -500,14 +500,14 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { // 生成引导信号 if (!CollectionUtils.isEmpty(groundRouteList)) { for (Route route : groundRouteList) { - Route guide = this.buildGuideRouteFromGroundRoute(route, routeCodeGenerator); + Route guide = this.buildGuideRouteFromGroundRoute(route, routeCodeGenerator, config.isRouteInterlockDoNotIncludeStandHoldTrain()); routeList.add(guide); } } return routeList; } - private Route buildGuideRouteFromGroundRoute(Route route, CodeGenerator routeCodeGenerator) { + private Route buildGuideRouteFromGroundRoute(Route route, CodeGenerator routeCodeGenerator, boolean noStandHold) { Route clone = new Route(routeCodeGenerator.next(), route.getName()); clone.setArs(false); clone.setGuide(true); @@ -519,7 +519,9 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { clone.setSwitchList(route.getSwitchList()); clone.setPsdList(route.getPsdList()); clone.setEspList(route.getEspList()); - clone.setStandHoldList(route.getStandHoldList()); + if (!noStandHold) { + clone.setStandHoldList(route.getStandHoldList()); + } clone.setDestinationButtonSignal(route.getDestinationButtonSignal()); return clone; } @@ -609,7 +611,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { String code = routeCodeGenerator.next(); String name = String.format("%s-%s_%s", start.getName(), endName, index); Route route = this.buildRoute(code, name, start, end, clickEnd, sectionPath, - routeOverlap, config.isRouteSignalAlwaysGreen()); + routeOverlap, config.isRouteSignalAlwaysGreen(), config.isRouteInterlockDoNotIncludeStandHoldTrain()); routeList.add(route); ++index; } @@ -617,7 +619,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { String code = routeCodeGenerator.next(); String name = String.format("%s-%s", start.getName(), endName); Route route = this.buildRoute(code, name, start, end, clickEnd, sectionPath, - null, config.isRouteSignalAlwaysGreen()); + null, config.isRouteSignalAlwaysGreen(), config.isRouteInterlockDoNotIncludeStandHoldTrain()); routeList.add(route); } else { String code = routeCodeGenerator.next(); @@ -627,7 +629,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { overlap = overlapList.get(0); } Route route = this.buildRoute(code, name, start, end, clickEnd, sectionPath, - overlap, config.isRouteSignalAlwaysGreen()); + overlap, config.isRouteSignalAlwaysGreen(), config.isRouteInterlockDoNotIncludeStandHoldTrain()); routeList.add(route); } } @@ -1159,7 +1161,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { String code = routeCodeGenerator.next(); Route tbRoute = new Route(code, name); // 拷贝进路其他属性 - this.copyToTurnBackRoute(route, tbRoute); + this.copyToTurnBackRoute(route, tbRoute, config.isRouteInterlockDoNotIncludeStandHoldTrain()); tbRoute.setTurnBack(true); // 如果生成进路按钮,折返进路按钮默认为终端信号机 if (config.isRouteButton()) { @@ -1172,7 +1174,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { return tbRouteList; } - private void copyToTurnBackRoute(Route route, Route tbRoute) { + private void copyToTurnBackRoute(Route route, Route tbRoute, boolean noStandHold) { tbRoute.setInterlockStation(route.getInterlockStation()); tbRoute.setStart(route.getStart()); tbRoute.setDestination(route.getDestination()); @@ -1184,7 +1186,9 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { tbRoute.setFlt(route.isFlt()); tbRoute.setArs(route.isArs()); // 根据区段设置进路联锁站台相关元素 - tbRoute.setStandHoldList(route.getStandHoldList()); + if (!noStandHold) { + tbRoute.setStandHoldList(route.getStandHoldList()); + } tbRoute.setPsdList(route.getPsdList()); tbRoute.setEspList(route.getEspList()); } @@ -1264,11 +1268,12 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { * @param sectionPath * @param routeOverlap * @param alwaysGreen 进路始端信号是否总是开绿灯 + * @param noStandHold * @return */ private Route buildRoute(String code, String name, Signal start, Signal end, Signal endButton, - SectionPath sectionPath, RouteOverlap routeOverlap, boolean alwaysGreen) { + SectionPath sectionPath, RouteOverlap routeOverlap, boolean alwaysGreen, boolean noStandHold) { Route route = new Route(code, name); route.setInterlockStation(start.getInterlockStation()); route.setStart(start); @@ -1337,7 +1342,9 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { } } } - route.setStandHoldList(standHoldList); + if (!noStandHold) { + route.setStandHoldList(standHoldList); + } route.setPsdList(psdList); route.setEspList(espList); return route; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java index 531a1bbf1..efddc59a9 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/RouteService.java @@ -308,7 +308,7 @@ public class RouteService { log.info(String.format("进路[%s]排列检查失败,无法排列:%s", route.debugStr(), check.debugStr())); return check; } - if (route.isLock()) { + if (route.isLock() && !route.isFleetMode()) { log.info(String.format("进路[%s]已经锁闭", route.debugStr())); return null; } diff --git a/src/main/java/club/joylink/rtss/vo/map/MapAutoSignalNewVO.java b/src/main/java/club/joylink/rtss/vo/map/MapAutoSignalNewVO.java index 91e463815..a32ad5603 100644 --- a/src/main/java/club/joylink/rtss/vo/map/MapAutoSignalNewVO.java +++ b/src/main/java/club/joylink/rtss/vo/map/MapAutoSignalNewVO.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Getter; import lombok.Setter; +import org.springframework.util.CollectionUtils; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -81,7 +82,9 @@ public class MapAutoSignalNewVO { vo.setCode(autoSignal.getCode()); vo.setSignalCode(autoSignal.getSignal().getCode()); vo.setSectionList(autoSignal.getSectionList().stream().map(Section::getCode).collect(Collectors.toList())); - vo.setHoldStandList(autoSignal.getStandHoldList().stream().map(Stand::getCode).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(autoSignal.getStandHoldList())) { + vo.setHoldStandList(autoSignal.getStandHoldList().stream().map(Stand::getCode).collect(Collectors.toList())); + } vo.setPsdList(autoSignal.getPsdList().stream().map(PSD::getCode).collect(Collectors.toList())); vo.setEspList(autoSignal.getEspList().stream().map(ESP::getCode).collect(Collectors.toList())); vo.setConflictRouteList(autoSignal.getConflictRouteList().stream().map(Route::getCode).collect(Collectors.toList())); diff --git a/src/main/java/club/joylink/rtss/vo/map/MapCiGenerateConfig.java b/src/main/java/club/joylink/rtss/vo/map/MapCiGenerateConfig.java index c693d5e66..1229c9f65 100644 --- a/src/main/java/club/joylink/rtss/vo/map/MapCiGenerateConfig.java +++ b/src/main/java/club/joylink/rtss/vo/map/MapCiGenerateConfig.java @@ -121,6 +121,9 @@ public class MapCiGenerateConfig { /** 上下行站台共享紧急关闭效果的车站 */ private Set sharingECStations = new HashSet<>(); + /** 进路联锁不包含站台扣车 */ + private boolean routeInterlockDoNotIncludeStandHoldTrain; + // @ApiModelProperty(value = "是否分开生成ATP联锁和地面信号联锁") // private boolean apartGroundAndAtp; diff --git a/src/main/java/club/joylink/rtss/vo/map/MapRouteNewVO.java b/src/main/java/club/joylink/rtss/vo/map/MapRouteNewVO.java index 10ddb4268..a2a1a3574 100644 --- a/src/main/java/club/joylink/rtss/vo/map/MapRouteNewVO.java +++ b/src/main/java/club/joylink/rtss/vo/map/MapRouteNewVO.java @@ -223,7 +223,9 @@ public class MapRouteNewVO { if (Objects.nonNull(route.getOverlap())) { vo.setOverlapCode(route.getOverlap().getCode()); } - vo.setHoldStandList(route.getStandHoldList().stream().map(Stand::getCode).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(route.getStandHoldList())) { + vo.setHoldStandList(route.getStandHoldList().stream().map(Stand::getCode).collect(Collectors.toList())); + } vo.setPsdList(route.getPsdList().stream().map(PSD::getCode).collect(Collectors.toList())); vo.setEspList(route.getEspList().stream().map(ESP::getCode).collect(Collectors.toList())); vo.setConflictRouteList(route.getConflictingRouteList().stream().map(Route::getCode).collect(Collectors.toList()));