From 18cfe999057ed83dc2abcbff8ffcda176fa8e542 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Thu, 26 Oct 2023 15:35:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=BD=A6=E8=B6=8A=E8=BF=87=E8=BF=9B?= =?UTF-8?q?=E8=B7=AF=E5=A7=8B=E7=AB=AF=E4=BF=A1=E5=8F=B7=E6=9C=BA=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E4=BF=A1=E5=8F=B7=E6=9C=BA=E5=8D=B3=E5=88=BB=E9=99=8D?= =?UTF-8?q?=E7=BA=A7=EF=BC=88=E5=85=B3=E9=97=AD=E7=BA=A7=EF=BC=89=EF=BC=9B?= =?UTF-8?q?=E8=BF=9B=E8=B7=AF=E5=BB=B6=E6=97=B6=E8=A7=A3=E9=94=81=E7=9A=84?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E8=BF=9B=E8=B7=AF=E5=8D=B3=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=BA=E4=BA=BA=E5=B7=A5=E6=A8=A1=E5=BC=8F=EF=BC=9B=E5=BB=B6?= =?UTF-8?q?=E7=BB=AD=E4=BF=9D=E6=8A=A4=E4=B8=AD=E7=9A=84=E9=81=93=E5=B2=94?= =?UTF-8?q?=E8=AE=BE=E4=B8=BA=E5=BB=B6=E7=BB=AD=E4=BF=9D=E6=8A=A4=E9=94=81?= =?UTF-8?q?=E9=97=AD=EF=BC=9B=E8=BF=9B=E8=B7=AF=E5=A2=9E=E5=8A=A0=E5=8A=9E?= =?UTF-8?q?=E7=90=86=E6=88=90=E5=8A=9F=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../club/joylink/rtss/simulation/cbtc/CI/CiLogic.java | 2 +- .../simulation/cbtc/CI/device/CiRouteService.java | 10 ++++++---- .../joylink/rtss/simulation/cbtc/data/map/Route.java | 11 ++++++++++- .../rtss/simulation/cbtc/data/status/RouteStatus.java | 11 +++++++++++ .../rtss/simulation/cbtc/data/vo/RouteStatusVO.java | 3 +++ 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiLogic.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiLogic.java index a46bfbcea..e88e0bc15 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiLogic.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiLogic.java @@ -15,7 +15,6 @@ import club.joylink.rtss.simulation.cbtc.data.map.*; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; import java.util.List; import java.util.Objects; @@ -190,6 +189,7 @@ public class CiLogic { routeService.routeSettingProcess(simulation, route); } if (route.isNormalUnlock()) { + ciService.interlockCheck(simulation, route); //南铁院叶老师提出列车越过始端信号机后灯座应该是红色 routeService.trainUnlockRoute(simulation, route); } if (route.isLock()) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java index 6eab1e18a..4398d75f9 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java @@ -244,7 +244,7 @@ public class CiRouteService { if (!config.isRouteSettingNoFail()) { if (simulation.getSystemTime().isAfter(route.getSettingStartTime().plusSeconds(SimulationConstants.ROUTE_SETTING_TIMEOUT))) { log.info("进路[{}]办理超时,取消办理2", route.debugStr()); - route.settingOver(); + route.settingOver(false); return; } } @@ -277,12 +277,12 @@ public class CiRouteService { if (config.isRailway()) { if (route.isGuideSetting() && route.getStart().isGuideAspect() || !route.getStart().isDefaultAspect()) { - route.settingOver(); + route.settingOver(true); } } else if ((route.getSettedAspect().equals(route.getStart().getAspect())) || (route.isGuideSetting() && route.getStart().isGuideAspect())) { log.debug("进路[{}]信号开放,办理结束", route.debugStr()); - route.settingOver(); + route.settingOver(true); } } else { //由远及近办理进路 @@ -296,7 +296,7 @@ public class CiRouteService { } //最近的一条进路已经锁闭 if (multiRouteAspects.get(0).getRoute().isLock()) { - route.settingOver(); + route.settingOver(true); } } } @@ -416,6 +416,7 @@ public class CiRouteService { public void delayUnlockStart(Simulation simulation, Route route, DelayUnlockDevice device) { device.delayUnlockStart(route,simulation.getRepository().getConfig()); route.setDelayUnlockDevice(device); + route.setAtsControl(false); //南铁院叶老师:延时解锁开始的同时信号机应该红名(南京二号线) this.signalControlService.tryControlSignalAspectAccordingLevel(simulation, route.getStart(), route.getStart().getDefaultAspect()); } @@ -658,6 +659,7 @@ public class CiRouteService { if (!switchElement.getASwitch().ciUse(switchElement.isNormal())) { return; } + switchElement.getASwitch().overlapLock(); } // 延续保护位置转动 boolean onPos = this.switchControlService.ensureSwitchPosCurrent(simulation, sectionPath.getSwitchList(), false); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Route.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Route.java index 332bff805..092cc882d 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Route.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Route.java @@ -253,6 +253,11 @@ public class Route extends MapNamedElement { */ private String tripNumber; + /** + * 办理成功。目前仅用于南京二显示成功信息 + */ + private Boolean setSuccess; + @Override public void reset() { this.atsControl = true; @@ -268,6 +273,7 @@ public class Route extends MapNamedElement { this.train = null; this.checkConflict = false; this.settedAspect = null; + this.setSuccess = null; } /** @@ -595,6 +601,7 @@ public class Route extends MapNamedElement { this.setSetting(true); this.settingStartTime = systemTime; this.setGuideSetting(false); + this.setSuccess = null; } public void startGuideSetting(LocalDateTime systemTime) { @@ -602,13 +609,15 @@ public class Route extends MapNamedElement { this.setSetting(true); this.settingStartTime = systemTime; this.setGuideSetting(true); + this.setSuccess = null; } - public void settingOver() { + public void settingOver(boolean success) { this.setSetting(false); if (this.overlap != null) { this.overlap.settingOver(); } + this.setSuccess = success; } public void setLock(boolean lock) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/RouteStatus.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/RouteStatus.java index 7d3601fd7..949fad38e 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/RouteStatus.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/RouteStatus.java @@ -68,6 +68,10 @@ public class RouteStatus extends DeviceStatus { @JsonDeserialize(using = Boolean2NumDeserializer.class) private boolean checkConflict; + @JsonSerialize(using = Boolean2NumSerializer.class) + @JsonDeserialize(using = Boolean2NumDeserializer.class) + private Boolean setSuccess; + public RouteStatus(Route route) { super(route.getCode(), route.getDeviceType()); this.atsControl = route.isAtsControl(); @@ -80,6 +84,7 @@ public class RouteStatus extends DeviceStatus { this.canceling = route.isDelayUnlocking(); this.normalUnlock = route.isNormalUnlock(); this.checkConflict = route.isCheckConflict(); + this.setSuccess = route.getSetSuccess(); } @Override @@ -95,6 +100,7 @@ public class RouteStatus extends DeviceStatus { statusVO.setCanceling(canceling); statusVO.setNormalUnlock(normalUnlock); statusVO.setCheckConflict(checkConflict); + statusVO.setSetSuccess(setSuccess); return statusVO; } @@ -153,6 +159,11 @@ public class RouteStatus extends DeviceStatus { status.setCheckConflict(this.checkConflict); change = true; } + if (!Objects.equals(this.setSuccess, route.getSetSuccess())) { + this.setSuccess = route.getSetSuccess(); + status.setSetSuccess(this.setSuccess); + change = true; + } // if (!Objects.equals(this.conflict, route.isConflict())) { // this.conflict = route.isConflict(); // this.conflictDesc = route.getConflictDesc(); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/RouteStatusVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/RouteStatusVO.java index 52b10a8f1..80f01286f 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/RouteStatusVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/RouteStatusVO.java @@ -53,6 +53,9 @@ public class RouteStatusVO extends DeviceStatusVO { @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean checkConflict; + @JsonSerialize(using = Boolean2NumSerializer.class) + private Boolean setSuccess; + public RouteStatusVO(Route route) { super(route.getCode(), route.getDeviceType()); }