From 2cef80778a257e3c4afe08dc84e939734e336196 Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Thu, 2 Sep 2021 17:30:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E6=81=A2=E5=A4=8D=E6=97=A7=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91=EF=BC=88route?= =?UTF-8?q?=E5=92=8Csignal=E7=9A=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DraftMapCiDataGeneratorImpl.java | 47 +++++++++---------- .../publishData/PublishMapDataHandler.java | 7 ++- .../rtss/vo/map/logic/MapRouteNewVO.java | 2 +- 3 files changed, 28 insertions(+), 28 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 c6b1bf104..27a68f0e9 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapCiDataGeneratorImpl.java @@ -10,16 +10,11 @@ import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; import club.joylink.rtss.simulation.cbtc.exception.SimulationException; import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; import club.joylink.rtss.util.JsonUtils; -import club.joylink.rtss.vo.map.*; -import club.joylink.rtss.vo.map.logic.MapAutoReentryVO; -import club.joylink.rtss.vo.map.logic.MapAutoSignalNewVO; -import club.joylink.rtss.vo.map.logic.MapDestinationCodeDefinitionVO; -import club.joylink.rtss.vo.map.logic.MapOverlapVO; -import club.joylink.rtss.vo.map.logic.MapRouteFlankProtectionNewVO; -import club.joylink.rtss.vo.map.logic.MapRouteNewVO; -import club.joylink.rtss.vo.map.logic.MapRoutingDataVO; -import club.joylink.rtss.vo.map.logic.MapSignalApproachSectionVO; -import club.joylink.rtss.vo.map.logic.MapStationRunLevelVO; +import club.joylink.rtss.vo.map.CiGenerateResultVO; +import club.joylink.rtss.vo.map.MapCiGenerateConfig; +import club.joylink.rtss.vo.map.MapRoutingSectionNewVO; +import club.joylink.rtss.vo.map.MapVO; +import club.joylink.rtss.vo.map.logic.*; import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -530,7 +525,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { clone.setInterlockStation(route.getInterlockStation()); clone.setStart(route.getStart()); clone.setDestination(route.getDestination()); -// clone.setOpenGreen(route.isOpenGreen()); + clone.setOpenGreen(route.isOpenGreen()); clone.setAspect(route.getAspect()); clone.setSectionList(route.getSectionList()); clone.setSwitchList(route.getSwitchList()); @@ -1199,7 +1194,7 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { tbRoute.setSwitchList(route.getSwitchList()); tbRoute.setSetOverlapInCtc(route.isSetOverlapInCtc()); tbRoute.setOverlap(route.getOverlap()); -// tbRoute.setOpenGreen(route.isOpenGreen()); + tbRoute.setOpenGreen(route.isOpenGreen()); tbRoute.setAspect(route.getAspect()); // 根据信号机和区段是否同向,设置进路联锁自排和是否车队模式 tbRoute.setFlt(route.isFlt()); @@ -1314,20 +1309,20 @@ public class DraftMapCiDataGeneratorImpl implements DraftMapCiDataGenerator { route.setAspect(SignalAspect.W); break; } -// if (alwaysGreen) { // 进路始端信号机是否总是开绿灯 -// route.setOpenGreen(true); -// } else { // 根据进路道岔是否有反位,设置开绿灯/黄灯 -// boolean greenOpen = true; -// if (!CollectionUtils.isEmpty(sectionPath.getSwitchList())) { -// for (SwitchElement switchElement : sectionPath.getSwitchList()) { -// if (!switchElement.isNormal()) { -// greenOpen = false; -// break; -// } -// } -// } -// route.setOpenGreen(greenOpen); -// } + if (alwaysGreen) { // 进路始端信号机是否总是开绿灯 + route.setOpenGreen(true); + } else { // 根据进路道岔是否有反位,设置开绿灯/黄灯 + boolean greenOpen = true; + if (!CollectionUtils.isEmpty(sectionPath.getSwitchList())) { + for (SwitchElement switchElement : sectionPath.getSwitchList()) { + if (!switchElement.isNormal()) { + greenOpen = false; + break; + } + } + } + route.setOpenGreen(greenOpen); + } route.setTurnBack(false); // 根据信号机和区段是否同向,设置进路联锁自排和是否车队模式 boolean ars = true; // 联锁自排 diff --git a/src/main/java/club/joylink/rtss/services/publishData/PublishMapDataHandler.java b/src/main/java/club/joylink/rtss/services/publishData/PublishMapDataHandler.java index 9344913bd..4007c7a9f 100644 --- a/src/main/java/club/joylink/rtss/services/publishData/PublishMapDataHandler.java +++ b/src/main/java/club/joylink/rtss/services/publishData/PublishMapDataHandler.java @@ -12,7 +12,12 @@ import club.joylink.rtss.simulation.cbtc.constant.SignalModel; import club.joylink.rtss.simulation.cbtc.data.map.Signal; import club.joylink.rtss.util.JsonUtils; import club.joylink.rtss.util.VersionUtil; -import club.joylink.rtss.vo.map.*; +import club.joylink.rtss.vo.map.MapCheckConfig; +import club.joylink.rtss.vo.map.MapGraphDataNewVO; +import club.joylink.rtss.vo.map.MapLogicDataNewVO; +import club.joylink.rtss.vo.map.MapVO; +import club.joylink.rtss.vo.map.graph.MapSignalNewVO; +import club.joylink.rtss.vo.map.logic.MapRouteNewVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/club/joylink/rtss/vo/map/logic/MapRouteNewVO.java b/src/main/java/club/joylink/rtss/vo/map/logic/MapRouteNewVO.java index 88dfbd031..434087ff9 100644 --- a/src/main/java/club/joylink/rtss/vo/map/logic/MapRouteNewVO.java +++ b/src/main/java/club/joylink/rtss/vo/map/logic/MapRouteNewVO.java @@ -221,7 +221,7 @@ public class MapRouteNewVO { vo.setStartSignalCode(route.getStart().getCode()); vo.setEndSignalCode(route.getDestination().getCode()); vo.setEndButtonSignalCode(Objects.nonNull(route.getDestinationButtonSignal()) ? route.getDestinationButtonSignal().getCode() : null); -// vo.setGreenOpen(route.isOpenGreen()); + vo.setGreenOpen(route.isOpenGreen()); vo.setAspect(route.getAspect()); vo.setTurnBack(route.isTurnBack()); vo.setAtp(route.isAtp());