From a45f64d71cbf95e537e286fb1b02711214f15ffc Mon Sep 17 00:00:00 2001 From: tiger_zhou <123456> Date: Mon, 29 Aug 2022 13:34:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E5=8A=A1=E7=AE=A1=E7=90=86=E7=BB=88?= =?UTF-8?q?=E7=AB=AF=E5=8A=9F=E8=83=BD=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../simulation/cbtc/CI/data/StationDirection.java | 11 +++++++++-- .../simulation/cbtc/CTC/data/CtcEffectRepository.java | 2 +- .../simulation/cbtc/CTC/data/CtcManageRepository.java | 4 +++- .../rtss/simulation/cbtc/build/SimulationBuilder.java | 3 ++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java index 7953a35fe..cc0a83485 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/data/StationDirection.java @@ -19,7 +19,7 @@ import java.util.concurrent.atomic.AtomicInteger; @Setter @Getter @Slf4j -public class StationDirection extends MayOutOfOrderDevice { +public class StationDirection extends MayOutOfOrderDevice implements Cloneable { /** * 发辅助默认倒计时 25s */ @@ -270,7 +270,14 @@ public class StationDirection extends MayOutOfOrderDevice { this.deliverRouteList = new ArrayList<>(); this.routeSettingStatusMap = new HashMap<>(); } - + public StationDirection clone(){ + try { + return (StationDirection)super.clone(); + } catch (CloneNotSupportedException e) { + e.printStackTrace(); + } + return null; + } @Override public void reset() { this.routeSettingStatusMap.clear(); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcEffectRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcEffectRepository.java index 74e715735..a52f7e2fe 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcEffectRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcEffectRepository.java @@ -575,6 +575,6 @@ public class CtcEffectRepository { this.stationTrackSectionMap.clear(); this.doorRepository.clear(); this.regularTrainLineMap.clear(); - + updateReguarTrainLineMap.clear(); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcManageRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcManageRepository.java index 8c7a82a11..2046dd75f 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcManageRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcManageRepository.java @@ -48,10 +48,12 @@ public class CtcManageRepository { public void reset() { + this.trackSectionRepository.clear(); this.doorRepository.clear(); this.runPlanRepository.clear(); - this.runPlanRepository.clear(); + regularTrainLineMap.clear(); + } /** diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java index f9ae4b71e..eb34db8eb 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java @@ -366,7 +366,8 @@ public class SimulationBuilder { // ioGate.setCode(sd.getCode()); // ioGate.setIoName(sd.getName()); // ioGate.setDirection(sd.getLabelEnum()); - doorRep.save(sd); + + doorRep.save(sd.clone()); } for (Stand stand : station.getAllStandList()) { TrackSection ts = new TrackSection(stand.getSection());