From aaf7582086c976869e69c1c1fcbd5c850c344a95 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Mon, 29 Nov 2021 13:38:31 +0800 Subject: [PATCH 01/16] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=AC=E5=B7=A5?= =?UTF-8?q?=E9=99=A2=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/club/joylink/rtss/constants/Project.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/club/joylink/rtss/constants/Project.java b/src/main/java/club/joylink/rtss/constants/Project.java index 0d36bbfdd..ee014ac82 100644 --- a/src/main/java/club/joylink/rtss/constants/Project.java +++ b/src/main/java/club/joylink/rtss/constants/Project.java @@ -36,12 +36,14 @@ public enum Project { ZZWWTEST, /** 中航锐创(第三方教学合作,第三方登录) */ RICHOR, - /** 中航锐创(实训室,连设备,设备登录) */ + /** 中航锐创(义乌现场)(实训室,连设备,设备登录) */ RICHOR_JOINT, /** 上饶沙盘 */ SR_SANDBOX, /** 江西工贸 */ JXGM, + /** 扬工院 */ + RICHOR_YGY, ; public static boolean isDefault(Project project) { From 4705b55abac02081432b9d2b2d6d2bc8bc883a48 Mon Sep 17 00:00:00 2001 From: Jade Date: Mon, 29 Nov 2021 16:34:03 +0800 Subject: [PATCH 02/16] =?UTF-8?q?=E5=8D=97=E4=BA=AC=E4=BA=8C=20=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../training/generatornew/base/SectionGeneratorNew.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java index 5f26c4c73..c53dccee0 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java @@ -115,7 +115,9 @@ public class SectionGeneratorNew implements GeneratorNew { // 设置区段故障锁闭(这只是区故解的一种情况,后面再补其他情况) // section.setFaultLock(true); section.setRouteLock(true); - if (section.isShowLogic()) { + if (section.isCross()) { + section.getLogicList().get(0).setRouteLock(true); + } else if (section.isShowLogic()) { section.getLogicList().forEach(s -> { // s.setFaultLock(true); s.setRouteLock(true); @@ -123,7 +125,7 @@ public class SectionGeneratorNew implements GeneratorNew { } break; case Section_Axis_Pre_Reset: - if(!section.isAxleCounter()){ + if(!section.isAxleCounter() && section.isCross()){ continue; } VirtualRealitySectionAxleCounter virtualAxleCounter = section.getVirtualAxleCounter(); From 8c59338df788d4fbc4e00cc17fad87294f9783ab Mon Sep 17 00:00:00 2001 From: Jade Date: Mon, 29 Nov 2021 17:09:17 +0800 Subject: [PATCH 03/16] =?UTF-8?q?=E5=8D=97=E4=BA=AC=E4=BA=8C=20=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../training/generatornew/base/SectionGeneratorNew.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java index c53dccee0..d342075f8 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java @@ -125,10 +125,10 @@ public class SectionGeneratorNew implements GeneratorNew { } break; case Section_Axis_Pre_Reset: - if(!section.isAxleCounter() && section.isCross()){ + if(!section.isAxleCounter() && !section.isCross()){ continue; } - VirtualRealitySectionAxleCounter virtualAxleCounter = section.getVirtualAxleCounter(); + VirtualRealitySectionAxleCounter virtualAxleCounter = section.findAxleCounterSection().getVirtualAxleCounter(); virtualAxleCounter.setOccupy(true); virtualAxleCounter.setPreReset(false); virtualAxleCounter.setLeftCount(2); From 6c5da045f73ae1affbad7362ca3a5f088420dcf1 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Mon, 29 Nov 2021 17:30:30 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E8=BF=9E=E9=94=81=E9=87=8D=E5=90=AF?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=BA=A4=E5=87=BA=E8=BD=A6=E7=AB=99=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATS/service/AtsStationService.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsStationService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsStationService.java index 4445c4c66..fe30dbd91 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsStationService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsStationService.java @@ -516,12 +516,15 @@ public class AtsStationService { station.setRestartTime(LocalTime.now()); Station.Fault.INTERLOCK_FAULT.fix(station); //恢复联锁机故障 SimulationDataRepository repository = simulation.getRepository(); - for (StatusDevice value : station.getDeviceMap().values()) { - if (value instanceof Section) { //联锁区所有区段故障锁闭 - Section section = (Section) value; - section.recursivelySetFaultLock(true); - } else if (value instanceof Station) { //联锁区所有车站交出控制权 - Station station1 = (Station) value; + //该站范围内区段故障锁闭 + station.getDeviceMap().values().stream() + .filter(v -> v instanceof Section) + .map(v -> (Section) v) + .forEach(section -> section.recursivelySetFaultLock(true)); + //车站交出控制权 + station.setControlMode(Station.ControlMode.None); + for (Station station1 : repository.getStationList()) { + if (Objects.equals(station, station1.getDeviceStation())) { station1.setControlMode(Station.ControlMode.None); } } From 63db1a8564b1859d8a897f6275b64cdac810b782 Mon Sep 17 00:00:00 2001 From: Jade Date: Tue, 30 Nov 2021 09:46:17 +0800 Subject: [PATCH 05/16] =?UTF-8?q?=E5=8D=97=E4=BA=AC=E4=BA=8C=20=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86=20=E5=B2=94?= =?UTF-8?q?=E5=BF=83=E5=8D=A0=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../club/joylink/rtss/simulation/cbtc/data/map/Section.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 a4dff0125..0bb81899a 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 @@ -871,7 +871,10 @@ public class Section extends DelayUnlockDevice { boolean leftSectionNctOccupied = leftSection.isNctOccupied() && leftSection.getParent().equals(this.parent); Section rightSection = logic.getRightSection(); boolean rightSectionNctOccupied = rightSection.isNctOccupied() && rightSection.getParent().equals(this.parent); - logic.setNctOccupied(leftSectionNctOccupied || rightSectionNctOccupied); + if (leftSectionNctOccupied || rightSectionNctOccupied) { + logic.setNctOccupied(true); + setNctOccupied(true); + } }); } From d916dc162e5effe1f8ce3bfd19a79c9729ce386a Mon Sep 17 00:00:00 2001 From: Jade Date: Tue, 30 Nov 2021 10:29:59 +0800 Subject: [PATCH 06/16] =?UTF-8?q?=E8=AE=A1=E8=BD=B4=E5=8F=97=E6=89=B0=20?= =?UTF-8?q?=E5=B2=94=E5=BF=83=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/simulation/cbtc/data/map/Section.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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 0bb81899a..ae1daa9ec 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 @@ -1139,25 +1139,20 @@ public class Section extends DelayUnlockDevice { return; } this.setInvalid(true); + if (!CollectionUtils.isEmpty(this.logicList)) { + for (Section logic : this.logicList) { + logic.setInvalid(true); + } + } if (this.isSwitchAxleCounterSection()) { // 道岔计轴区段 List relSwitchList = this.getRelSwitchList(); for (Switch aSwitch : relSwitchList) { - aSwitch.getA().setInvalid(true); if (aSwitch.isPosN()) { - aSwitch.getB().setInvalid(true); aSwitch.getC().setInvalid(false); } else if (aSwitch.isPosR()) { - aSwitch.getC().setInvalid(true); aSwitch.getB().setInvalid(false); - } else { - aSwitch.getB().setInvalid(true); - aSwitch.getC().setInvalid(true); } } - } else if (!CollectionUtils.isEmpty(this.logicList)) { - for (Section logic : this.logicList) { - logic.setInvalid(true); - } } } From a5f30e905d63133415b5081896d0bf6efb0c116c Mon Sep 17 00:00:00 2001 From: Jade Date: Tue, 30 Nov 2021 14:29:01 +0800 Subject: [PATCH 07/16] =?UTF-8?q?=E5=8C=BA=E6=AE=B5=20=E5=B2=94=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simulation/cbtc/data/map/Section.java | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) 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 ae1daa9ec..96c941c31 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 @@ -466,9 +466,9 @@ public class Section extends DelayUnlockDevice { public void axleCounterOccupy(boolean right) { this.trainRight = right; this.setNctOccupied(true); - if (isSwitchAxleCounterSection()) { - nctOccupiedBySwitchPosition(); - } +// if (isSwitchAxleCounterSection()) { +// nctOccupiedBySwitchPosition(); +// } } /** @@ -1139,20 +1139,25 @@ public class Section extends DelayUnlockDevice { return; } this.setInvalid(true); - if (!CollectionUtils.isEmpty(this.logicList)) { - for (Section logic : this.logicList) { - logic.setInvalid(true); - } - } if (this.isSwitchAxleCounterSection()) { // 道岔计轴区段 List relSwitchList = this.getRelSwitchList(); for (Switch aSwitch : relSwitchList) { + aSwitch.getA().setInvalid(true); if (aSwitch.isPosN()) { + aSwitch.getB().setInvalid(true); aSwitch.getC().setInvalid(false); } else if (aSwitch.isPosR()) { + aSwitch.getC().setInvalid(true); aSwitch.getB().setInvalid(false); + } else { + aSwitch.getB().setInvalid(true); + aSwitch.getC().setInvalid(true); } } + } else if (!CollectionUtils.isEmpty(this.logicList)) { + for (Section logic : this.logicList) { + logic.setInvalid(true); + } } } From 5ea4b7af3ecbdfb80f6118d164e6d69e6e457ff2 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Tue, 30 Nov 2021 16:28:53 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=9F=9F=E5=90=8D?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9=EF=BC=9B?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=8C=BA=E6=AE=B5=E5=AE=9E=E8=AE=AD=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E6=89=80=E5=B1=9E=E8=AE=A1=E8=BD=B4?= =?UTF-8?q?=E5=8C=BA=E6=AE=B5=E5=B1=9E=E4=BA=8E=E8=BD=A6=E8=BE=86=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E8=B7=B3=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/controller/ProjectServerController.java | 9 +++++++++ .../rtss/services/project/ServerService.java | 4 +++- .../rtss/services/project/ServerServiceImpl.java | 15 ++++++++++++++- .../generatornew/base/SectionGeneratorNew.java | 4 ++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/main/java/club/joylink/rtss/controller/ProjectServerController.java b/src/main/java/club/joylink/rtss/controller/ProjectServerController.java index 9d594cdca..36230833d 100644 --- a/src/main/java/club/joylink/rtss/controller/ProjectServerController.java +++ b/src/main/java/club/joylink/rtss/controller/ProjectServerController.java @@ -13,6 +13,9 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +/** + * 项目域名管理接口 + */ @Slf4j @RestController @RequestMapping("/api/projectServer") @@ -47,4 +50,10 @@ public class ProjectServerController { this.serverService.update(id, vo, accountVO); } + @Role(RoleEnum.SuperAdmin) + @DeleteMapping("/{id}") + public void delete(@PathVariable Long id) { + this.serverService.delete(id); + } + } diff --git a/src/main/java/club/joylink/rtss/services/project/ServerService.java b/src/main/java/club/joylink/rtss/services/project/ServerService.java index d7ebd3abb..6de3f9b7f 100644 --- a/src/main/java/club/joylink/rtss/services/project/ServerService.java +++ b/src/main/java/club/joylink/rtss/services/project/ServerService.java @@ -7,11 +7,13 @@ import club.joylink.rtss.vo.project.ProjectServerQueryVO; import club.joylink.rtss.vo.project.ProjectServerVO; public interface ServerService { - public ProjectServerVO getByProject(Project project); + ProjectServerVO getByProject(Project project); PageVO pagingQuery(ProjectServerQueryVO queryVO); String create(ProjectServerVO vo, AccountVO accountVO); void update(Long id, ProjectServerVO vo, AccountVO accountVO); + + void delete(Long id); } diff --git a/src/main/java/club/joylink/rtss/services/project/ServerServiceImpl.java b/src/main/java/club/joylink/rtss/services/project/ServerServiceImpl.java index ca72fc30f..23f8d0dd2 100644 --- a/src/main/java/club/joylink/rtss/services/project/ServerServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/project/ServerServiceImpl.java @@ -14,6 +14,7 @@ import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.time.LocalDateTime; import java.util.List; @@ -32,7 +33,14 @@ public class ServerServiceImpl implements ServerService { example.createCriteria() .andProjectEqualTo(project.name()); List projectServerList = this.projectServerDAO.selectByExample(example); - BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(projectServerList); + if (CollectionUtils.isEmpty(projectServerList)) { + example.clear(); + example.createCriteria().andProjectEqualTo(Project.DEFAULT.name()); + projectServerList = this.projectServerDAO.selectByExample(example); + } + if (CollectionUtils.isEmpty(projectServerList)) { + return null; + } return new ProjectServerVO(projectServerList.get(0)); } @@ -78,4 +86,9 @@ public class ServerServiceImpl implements ServerService { this.projectServerDAO.updateByPrimaryKey(projectServer); } } + + @Override + public void delete(Long id) { + projectServerDAO.deleteByPrimaryKey(id); + } } diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java index d342075f8..43045b154 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java @@ -37,6 +37,10 @@ public class SectionGeneratorNew implements GeneratorNew { if (section.getStation() != null && section.getStation().isDepot()) { continue; } + Section axleCounterSection = section.findAxleCounterSection(); + if (axleCounterSection != null && axleCounterSection.getStation().isDepot()) { + continue; + } if(StringUtils.isEmpty(section.getName())){ continue; } From 00ac703598f607ec652fea1eee58bf3c62abd261 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Wed, 1 Dec 2021 13:07:32 +0800 Subject: [PATCH 09/16] =?UTF-8?q?ci=E5=A2=9E=E5=8A=A0=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=81=93=E5=B2=94=E9=A2=84=E5=A4=8D=E4=BD=8D=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=88=E5=9B=A0=E9=81=93=E5=B2=94=E8=AE=A1?= =?UTF-8?q?=E8=BD=B4=E5=8C=BA=E6=AE=B5=E8=AE=A1=E8=BD=B4=E6=95=85=E9=9A=9C?= =?UTF-8?q?=E9=A2=84=E5=A4=8D=E4=BD=8D=E6=81=A2=E5=A4=8D=E5=90=8E=E9=81=93?= =?UTF-8?q?=E5=B2=94=E7=9A=84=E9=A2=84=E5=A4=8D=E4=BD=8D=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=B8=85=E9=99=A4=E6=8E=89=EF=BC=89=EF=BC=9B?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E3=80=90=E8=BF=9B=E8=B7=AF=E5=86=85=E5=8C=BA?= =?UTF-8?q?=E6=AE=B5=E6=9C=89=E5=8D=A0=E7=94=A8=E6=97=B6=EF=BC=8C=E5=BC=BA?= =?UTF-8?q?=E8=A7=A3=E8=BF=9B=E8=B7=AF=E5=8C=BA=E6=AE=B5=EF=BC=8C=E5=BB=B6?= =?UTF-8?q?=E6=97=B6=E8=A7=A3=E9=94=81=E3=80=91=EF=BC=9B=E8=BF=9B=E8=B7=AF?= =?UTF-8?q?=E8=81=94=E9=94=81=E6=9D=A1=E4=BB=B6=E4=B8=8D=E6=BB=A1=E8=B6=B3?= =?UTF-8?q?=E8=80=8C=E5=BB=B6=E6=97=B6=E8=A7=A3=E9=94=81=E7=9A=84=E9=81=93?= =?UTF-8?q?=E5=B2=94=E5=A4=B1=E8=A1=A8=E5=88=A4=E5=AE=9A=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/CI/device/CiDeviceStatusCollector.java | 8 +++++++- .../rtss/simulation/cbtc/CI/device/CiRouteService.java | 4 +++- .../joylink/rtss/simulation/cbtc/CI/device/CiService.java | 4 ++-- .../joylink/rtss/simulation/cbtc/data/map/Section.java | 7 +++++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiDeviceStatusCollector.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiDeviceStatusCollector.java index c5aba0b24..ca43eeaf5 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiDeviceStatusCollector.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiDeviceStatusCollector.java @@ -54,10 +54,16 @@ public class CiDeviceStatusCollector { } private void collectSwitch(SimulationDataRepository repository, List switchList) { - // 道岔位置状态 switchList.forEach(aSwitch -> { + // 道岔位置状态 VirtualRealitySwitch vrSwitch = aSwitch.getVirtualSwitch(); aSwitch.updatePos(vrSwitch.getP()); + // 道岔预复位状态 + Section axleSection = aSwitch.getA().findAxleCounterSection(); + if (axleSection != null) { + boolean preReset = axleSection.getVirtualAxleCounter().isPreReset(); + aSwitch.setPreReset(preReset); + } }); } 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 66e7bcb9c..1e3bfb2e3 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 @@ -408,7 +408,9 @@ public class CiRouteService { */ public void sectionFaultUnlock(Simulation simulation, Section section, Route route) { if (route != null) { - if (route.getStart().isApproachLock() || section.isOverlapLock()) { + if (route.getStart().isApproachLock() + || section.isOverlapLock() + || route.getSectionList().stream().anyMatch(Section::isOccupied)) { // 区段延时解锁 this.delayUnlockStart(simulation, route, section); return; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java index 27a672868..958745105 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java @@ -287,7 +287,7 @@ public class CiService { public boolean isRouteSwitchLost(Simulation simulation, Route route) { for (SwitchElement switchElement : route.getSwitchList()) { - if (switchElement.getASwitch().isFaultOnPosition(switchElement.isNormal())) { + if (switchElement.getASwitch().isLoss()) { return true; } } @@ -297,7 +297,7 @@ public class CiService { for (RouteFls.FlsElement flsElement : routeFls.getLevel1List()) { SwitchElement pSwitch = flsElement.getPSwitch(); if (pSwitch != null) { - if (pSwitch.getASwitch().isFaultOnPosition(pSwitch.isNormal())) { + if (pSwitch.getASwitch().isLoss()) { return true; } } 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 96c941c31..63771964a 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 @@ -11,7 +11,10 @@ import lombok.Getter; import lombok.Setter; import org.springframework.util.CollectionUtils; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; /** * 区段 @@ -226,7 +229,7 @@ public class Section extends DelayUnlockDevice { private Integer speedLimitBeforeFault; /** - * 延时解锁 + * 延时解锁(延时解锁根据remain判定,该字段可以考虑删除) */ private boolean delayUnlock; From 6fafb601d8eb10b0855cecce73af23136b66d218 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Wed, 1 Dec 2021 14:09:44 +0800 Subject: [PATCH 10/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E6=97=B6=EF=BC=8C=E8=BF=87=E6=BB=A4=E8=BD=A6?= =?UTF-8?q?=E8=BE=86=E6=AE=B5=E5=8C=BA=E6=AE=B5=E7=9A=84=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=9B=E5=8C=BA=E6=AE=B5=E7=8A=B6=E6=80=81=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?remain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../training/generatornew/base/SectionGeneratorNew.java | 4 ++-- .../rtss/simulation/cbtc/data/map/DelayUnlockDevice.java | 4 ++++ .../rtss/simulation/cbtc/data/status/SectionStatus.java | 9 ++++++++- .../rtss/simulation/cbtc/data/vo/SectionStatusVO.java | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java index 43045b154..cb9f58c7f 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java @@ -34,11 +34,11 @@ public class SectionGeneratorNew implements GeneratorNew { List trainingVOList = new ArrayList<>(); List
sectionList = simulation.getRepository().getSectionList(); for (Section section : sectionList) { - if (section.getStation() != null && section.getStation().isDepot()) { + if (section.getStation() != null && section.getStation() != null && section.getStation().isDepot()) { continue; } Section axleCounterSection = section.findAxleCounterSection(); - if (axleCounterSection != null && axleCounterSection.getStation().isDepot()) { + if (axleCounterSection != null && axleCounterSection.getStation() != null && axleCounterSection.getStation().isDepot()) { continue; } if(StringUtils.isEmpty(section.getName())){ diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/DelayUnlockDevice.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/DelayUnlockDevice.java index 4db6a1c66..4e91191d3 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/DelayUnlockDevice.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/map/DelayUnlockDevice.java @@ -35,4 +35,8 @@ public abstract class DelayUnlockDevice extends MayOutOfOrderDevice { public void recover(int remain) { this.remain = remain; } + + public int getRemainInSeconds() { + return this.remain / 1000; + } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SectionStatus.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SectionStatus.java index cf61c9388..54a10a393 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SectionStatus.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/status/SectionStatus.java @@ -1,7 +1,6 @@ package club.joylink.rtss.simulation.cbtc.data.status; import club.joylink.rtss.simulation.cbtc.data.map.MapElement; -import club.joylink.rtss.simulation.cbtc.data.map.MayOutOfOrderDevice; import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.simulation.cbtc.data.vo.DeviceStatusVO; import club.joylink.rtss.simulation.cbtc.data.vo.SectionStatusVO; @@ -100,6 +99,8 @@ public class SectionStatus extends DeviceStatus { @JsonSerialize(using = Boolean2NumSerializer.class) private boolean closed; + private int remain; + private String fault; public SectionStatus(Section section) { @@ -119,6 +120,7 @@ public class SectionStatus extends DeviceStatus { this.preReset = section.isPreReset(); this.delayUnlock = section.isDelayUnlock(); this.closed = section.isClosed(); + this.remain = section.getRemain(); this.fault = section.getFault() == null ? null : section.getFault().toString(); } @@ -202,6 +204,11 @@ public class SectionStatus extends DeviceStatus { status.setClosed(this.closed); change = true; } + if (!Objects.equals(this.remain, section.getRemainInSeconds())) { + this.remain = section.getRemainInSeconds(); + change = true; + } + status.setRemain(this.remain); String fault = section.getFault() == null ? null : section.getFault().toString(); if (!Objects.equals(this.fault, fault)) { this.fault = fault; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SectionStatusVO.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SectionStatusVO.java index c38ac9910..31bd3f065 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SectionStatusVO.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/vo/SectionStatusVO.java @@ -71,6 +71,8 @@ public class SectionStatusVO extends DeviceStatusVO { @JsonInclude private String fault; + private Integer remain; + public SectionStatusVO(Section section) { super(section.getCode(), section.getDeviceType()); } From 2db15a49a4de8f6aeb6435a3ec774baef321e34f Mon Sep 17 00:00:00 2001 From: Jade Date: Wed, 1 Dec 2021 18:28:10 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E5=B2=94=E5=BF=83=E8=AE=A1=E8=BD=B4?= =?UTF-8?q?=E6=95=85=E9=9A=9C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/SectionGeneratorNew.java | 4 +- .../generatornew/base/SwitchGeneratorNew.java | 2 +- .../cbtc/ATP/ground/AtpSectionService.java | 2 +- .../simulation/cbtc/data/map/Section.java | 53 +++++++++++++------ 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java index cb9f58c7f..42974a112 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java @@ -110,9 +110,9 @@ public class SectionGeneratorNew implements GeneratorNew { case Section_Confirm_Axis_Valid: // 设置计轴失效(ARB) if (Objects.nonNull(section.getParent())) { - section.getParent().judgeAsNctOccupied(); + section.getParent().judgeAsNctOccupied(simulation); } else { - section.judgeAsNctOccupied(); + section.judgeAsNctOccupied(simulation); } break; case Section_Fault_Unlock: diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SwitchGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SwitchGeneratorNew.java index c892be4c6..895a0a907 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SwitchGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SwitchGeneratorNew.java @@ -115,7 +115,7 @@ public class SwitchGeneratorNew implements GeneratorNew { } case Switch_Confirm_Axis_Valid:{ // 背景为道岔计轴失效 - aSwitch.getA().getParent().judgeAsNctOccupied(); + aSwitch.getA().getParent().judgeAsNctOccupied(simulation); break; } case Switch_Squeeze_Recovery: diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/AtpSectionService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/AtpSectionService.java index cbce19f84..d20b60969 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/AtpSectionService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATP/ground/AtpSectionService.java @@ -141,7 +141,7 @@ public class AtpSectionService { section.setFault(Section.AxleFault.FAULT); } } else if (Section.AxleFault.FAULT.equals(section.getFault()) && section.getVirtualAxleCounter().isOccupy()) { - section.judgeAsNctOccupied(); + section.judgeAsNctOccupied(simulation); } // if (/*!section.isInvalid() &&*/ section.isNctOccupied()) { // if (!sectionList.contains(section)) { 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 63771964a..a039ab7e3 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 @@ -1,6 +1,7 @@ package club.joylink.rtss.simulation.cbtc.data.map; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; +import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition; @@ -824,14 +825,15 @@ public class Section extends DelayUnlockDevice { /** * 判定为非通信车占用 + * @param simulation */ - public void judgeAsNctOccupied() { + public void judgeAsNctOccupied(Simulation simulation) { if (!this.isAxleCounter()) { return; } this.setNctOccupied(true); if (this.isSwitchAxleCounterSection()) { // 道岔计轴区段 - nctOccupiedBySwitchPosition(); + nctOccupiedBySwitchPosition(simulation); } else if (!CollectionUtils.isEmpty(this.logicList)) { for (Section logic : this.logicList) { logic.setNctOccupied(true); @@ -841,25 +843,42 @@ public class Section extends DelayUnlockDevice { /** * 根据道岔位置设置非通信车占用 + * @param simulation */ - private void nctOccupiedBySwitchPosition() { + private void nctOccupiedBySwitchPosition(Simulation simulation) { List relSwitchList = this.getRelSwitchList(); - for (Switch aSwitch : relSwitchList) { - aSwitch.getA().setNctOccupied(true); - if (aSwitch.isPosN()) { - aSwitch.getB().setNctOccupied(true); - aSwitch.getC().setNctOccupied(false); - } else if (aSwitch.isPosR()) { - aSwitch.getC().setNctOccupied(true); - aSwitch.getB().setNctOccupied(false); - } else { - aSwitch.getB().setNctOccupied(true); - aSwitch.getC().setNctOccupied(true); + if (relSwitchList.size() == 2 && simulation.getRepository().getConfig().isSwitchSingleHandle()) { + // 道岔计轴区段两个道岔有一个反位 + if (!relSwitchList.stream().allMatch(Switch::isPosN)) { + for (Switch aSwitch : relSwitchList) { + if (aSwitch.isPosN()) { + continue; + } + setSwitchNctOccupied(aSwitch); + } + Section cross = queryCross(); + if (cross != null) { + cross.crossJudgeOccupied(); + } + return; } } - Section cross = queryCross(); - if (cross != null) { - cross.crossJudgeOccupied(); + for (Switch aSwitch : relSwitchList) { + setSwitchNctOccupied(aSwitch); + } + } + + private void setSwitchNctOccupied(Switch aSwitch) { + aSwitch.getA().setNctOccupied(true); + if (aSwitch.isPosN()) { + aSwitch.getB().setNctOccupied(true); + aSwitch.getC().setNctOccupied(false); + } else if (aSwitch.isPosR()) { + aSwitch.getC().setNctOccupied(true); + aSwitch.getB().setNctOccupied(false); + } else { + aSwitch.getB().setNctOccupied(true); + aSwitch.getC().setNctOccupied(true); } } From b054137647d363b4aa83c92f2e10c834ee213b0f Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Wed, 1 Dec 2021 18:29:33 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E7=94=9F=E6=88=90=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=94=A8=E6=89=80=E5=B1=9E=E9=9B=86=E4=B8=AD?= =?UTF-8?q?=E7=AB=99=E8=BF=87=E6=BB=A4=E8=BD=A6=E8=BE=86=E6=AE=B5=E5=8C=BA?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../generatornew/base/SectionGeneratorNew.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java index cb9f58c7f..6a5e307b2 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/SectionGeneratorNew.java @@ -9,6 +9,7 @@ import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.map.Route; import club.joylink.rtss.simulation.cbtc.data.map.Section; import club.joylink.rtss.simulation.cbtc.data.map.Stand; +import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySectionAxleCounter; import club.joylink.rtss.simulation.cbtc.tool.DeviceStatusModifyTool; import club.joylink.rtss.vo.client.training.TrainingNewVO; @@ -34,13 +35,20 @@ public class SectionGeneratorNew implements GeneratorNew { List trainingVOList = new ArrayList<>(); List
sectionList = simulation.getRepository().getSectionList(); for (Section section : sectionList) { - if (section.getStation() != null && section.getStation() != null && section.getStation().isDepot()) { + //若区段/所属计轴区段所在集中站是车辆段,跳过 + //为什么不用station字段?只有功能轨的station字段有值 + Station deviceStation = section.getDeviceStation(); + if (deviceStation != null && deviceStation.isDepot()) { continue; } Section axleCounterSection = section.findAxleCounterSection(); - if (axleCounterSection != null && axleCounterSection.getStation() != null && axleCounterSection.getStation().isDepot()) { - continue; + if (axleCounterSection != null) { + Station axleDeviceStation = axleCounterSection.getDeviceStation(); + if (axleDeviceStation != null && axleDeviceStation.isDepot()) { + continue; + } } + if(StringUtils.isEmpty(section.getName())){ continue; } From be7e4f7a834a8550ba8abfc5b9aad4c0e22b6d95 Mon Sep 17 00:00:00 2001 From: Jade Date: Thu, 2 Dec 2021 10:08:06 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E9=97=A8=E9=80=89=E9=9B=B6=E4=BD=8D?= =?UTF-8?q?=E4=B8=8D=E7=BB=99=E7=89=B5=E5=BC=95=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATS/operation/handler/DriverOperateHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/DriverOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/DriverOperateHandler.java index 073c613cb..feb7b1cbf 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/DriverOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/DriverOperateHandler.java @@ -34,6 +34,10 @@ public class DriverOperateHandler { VirtualRealityTrain train = simulation.getRepository().getOnlineTrainBy(groupNumber); // if (train.isSignalEB() && percent == -2) // ATPService.cancelSignalEB(train); + // 门选不是零位,不给牵引力 + if (!train.getDoorSelection().equals(VirtualRealityTrain.DoorSelection.Z)) { + return; + } if ((percent <= 1 && percent >= -1) || percent == -2) { train.setLeverPosition(percent); } From 09d423a3f4c3a5c0ec53afdddb49d7dc905a2994 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Thu, 2 Dec 2021 12:59:54 +0800 Subject: [PATCH 14/16] =?UTF-8?q?=E9=87=8D=E5=90=AF=E4=BB=A4=E8=A7=A3?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=EF=BC=8C=E8=83=8C=E6=99=AF=E7=BB=99=E8=BD=A6?= =?UTF-8?q?=E7=AB=99=E8=AE=BE=E7=BD=AE=E7=AB=99=E6=8E=A7=EF=BC=9B=E5=88=97?= =?UTF-8?q?=E8=BD=A6=E7=BB=8F=E8=BF=87=E3=80=90ARB=E3=80=91=E3=80=90?= =?UTF-8?q?=E8=BF=9B=E8=B7=AF=E9=94=81=E9=97=AD=E3=80=91=E7=9A=84=E5=8C=BA?= =?UTF-8?q?=E6=AE=B5=E4=B9=8B=E5=90=8E=EF=BC=8C=E5=8F=96=E6=B6=88=E8=BF=9B?= =?UTF-8?q?=E8=B7=AF=E9=94=81=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../training/generatornew/base/StationGeneratorNew.java | 5 +++++ .../rtss/simulation/cbtc/CI/device/CiRouteService.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/club/joylink/rtss/services/training/generatornew/base/StationGeneratorNew.java b/src/main/java/club/joylink/rtss/services/training/generatornew/base/StationGeneratorNew.java index efeb2acbb..b3ab3b5e1 100644 --- a/src/main/java/club/joylink/rtss/services/training/generatornew/base/StationGeneratorNew.java +++ b/src/main/java/club/joylink/rtss/services/training/generatornew/base/StationGeneratorNew.java @@ -277,6 +277,11 @@ public class StationGeneratorNew implements GeneratorNew { param.put("stationCode", station.getCode()); atsOperationDispatcher.execute(simulation, member, operate, param); station.setInterlockMachineStarting(true); + if(station.isCentralized()) { + station.setControlMode(Station.ControlMode.Local); + }else{ + station.getDeviceStation().setControlMode(Station.ControlMode.Local); + } break; } case Station_Release: { 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 1e3bfb2e3..9b053eae3 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 @@ -462,7 +462,7 @@ public class CiRouteService { Collections.reverse(logicList); } for (Section logic : logicList) { - if (!logic.isOccupied() && !logic.isInvalid() && logic.isRouteLockOn(right)) { + if (!logic.isOccupied() && /*!logic.isInvalid() &&*/ logic.isRouteLockOn(right)) { logic.routeUnlocking(route); logic.overlapUnlocking(); } else if(logic.isOccupied() || logic.isInvalid()) { From 2258062e9a42cebf4c73dab75940af2fd2a6cec0 Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Mon, 6 Dec 2021 10:31:53 +0800 Subject: [PATCH 15/16] =?UTF-8?q?=E5=88=97=E8=BD=A6=E7=BB=8F=E8=BF=87?= =?UTF-8?q?=E3=80=90ARB=E3=80=91=E3=80=90=E8=BF=9B=E8=B7=AF=E9=94=81?= =?UTF-8?q?=E9=97=AD=E3=80=91=E7=9A=84=E5=8C=BA=E6=AE=B5=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E5=8F=96=E6=B6=88=E8=BF=9B=E8=B7=AF=E9=94=81=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../joylink/rtss/simulation/cbtc/CI/device/CiRouteService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9b053eae3..5279f10b4 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 @@ -465,7 +465,7 @@ public class CiRouteService { if (!logic.isOccupied() && /*!logic.isInvalid() &&*/ logic.isRouteLockOn(right)) { logic.routeUnlocking(route); logic.overlapUnlocking(); - } else if(logic.isOccupied() || logic.isInvalid()) { + } else if(logic.isOccupied() /*|| logic.isInvalid()*/) { break; } } From f5c711da90e29130b009899343522421d510595d Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Mon, 6 Dec 2021 13:22:48 +0800 Subject: [PATCH 16/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B2=94=E5=BF=83?= =?UTF-8?q?=E6=89=80=E5=9C=A8=E8=AE=A1=E8=BD=B4=E5=8C=BA=E6=AE=B5=E9=A2=84?= =?UTF-8?q?=E5=A4=8D=E4=BD=8D=E6=88=90=E5=8A=9F=E5=90=8E=EF=BC=8C=E9=A2=84?= =?UTF-8?q?=E5=A4=8D=E4=BD=8D=E7=8A=B6=E6=80=81=E6=9C=AA=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/virtual/VRTrainRunningService.java | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/device/virtual/VRTrainRunningService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/device/virtual/VRTrainRunningService.java index f37495659..f1622561a 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/device/virtual/VRTrainRunningService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/device/virtual/VRTrainRunningService.java @@ -136,29 +136,20 @@ public class VRTrainRunningService { return; //进入计轴区段判断 - Section headAxleCounterSectionNew = headPositionNew.getSection(); - if (!headAxleCounterSectionNew.isAxleCounter()) { - headAxleCounterSectionNew = headAxleCounterSectionNew.getParent(); - } - if (!headAxleCounterSectionNew.isAxleCounter()) { //当是——物理区段-岔心-道岔计轴区段三层结构的时候需要多这次判断 - headAxleCounterSectionNew = headAxleCounterSectionNew.getParent(); - } - if (headAxleCounterSectionNew != null && headAxleCounterSectionNew.isAxleCounter()) { //新的区段是计轴区段 - Section headSectionOld = headPosition.getSection(); - if (!headAxleCounterSectionNew.equals(headSectionOld) && !headAxleCounterSectionNew.equals(headSectionOld.getParent())) { //新计轴区段和老区段不一样 + Section headAxleCounterSectionNew = headPositionNew.getSection().findAxleCounterSection(); + if (headAxleCounterSectionNew != null) { + Section headAxleCounterSection = headPosition.getSection().findAxleCounterSection(); + if (!headAxleCounterSectionNew.equals(headAxleCounterSection)) { //【车头所在计轴区段】发生变化 headAxleCounterSectionNew.getVirtualAxleCounter().trainIn(trainRight); } } //离开计轴区段判断 SectionPosition tailPositionOld = CalculateService.calculateNextPositionByStartAndLen(headPosition, !trainRight, train.getLen(), true); - Section tailAxleCounterSection = tailPositionOld.getSection(); - if (!tailAxleCounterSection.isAxleCounter()) { - tailAxleCounterSection = tailAxleCounterSection.getParent(); - } - if (tailAxleCounterSection != null && tailAxleCounterSection.isAxleCounter()) { //老的车尾区段是计轴区段 + Section tailAxleCounterSection = tailPositionOld.getSection().findAxleCounterSection(); + if (tailAxleCounterSection != null) { SectionPosition tailPositionNew = CalculateService.calculateNextPositionByStartAndLen(headPositionNew, !trainRight, train.getLen(), true); - Section tailSectionNew = tailPositionNew.getSection(); - if (!tailAxleCounterSection.equals(tailSectionNew) && !tailAxleCounterSection.equals(tailSectionNew.getParent())) { //老车尾计轴区段和新车尾区段不一样 + Section tailAxleCounterSectionNew = tailPositionNew.getSection().findAxleCounterSection(); + if (!tailAxleCounterSection.equals(tailAxleCounterSectionNew)) { //【车尾所在计轴区段】发生变化 tailAxleCounterSection.getVirtualAxleCounter().trainOut(trainRight); } }