From ff2e0e6f7177e9ec4900afeeb2338979892ef0f9 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Thu, 21 Jan 2021 11:24:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9<=E8=BF=9B=E8=B7=AF?= =?UTF-8?q?=E4=BA=A4=E8=87=AA=E5=8A=A8=E6=8E=A7><=E8=BF=9B=E8=B7=AF?= =?UTF-8?q?=E6=94=B6=E4=BA=BA=E5=B7=A5=E6=8E=A7><=E5=8A=9E=E7=90=86?= =?UTF-8?q?=E5=BC=95=E5=AF=BC>=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=9B?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=95=E5=AF=BC=E4=BF=A1=E5=8F=B7=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E6=97=B6=E9=97=B4=E4=B8=BA30=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handler/SignalOperateHandler.java | 8 +- .../cbtc/ATS/service/AtsRouteService.java | 23 ++++- .../simulation/cbtc/CI/CiApiServiceImpl.java | 95 ++++++++++--------- .../cbtc/CI/service/RouteService.java | 6 ++ .../rtss/simulation/cbtc/data/map/Signal.java | 4 +- 5 files changed, 83 insertions(+), 53 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/SignalOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/SignalOperateHandler.java index 4d0017084..394c3f4b0 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/SignalOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/SignalOperateHandler.java @@ -117,8 +117,8 @@ public class SignalOperateHandler { * @param routeCodeList */ @OperateHandlerMapping(type = Operation.Type.Signal_Close_Auto_Setting) - public void setRouteHumanControl(Simulation simulation, List routeCodeList) { - this.atsRouteService.setRouteHumanControl(simulation, routeCodeList); + public void setRouteHumanControl(Simulation simulation, String signalCode, List routeCodeList) { + this.atsRouteService.setRouteHumanControl(simulation, signalCode, routeCodeList); } /** @@ -128,8 +128,8 @@ public class SignalOperateHandler { * @param routeCodeList */ @OperateHandlerMapping(type = Operation.Type.Signal_Open_Auto_Setting) - public void setRouteAtsControl(Simulation simulation, List routeCodeList) { - this.atsRouteService.setRouteAtsControl(simulation, routeCodeList); + public void setRouteAtsControl(Simulation simulation, String signalCode, List routeCodeList) { + this.atsRouteService.setRouteAtsControl(simulation, signalCode, routeCodeList); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsRouteService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsRouteService.java index 9c82af41e..f9f53df20 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsRouteService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsRouteService.java @@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.util.List; import java.util.Objects; @@ -35,32 +36,48 @@ public class AtsRouteService { * 进路收人工控 * * @param simulation + * @param signalCode * @param routeCodeList */ - public void setRouteHumanControl(Simulation simulation, List routeCodeList) { + public void setRouteHumanControl(Simulation simulation, String signalCode, List routeCodeList) { if (!CollectionUtils.isEmpty(routeCodeList)) { routeCodeList.forEach(routeCode -> { Route route = simulation.getRepository().getByCode(routeCode, Route.class); route.setAtsControl(false); }); + } else if (StringUtils.hasText(signalCode)) { + Signal signal = simulation.getRepository().getByCode(signalCode, Signal.class); + List routeList = signal.getRouteList(); + if (!CollectionUtils.isEmpty(routeList)) { + routeList.forEach(route -> route.setAtsControl(false)); + } } } /** * 进路交自动控 */ - public void setRouteAtsControl(Simulation simulation, List routeCodeList) { + public void setRouteAtsControl(Simulation simulation, String signalCode, List routeCodeList) { SimulationDataRepository repository = simulation.getRepository(); if (!CollectionUtils.isEmpty(routeCodeList)) { List routes = routeCodeList.stream().map(routeCode -> repository.getByCode(routeCode, Route.class)).collect(Collectors.toList()); if (repository.getConfig().isSignalHumanControlBeforeSetAtsControlOrCIAutoTrigger()) { Signal start = routes.get(0).getStart(); String startSignalCode = start.getCode(); - BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(routes.stream().allMatch(route-> route.getStart().getCode().equals(startSignalCode)), + BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(routes.stream().allMatch(route -> route.getStart().getCode().equals(startSignalCode)), "所选进路的始端信号机不同,处理逻辑未知"); BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(start.isHumanControl(), String.format("信号机[%s]需处于人工控状态", start.getCode())); } routes.forEach(route -> route.setAtsControl(true)); + } else if (StringUtils.hasText(signalCode)) { + Signal signal = repository.getByCode(signalCode, Signal.class); + if (repository.getConfig().isSignalHumanControlBeforeSetAtsControlOrCIAutoTrigger()) { + BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(signal.isHumanControl(), String.format("信号机[%s]需处于人工控状态", signal.getCode())); + } + List routeList = signal.getRouteList(); + if (!CollectionUtils.isEmpty(routeList)) { + routeList.forEach(route -> route.setAtsControl(true)); + } } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java index 93f108328..c155087ff 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java @@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.util.List; import java.util.Objects; @@ -371,51 +372,57 @@ public class CiApiServiceImpl implements CiApiService { public void setGuide(Simulation simulation, String signalCode, String routeCode) { SimulationDataRepository repository = simulation.getRepository(); MapConfig config = repository.getConfig(); - if (config.isGuideNeedRouteSettingFirst()) { - // 需要先办理进路 - if (Objects.isNull(signalCode)) { - throw new SimulationException(SimulationExceptionType.Illegal_Argument,"操作参数缺少信号机"); - } else { - Signal signal = repository.getByCode(signalCode, Signal.class); - if (!CollectionUtils.isEmpty(signal.getRouteList())) { // 是进路始端 - Route lockedRoute = signal.getLockedRoute(); - if (Objects.isNull(lockedRoute)) { // 没有已办理进路,异常 - throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL,"操作信号机没有已办理的进路"); - } else { // 有,开引导信号 - this.signalService.openGuideSignal(simulation, signal); - } - } - } - return; - } - if (routeCode != null) { - Route route = repository.getByCode(routeCode, Route.class); - if (route.isLock()) { - signalService.openGuideSignal(simulation, route.getStart()); - } else { - routeService.settingGuideRoute(simulation, route); - } - } else if (signalCode != null) { - Signal signal = repository.getByCode(signalCode, Signal.class); - if (signal.getLockedRoute() != null) { //如果有已锁闭进路 - signalService.openGuideSignal(simulation, signal); - } else if (!CollectionUtils.isEmpty(signal.getRouteList())) { //如果signal锁闭进路为null,筛选最合适的进路(直线进路>分叉进路>折返进路) - List collect = signal.getRouteList().stream() - .filter(r -> !r.isTurnBack() && CollectionUtils.isEmpty(r.getSwitchList())) - .collect(Collectors.toList()); - if (CollectionUtils.isEmpty(collect)) { - collect = signal.getRouteList().stream().filter(r -> !r.isTurnBack()).collect(Collectors.toList()); - } - if (CollectionUtils.isEmpty(collect)) { - collect = signal.getRouteList(); - } - Route route = collect.get(0); - routeService.settingGuideRoute(simulation, route); - } else { //如果信号机没有关联进路 - signalService.openGuideSignal(simulation, signal); - } + Signal signal; + Route route = null; + if (StringUtils.hasText(signalCode)) { + signal = repository.getByCode(signalCode, Signal.class); + } else if (StringUtils.hasText(routeCode)) { + route = repository.getByCode(routeCode, Route.class); + signal = route.getStart(); } else { - throw new SimulationException(SimulationExceptionType.Illegal_Argument,"操作参数缺少信号机或进路"); + throw BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.exception("signalCode和routeCode不能都为空"); + } + //条件检查 + if (config.isGuideNeedRouteSettingFirst()) { + List routeList = signal.getRouteList(); + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertCollectionNotEmpty(routeList, String.format("信号机[%s]非进路始端信号机", signal.getCode())); + if (route != null) { + BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(route.isLock(), String.format("进路[%s]未办理", route.getCode())); + } else { + BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotNull(signal.getLockedRoute(), String.format("信号机[%s]无已办理进路", signal.getCode())); + } + } + BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(signal.isClose(), String.format("信号机[%s]需处于关闭状态", signal.getCode())); + BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(signal.isApproachOccupy(), String.format("对%s开放引导操作失败,接近区段没有列车占用", signal.getName())); + //办理引导进路或开放引导信号 + if (config.isGuideNeedRouteSettingFirst()) { + signalService.openGuideSignal(simulation, signal); + } else { + if (route != null) { + if (route.isLock()) { + signalService.openGuideSignal(simulation, route.getStart()); + } else { + routeService.settingGuideRoute(simulation, route); + } + } else { + if (signal.getLockedRoute() != null) { //如果有已锁闭进路 + signalService.openGuideSignal(simulation, signal); + } else if (!CollectionUtils.isEmpty(signal.getRouteList())) { //如果signal锁闭进路为null,筛选最合适的进路(直线进路>分叉进路>折返进路) + List collect = signal.getRouteList().stream() + .filter(r -> !r.isTurnBack() && CollectionUtils.isEmpty(r.getSwitchList())) + .collect(Collectors.toList()); + if (CollectionUtils.isEmpty(collect)) { + collect = signal.getRouteList().stream().filter(r -> !r.isTurnBack()).collect(Collectors.toList()); + } + if (CollectionUtils.isEmpty(collect)) { + collect = signal.getRouteList(); + } + route = collect.get(0); + routeService.settingGuideRoute(simulation, route); + } else { //如果信号机没有关联进路 + signalService.openGuideSignal(simulation, signal); + } + } } } 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 aa933bbe4..9108ca716 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 @@ -153,6 +153,12 @@ public class RouteService { // 封锁状态 if (section.isBlockade()) { return new Route.CheckFailMessage(Route.CheckFailReason.SectionBlockade, section); + } else if (!CollectionUtils.isEmpty(section.getLogicList())) { + for (Section logicSection : section.getLogicList()) { + if (logicSection.isBlockade()) { + return new Route.CheckFailMessage(Route.CheckFailReason.SectionBlockade, logicSection); + } + } } // 进路内区段锁闭方向不是此进路方向 if ((section.isRouteLock() || section.isOverlapLock()) && diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Signal.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Signal.java index 0260fd838..af26a32bf 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Signal.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Signal.java @@ -371,7 +371,7 @@ public class Signal extends MayOutOfOrderDevice { } public void guideStart() { - this.guideRemain = 15 * 1000; + this.guideRemain = 30 * 1000; } public void guideInfinite() { @@ -391,7 +391,7 @@ public class Signal extends MayOutOfOrderDevice { */ public boolean isHumanControl() { if (!CollectionUtils.isEmpty(routeList)) { - return routeList.stream().noneMatch(Route::isAtsControl); + return routeList.stream().allMatch(route -> !route.isAtsControl() && !route.isCiControl()); } else { return false; } From 88331d6b721fcd9df3afcccd5700714736b6816e Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Thu, 21 Jan 2021 17:11:15 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=81=93=E5=B2=94=E6=B7=BB=E5=8A=A0=E6=95=85=E9=9A=9C=E5=8F=8A=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=9B=E4=BF=AE=E6=94=B9=E5=8C=BA=E6=95=85=E8=A7=A3?= =?UTF-8?q?=E5=92=8C=E9=81=93=E5=B2=94=E5=8C=BA=E6=95=85=E8=A7=A3=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATS/operation/Operation.java | 2 + .../handler/SectionOperateHandler.java | 6 -- .../rtss/simulation/cbtc/CI/CILogicLoop.java | 3 +- .../rtss/simulation/cbtc/CI/CiApiService.java | 2 - .../simulation/cbtc/CI/CiApiServiceImpl.java | 17 +---- .../cbtc/CI/service/SectionService.java | 53 +++---------- .../cbtc/CI/service/SwitchService.java | 27 +++---- .../cbtc/data/map/MayOutOfOrderDevice.java | 1 + .../simulation/cbtc/data/map/Section.java | 7 +- .../rtss/simulation/cbtc/data/map/Switch.java | 62 ++++++++++------ .../cbtc/data/status/SwitchStatus.java | 25 +++---- .../data/storage/device/StorageSwitch.java | 12 --- .../cbtc/data/vo/SwitchStatusVO.java | 7 +- .../cbtc/data/vr/VirtualRealitySwitch.java | 74 +++++++++++-------- 14 files changed, 128 insertions(+), 170 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java index 9d3e7a9ca..e26983fc4 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java @@ -75,6 +75,8 @@ public class Operation { Switch_Force_Turn, /** 道岔钩锁*/ Switch_Hook_Lock, + /** 道岔强解 */ + Switch_Force_Unlock, //--------------------------- 区段 --------------------------- /** 封锁 */ diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/SectionOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/SectionOperateHandler.java index bb79cd113..099418273 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/SectionOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/SectionOperateHandler.java @@ -112,10 +112,4 @@ public class SectionOperateHandler { this.atsSectionService.confirmAxleValid(simulation, section); } - /**强解*/ - @OperateHandlerMapping(type = Operation.Type.Section_Force_Unlock) - public void forceUnlock(Simulation simulation, String sectionCode) { - this.ciApiService.sectionForceUnlock(simulation, sectionCode); - } - } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CILogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CILogicLoop.java index e994e1489..8b2ecb9d6 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CILogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CILogicLoop.java @@ -291,9 +291,9 @@ public class CILogicLoop { Switch.SwitchFault fault = (Switch.SwitchFault) aSwitch.getFault(); if (fault != null) { - aSwitch.setSplit(true); switch (fault) { case SPLIT: + case SQUEEZE: break; case NORMAL_SPLIT: { VirtualRealitySwitch virtualSwitch = aSwitch.getVirtualSwitch(); @@ -307,7 +307,6 @@ public class CILogicLoop { } } } else { - aSwitch.setSplit(false); VirtualRealitySwitch virtualSwitch = aSwitch.getVirtualSwitch(); aSwitch.apply(virtualSwitch.isNormal(), virtualSwitch.isReverse()); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiService.java index 33b121acf..e383f10b6 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiService.java @@ -164,8 +164,6 @@ public interface CiApiService { */ void sectionFaultUnlock(Simulation simulation, String sectionCode); - void sectionForceUnlock(Simulation simulation, String sectionCode); - /** * 区故解 * @param simulation diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java index c155087ff..c5078bfdc 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java @@ -207,20 +207,6 @@ public class CiApiServiceImpl implements CiApiService { @Override public void sectionFaultUnlock(Simulation simulation, String sectionCode) { - Section section = simulation.getRepository().getByCode(sectionCode, Section.class); - List lockedRouteList = simulation.getRepository().queryAllLockedRoute(); - Route lockedRoute = null; - for (Route route : lockedRouteList) { - if (route.isRouteSection(section)) { - lockedRoute = route; - break; - } - } - this.sectionService.sectionFaultUnlock(simulation, section, lockedRoute); - } - - @Override - public void sectionForceUnlock(Simulation simulation, String sectionCode) { Section section = simulation.getRepository().getByCode(sectionCode, Section.class); List lockedRouteList = simulation.getRepository().queryAllLockedRoute(); Route lockedRoute = null; @@ -230,7 +216,7 @@ public class CiApiServiceImpl implements CiApiService { break; } } - this.sectionService.sectionForceUnlock(simulation, section, lockedRoute); + this.sectionService.sectionFaultUnlock(simulation, section, lockedRoute); } @Override @@ -481,6 +467,7 @@ public class CiApiServiceImpl implements CiApiService { @Override public void switchForceTurn(Simulation simulation, String switchCode, Boolean normal) { Switch aSwitch = simulation.getRepository().getByCode(switchCode, Switch.class); + BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(aSwitch.isSectionOccupied(), "道岔未被占用,不能使用强转"); BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(!aSwitch.isLocked(), String.format("道岔[%s]锁闭,无法转动", aSwitch.getCode())); VirtualRealitySwitch vrSwitch = aSwitch.getVirtualSwitch(); if (normal == null) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/SectionService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/SectionService.java index df9e2aad3..47c44e53b 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/SectionService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/SectionService.java @@ -4,8 +4,6 @@ import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.constant.SimulationModule; import club.joylink.rtss.simulation.cbtc.data.map.Route; import club.joylink.rtss.simulation.cbtc.data.map.Section; -import club.joylink.rtss.simulation.cbtc.exception.SimulationException; -import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -26,14 +24,13 @@ public class SectionService { /** * 封锁(封锁后,包含区段的进路不能排列) - * @param section */ public void blockade(Section section) { // if(section.isRouteLock() || section.isOverlapLock()) { // log.info(String.format("区段[%s(%s)]进路锁闭,不能封锁", section.getName(), section.getCode())); // return; // } - if(!section.isBlockade()) { + if (!section.isBlockade()) { section.setBlockade(true); if (!section.isCross() && !CollectionUtils.isEmpty(section.getLogicList())) { section.getLogicList().forEach(logic -> logic.setBlockade(true)); @@ -43,10 +40,9 @@ public class SectionService { /** * 解封 - * @param section */ public void unblock(Section section) { - if(section.isBlockade()) { + if (section.isBlockade()) { section.setBlockade(false); if (!section.isCross() && !CollectionUtils.isEmpty(section.getLogicList())) { section.getLogicList().forEach(logic -> logic.setBlockade(false)); @@ -56,33 +52,8 @@ public class SectionService { /** * 区故解 - * @param simulation - * @param section - * @param route */ public void sectionFaultUnlock(Simulation simulation, Section section, Route route) { - if (Objects.nonNull(route) && route.isApproachLock()) { // 进路接近锁闭 - // 关闭进路始端信号机 - this.signalService.close(simulation, route.getStart()); - // 区段延时解锁 - section.setDelayTime(route.getDelayReleaseTime() * 1000); - } else { // 解锁 - if (Objects.nonNull(route)) { - if (route.isOpen()) { - this.signalService.close(simulation, route.getStart()); - } else if (route.isLock()){ - throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL, - "延时解锁中"); - } - } - section.faultUnlock(); - if(section.isShowLogic()){ - section.getLogicList().forEach(ls -> ls.faultUnlock()); - } - } - } - - public void sectionForceUnlock(Simulation simulation, Section section, Route route) { if (route != null) { if (route.isOpen()) { signalService.close(simulation, route.getStart()); @@ -90,19 +61,23 @@ public class SectionService { if (route.isApproachLock()) { // 区段延时解锁 section.setDelayTime(route.getDelayReleaseTime() * 1000); - if(section.isShowLogic()){ + if (section.isShowLogic()) { section.getLogicList().forEach(ls -> ls.setDelayTime(route.getDelayReleaseTime() * 1000)); } return; + } else { + route.setLock(false); } } - section.forceUnlocking(); - if(section.isShowLogic()){ - section.getLogicList().forEach(ls -> ls.forceUnlocking()); + section.faultUnlock(); + if (section.isShowLogic()) { + section.getLogicList().forEach(Section::faultUnlock); } } + /** * 区段延时区故解 + * * @param simulation * @param section */ @@ -114,7 +89,7 @@ public class SectionService { List routeList = simulation.getRepository().queryAllLockedRoute(); Route lockedRoute = null; for (Route route : routeList) { - if (route.isRouteSection(section)) { + if (route.containSection(section)) { lockedRoute = route; break; } @@ -123,11 +98,7 @@ public class SectionService { lockedRoute.setLock(false); this.signalService.close(simulation, lockedRoute.getStart()); } - if(section.isFaultLock()){ - section.faultUnlock(); - }else{ - section.forceUnlocking(); - } + section.faultUnlock(); section.setDelayTime(0); } else { section.setDelayTime(remainTime); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/SwitchService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/SwitchService.java index d1c86b046..7fe9a4171 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/SwitchService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/service/SwitchService.java @@ -8,8 +8,6 @@ import club.joylink.rtss.simulation.cbtc.data.map.Route; import club.joylink.rtss.simulation.cbtc.data.map.Switch; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySwitch; import club.joylink.rtss.simulation.cbtc.event.SimulationDeviceControlEvent; -import club.joylink.rtss.simulation.cbtc.exception.SimulationException; -import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; @@ -129,22 +127,19 @@ public class SwitchService { * @param route */ public void switchFaultUnlock(Simulation simulation, Switch aSwitch, Route route) { - if (Objects.nonNull(route) && route.isApproachLock()) { // 进路接近锁闭 - // 关闭进路始端信号机 - this.signalService.close(simulation, route.getStart()); - // 区段延时解锁 - aSwitch.setDelayTime(route.getDelayReleaseTime()*1000); - } else { // 解锁 - if (Objects.nonNull(route)) { - if (route.isOpen()) { - this.signalService.close(simulation, route.getStart()); - } else if (route.isLock()){ - throw new SimulationException(SimulationExceptionType.Operation_Handle_FAIL, - "延时解锁中"); - } + if (route != null) { + if (route.isOpen()) { + signalService.close(simulation, route.getStart()); + } + if (route.isApproachLock()) { + // 区段延时解锁 + aSwitch.setDelayTime(route.getDelayReleaseTime() * 1000); + return; + } else { + route.setLock(false); } - aSwitch.sectionFaultUnlock(); } + aSwitch.sectionFaultUnlock(); } public void delayUnlock(Simulation simulation, Switch aSwitch) { diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MayOutOfOrderDevice.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MayOutOfOrderDevice.java index 5a96832c5..d9ce09344 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MayOutOfOrderDevice.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/MayOutOfOrderDevice.java @@ -31,6 +31,7 @@ public abstract class MayOutOfOrderDevice extends MapNamedElement { @JsonSubTypes.Type(value = Switch.SwitchFault.class, name = "Switch$SwitchFault$1"), @JsonSubTypes.Type(value = Switch.SwitchFault.class, name = "Switch$SwitchFault$2"), @JsonSubTypes.Type(value = Switch.SwitchFault.class, name = "Switch$SwitchFault$3"), + @JsonSubTypes.Type(value = Switch.SwitchFault.class, name = "Switch$SwitchFault$4"), @JsonSubTypes.Type(value = Section.AxleFault.class, name = "Section$AxleFault$1"), @JsonSubTypes.Type(value = Stand.Fault.class, name = "Stand$Fault$1"), @JsonSubTypes.Type(value = Stand.Fault.class, name = "Stand$Fault$2"), diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java index 964669a94..01e13e126 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java @@ -66,11 +66,6 @@ public class Section extends MayOutOfOrderDevice { */ private boolean axleCounter; - /** - * 是否岔心 - */ - private boolean crossing; - /** * 虚拟真实计轴器 */ @@ -91,7 +86,7 @@ public class Section extends MayOutOfOrderDevice { private Section parent; /** - * 关联的逻辑区段列表 + * 岔心关联的道岔计轴区段;道岔计轴区段关联的道岔区段;物理区段关联的逻辑区段 */ private List
logicList; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Switch.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Switch.java index 3efbd6db4..5c83e3fcf 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Switch.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Switch.java @@ -94,11 +94,6 @@ public class Switch extends MayOutOfOrderDevice { */ private int delayTime; - /** - * 是否失表故障 - */ - private boolean split; - /** * 无状态 */ @@ -116,14 +111,11 @@ public class Switch extends MayOutOfOrderDevice { this.normalPosition = true; this.reversePosition = false; this.delayTime = 0; - this.split = false; this.noStatus = false; } /** * 是否被锁闭 - * - * @return */ public boolean isLocked() { return this.singleLock || this.routeLock || this.overlapLock || this.isFpLock(); @@ -131,8 +123,6 @@ public class Switch extends MayOutOfOrderDevice { /** * 是否道岔区段被占用 - * - * @return */ public boolean isSectionOccupied() { return this.a.isOccupied(); @@ -140,9 +130,6 @@ public class Switch extends MayOutOfOrderDevice { /** * 道岔是否在定/反位上 - * - * @param normal - * @return */ public boolean isOnPosition(boolean normal) { return (this.normalPosition && normal) || (!normal && this.reversePosition); @@ -150,9 +137,6 @@ public class Switch extends MayOutOfOrderDevice { /** * 是否道岔关联的区段 - * - * @param section - * @return */ public boolean isRelatedSection(Section section) { return Objects.equals(this.a.getCode(), section.getCode()) || @@ -286,7 +270,7 @@ public class Switch extends MayOutOfOrderDevice { if (section.isSwitchTrack() && Objects.equals(section.getRelSwitch().getC(), section)) { // 是另一个道岔的C区段,则是联动道岔 return section.getRelSwitch(); } - if (Objects.nonNull(section.getParent()) && section.getParent().isCrossing()) { + if (Objects.nonNull(section.getParent()) && section.getParent().isCross()) { if (Objects.equals(section.getRightSection(), this.getC())) { return section.getLeftSection().getRelSwitch(); } else if (Objects.equals(section.getLeftSection(), this.getC())) { @@ -380,6 +364,19 @@ public class Switch extends MayOutOfOrderDevice { return List.of(a, b, c); } + /** + * 是否失表 + */ + public boolean isLoss() { + return !this.isNormalPosition() && !this.isReversePosition(); + } + + public void forceUnlock() { + this.routeLock = false; + this.overlapLock = false; + this.fpLock = false; + } + public enum SwitchFault implements DeviceFault { /** * 道岔失表 @@ -428,10 +425,33 @@ public class Switch extends MayOutOfOrderDevice { aSwitch.setReversePosition(false); return true; } + }, + + /** + * 挤岔 + */ + SQUEEZE { + @Override + public boolean apply(MayOutOfOrderDevice device) { + Switch aSwitch = (Switch) device; + VirtualRealitySwitch vrSwitch = aSwitch.getVirtualSwitch(); + if (VirtualRealitySwitch.Fault.SQUEEZE.apply(vrSwitch)) { + aSwitch.setFault(this); + aSwitch.setNormalPosition(false); + aSwitch.setReversePosition(false); + return true; + } + return false; + } + + @Override + public void fix(MayOutOfOrderDevice device) { + super.fix(device); + Switch aSwitch = (Switch) device; + VirtualRealitySwitch vrSwitch = aSwitch.getVirtualSwitch(); + VirtualRealitySwitch.Fault.SQUEEZE.fix(vrSwitch); + vrSwitch.startSetting(true); + } } } - - public boolean isLoss() { - return !this.isNormalPosition() && !this.isReversePosition(); - } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SwitchStatus.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SwitchStatus.java index e57b75f3a..f14ae4b61 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SwitchStatus.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SwitchStatus.java @@ -55,11 +55,6 @@ public class SwitchStatus extends DeviceStatus { @JsonDeserialize(using = Boolean2NumDeserializer.class) private boolean reversePosition; - /** 是否故障失表了 */ - @JsonSerialize(using = Boolean2NumSerializer.class) - @JsonDeserialize(using = Boolean2NumDeserializer.class) - private boolean split; - /** * 延时区段故障解锁剩余时间,单位s */ @@ -68,6 +63,11 @@ public class SwitchStatus extends DeviceStatus { @JsonSerialize(using = Boolean2NumSerializer.class) private boolean noStatus; + /** + * 故障 + */ + private Switch.SwitchFault fault; + public SwitchStatus(Switch aSwitch) { super(aSwitch.getCode(), aSwitch.getDeviceType()); this.singleLock = aSwitch.isSingleLock(); @@ -77,7 +77,6 @@ public class SwitchStatus extends DeviceStatus { this.overlapLock = aSwitch.isOverlapLock(); this.normalPosition = aSwitch.isNormalPosition(); this.reversePosition = aSwitch.isReversePosition(); - this.split = aSwitch.isSplit(); this.delayTime = aSwitch.getDelayTime() / 1000; this.noStatus = aSwitch.isNoStatus(); } @@ -122,11 +121,6 @@ public class SwitchStatus extends DeviceStatus { status.setReversePosition(this.reversePosition); change = true; } - if (!Objects.equals(this.split, aSwitch.isSplit())) { - this.split = aSwitch.isSplit(); - status.setSplit(this.split); - change = true; - } int dt = aSwitch.getDelayTime() / 1000; if (dt != this.delayTime) { this.delayTime = dt; @@ -138,21 +132,26 @@ public class SwitchStatus extends DeviceStatus { status.setNoStatus(this.noStatus); change = true; } + if (!Objects.equals(this.fault, aSwitch.getFault())) { + this.fault = (Switch.SwitchFault) aSwitch.getFault(); + status.setFault(this.fault != null ? this.fault.name() : null); + change = true; + } return change; } @Override public DeviceStatusVO convert2VO(MapElement device) { SwitchStatusVO statusVO = new SwitchStatusVO((Switch) device); - statusVO.setSplit(split); statusVO.setReversePosition(reversePosition); statusVO.setNormalPosition(normalPosition); statusVO.setOverlapLock(overlapLock); statusVO.setRouteLock(routeLock); - statusVO.setFpLock(this.fpLock); + statusVO.setFpLock(fpLock); statusVO.setBlockade(blockade); statusVO.setSingleLock(singleLock); statusVO.setNoStatus(noStatus); + statusVO.setFault(this.fault != null ? this.fault.name() : null); return statusVO; } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/storage/device/StorageSwitch.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/storage/device/StorageSwitch.java index 80f1943eb..c64217e46 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/storage/device/StorageSwitch.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/storage/device/StorageSwitch.java @@ -79,13 +79,6 @@ public class StorageSwitch extends StorageMayOutOfOrderDevice { */ private Integer delayTime; - /** - * 是否失表 - */ - @JsonSerialize(using = Boolean2NumSerializer.class) - @JsonDeserialize(using = Boolean2NumDeserializer.class) - private Boolean split; - @JsonSerialize(using = Boolean2NumSerializer.class) @JsonDeserialize(using = Boolean2NumDeserializer.class) private Boolean noStatus; @@ -136,10 +129,6 @@ public class StorageSwitch extends StorageMayOutOfOrderDevice { change = true; storageSwitch.setDelayTime(s.getDelayTime()); } - if (s.isSplit()) { - change = true; - storageSwitch.setSplit(s.isSplit()); - } if (s.isNoStatus()) { change = true; storageSwitch.setNoStatus(s.isNoStatus()); @@ -166,7 +155,6 @@ public class StorageSwitch extends StorageMayOutOfOrderDevice { s.setNormalPosition(normalPosition != null ? normalPosition : true); s.setReversePosition(reversePosition != null ? reversePosition : false); s.setDelayTime(delayTime != null ? delayTime : 0); - s.setSplit(split != null ? split : false); s.setNoStatus(noStatus != null ? noStatus : false); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SwitchStatusVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SwitchStatusVO.java index 154a685ab..bbba6e675 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SwitchStatusVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SwitchStatusVO.java @@ -46,16 +46,15 @@ public class SwitchStatusVO extends DeviceStatusVO { @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean reversePosition; - /** 是否故障失表了 */ - @JsonSerialize(using = Boolean2NumSerializer.class) - private Boolean split; - @JsonInclude private Integer delayTime; @JsonSerialize(using = Boolean2NumSerializer.class) private Boolean noStatus; + @JsonInclude + private String fault; + public SwitchStatusVO(Switch aSwitch) { super(aSwitch.getCode(), aSwitch.getDeviceType()); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealitySwitch.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealitySwitch.java index 660b60b94..62a5218d8 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealitySwitch.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vr/VirtualRealitySwitch.java @@ -14,20 +14,30 @@ import java.util.Objects; @Setter public class VirtualRealitySwitch extends VirtualRealityDevice { - /** 虚拟道岔转换时间 */ + /** + * 虚拟道岔转换时间 + */ private float settingTime; - /** 是否定位 */ + /** + * 是否定位 + */ private boolean normal; - /** 是否反位 */ + /** + * 是否反位 + */ private boolean reverse; // -------------运行逻辑控制参数------------- - /** 是否正在转换 */ + /** + * 是否正在转换 + */ private boolean setting; - /** 道岔转换剩余时间 */ + /** + * 道岔转换剩余时间 + */ private Float remainTime; /** @@ -35,10 +45,12 @@ public class VirtualRealitySwitch extends VirtualRealityDevice { */ private int timeoutRemain; - /** 道岔转换指令——是否转动到定位 */ + /** + * 道岔转换指令——是否转动到定位 + */ private boolean toNormal; - /*private SwitchFault fault;*/ + private Fault fault; public VirtualRealitySwitch(String code, String name) { super(code, name, MapElement.DeviceType.SWITCH); @@ -76,7 +88,6 @@ public class VirtualRealitySwitch extends VirtualRealityDevice { /** * 开始转换 - * @param toNormal */ public void startSetting(boolean toNormal) { this.remainTime = this.settingTime; @@ -92,11 +103,10 @@ public class VirtualRealitySwitch extends VirtualRealityDevice { this.setting = false; this.remainTime = null; this.timeoutRemain = 0; - /*if (this.isFault()) { - // 如果故障 + if (Fault.SQUEEZE.equals(this.fault)) { return; - }*/ - if(this.toNormal) { + } + if (this.toNormal) { this.normal = true; this.reverse = false; } else { @@ -107,6 +117,7 @@ public class VirtualRealitySwitch extends VirtualRealityDevice { /** * 是否失表 + * * @return */ public boolean isLoss() { @@ -117,10 +128,10 @@ public class VirtualRealitySwitch extends VirtualRealityDevice { * 失去表示 */ public void loss() { - if(this.normal) { + if (this.normal) { this.normal = false; } - if(this.reverse) { + if (this.reverse) { this.reverse = false; } } @@ -136,30 +147,29 @@ public class VirtualRealitySwitch extends VirtualRealityDevice { return this.isSetting() && Objects.equals(toNormal, this.toNormal); } - /*public enum SwitchFault implements DeviceFault { - *//** 道岔挤岔 *//* - SPLIT{ + public enum Fault { + /** + * 挤岔 + */ + SQUEEZE { @Override - public boolean applyOn(VirtualRealityDevice device) { - VirtualRealitySwitch vrSwitch = (VirtualRealitySwitch) device; - if (Objects.equals(vrSwitch.getFault(), SPLIT)) { + public boolean apply(VirtualRealitySwitch vrSwitch) { + if (this.equals(vrSwitch.getFault())) return false; - } - vrSwitch.setFault(SPLIT); - if (!vrSwitch.isLoss()) { - vrSwitch.setToNormal(vrSwitch.isNormal()); - } - vrSwitch.loss(); + vrSwitch.setFault(this); + vrSwitch.setNormal(false); + vrSwitch.setReverse(false); return true; } + }; - @Override - public void clearFrom(VirtualRealityDevice device) { - VirtualRealitySwitch vrSwitch = (VirtualRealitySwitch) device; + public abstract boolean apply(VirtualRealitySwitch vrSwitch); + + public void fix(VirtualRealitySwitch vrSwitch) { + if (this.equals(vrSwitch.getFault())) { vrSwitch.setFault(null); - vrSwitch.endSetting(); } - }, - }*/ + } + } } From 5eb20f669c93a0f5078fc2e8f674696dc84cec2a Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Thu, 21 Jan 2021 19:30:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8F=96=E6=B6=88=E8=BF=9B=E8=B7=AF?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E5=8F=96=E6=B6=88=E8=BF=BD=E8=B8=AA=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=EF=BC=9B=E5=B2=94=E5=BF=83=E5=85=B3=E8=81=94=E5=8C=BA?= =?UTF-8?q?=E6=AE=B5=E9=94=81=E9=97=AD=E6=97=B6=EF=BC=8C=E5=B2=94=E5=BF=83?= =?UTF-8?q?=E5=8C=BA=E6=AE=B5=E4=B9=9F=E9=94=81=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simulation/cbtc/CI/CiApiServiceImpl.java | 2 +- .../cbtc/CI/service/RouteService.java | 13 +++++++++++-- .../rtss/simulation/cbtc/data/map/Section.java | 18 ++++++++++++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java index c5078bfdc..6a4801ced 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiApiServiceImpl.java @@ -192,7 +192,7 @@ public class CiApiServiceImpl implements CiApiService { Route route = simulation.getRepository().getByCode(routeCode, Route.class); SimulationDataRepository repository = simulation.getRepository(); TrainInfo firstTrain = repository.querySignalApproachedFirstTrain(route.getStart()); - if (route.isApproachLock() && Objects.nonNull(firstTrain) && !firstTrain.isStop()) { // 接近锁闭,总人解 + if (route.isApproachLock() /*&& Objects.nonNull(firstTrain) && !firstTrain.isStop()*/) { // 接近锁闭,总人解 this.routeService.humanCancel(simulation, route); } else { this.routeService.cancelNoApproachLock(simulation, 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 7d1ca6ab4..8e2474f20 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 @@ -652,7 +652,10 @@ public class RouteService { if (route.isLock()) { // 进路锁闭 // 取消进路逻辑 if (simulation.getRepository().getConfig().isCancelAtsControlOfAllRoutesWhenCancelRoute()) { - route.getStart().getRouteList().forEach(aRoute -> aRoute.setAtsControl(false)); + route.getStart().getRouteList().forEach(aRoute -> { + aRoute.setAtsControl(false); + aRoute.setCiControl(false); + }); } else { route.setAtsControl(false); } @@ -730,7 +733,10 @@ public class RouteService { String.format("正在延时解锁")); } if (simulation.getRepository().getConfig().isCancelAtsControlOfAllRoutesWhenCancelRoute()) { - route.getStart().getRouteList().forEach(aRoute -> aRoute.setAtsControl(false)); + route.getStart().getRouteList().forEach(aRoute -> { + aRoute.setAtsControl(false); + aRoute.setCiControl(false); + }); } else { route.setAtsControl(false); } @@ -1064,6 +1070,9 @@ public class RouteService { } else { if (section.isSwitchTrack()) { // 如果是道岔区段,解锁道岔 section.routeUnlocking(right); + if (section.getParent() != null && section.getParent().isCross()) { + section.getParent().routeUnlocking(right); + } relSwitch.routeUnlock(); relSwitch.overlapUnLock(); // 侧防解锁 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java index 01e13e126..0b67496f9 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/Section.java @@ -530,10 +530,13 @@ public class Section extends MayOutOfOrderDevice { /** * 进路锁闭(连同逻辑区段) - * - * @param right */ public void routeLocking(boolean right) { + //岔心锁闭 + if (this.parent != null && this.parent.isCross()) { + this.parent.setRouteLock(true); + this.parent.setLockRight(right); + } this.routeLock = true; this.lockRight = right; if (!CollectionUtils.isEmpty(this.logicList)) { @@ -547,6 +550,12 @@ public class Section extends MayOutOfOrderDevice { * @param right */ public void routeUnlocking(boolean right) { + //岔心锁闭 + if (this.parent != null && this.parent.isCross()) { + this.parent.setRouteLock(false); + this.parent.setOverlapLock(false); + this.parent.setLockRight(false); + } if (this.isRouteLockOn(right)) { this.routeLock = false; this.overlapLock = false; @@ -570,6 +579,11 @@ public class Section extends MayOutOfOrderDevice { * 进路延续保护(连同逻辑区段) */ public void overlapLocking(boolean lockRight) { + //封锁岔心 + if (this.parent != null && this.parent.isCross()) { + this.parent.setOverlapLock(true); + this.parent.setLockRight(lockRight); + } this.overlapLock = true; this.lockRight = lockRight; if (!CollectionUtils.isEmpty(this.logicList)) {