From 6c1c8d1b43a812ab01a932f4e6da86d4257b231c Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Mon, 19 Jul 2021 11:11:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E8=BF=9B=E8=B7=AF?= =?UTF-8?q?=E5=8A=9E=E7=90=86=E6=A3=80=E6=9F=A5=E5=86=85=E5=AE=B9=EF=BC=88?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E8=BF=9B=E8=B7=AF=EF=BC=89=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=EF=BC=9A<=E8=BF=9B=E8=B7=AF=E8=81=94=E9=94=81?= =?UTF-8?q?=E4=B8=8D=E5=8C=85=E5=90=AB=E7=AB=99=E5=8F=B0=E6=89=A3=E8=BD=A6?= =?UTF-8?q?>=E8=81=94=E9=94=81=E9=85=8D=E7=BD=AE=E5=8F=8A=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DraftMapCiDataGeneratorImpl.java | 29 ++++++++++++------- .../cbtc/CI/service/RouteService.java | 2 +- .../rtss/vo/map/MapAutoSignalNewVO.java | 5 +++- .../rtss/vo/map/MapCiGenerateConfig.java | 3 ++ .../joylink/rtss/vo/map/MapRouteNewVO.java | 4 ++- 5 files changed, 29 insertions(+), 14 deletions(-) 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()));