From bd3b7b808751f51d109221030e60a7ebbccbd59d Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Tue, 27 Apr 2021 18:42:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A8=E9=81=93=E4=BA=A4=E9=80=9A=E4=BB=BF?= =?UTF-8?q?=E7=9C=9F=E2=80=94=E2=80=94=E4=BB=BF=E7=9C=9F=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=8A=B6=E6=80=81=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../club/joylink/rtss/simulation/rt/SRD/bo/SrAXC.java | 6 ++++++ .../club/joylink/rtss/simulation/rt/SRD/bo/SrDevice.java | 2 ++ .../club/joylink/rtss/simulation/rt/SRD/bo/SrPSD.java | 7 +++++++ .../club/joylink/rtss/simulation/rt/SRD/bo/SrSignal.java | 8 ++++++++ .../club/joylink/rtss/simulation/rt/SRD/bo/SrSwitch.java | 7 +++++++ .../club/joylink/rtss/simulation/rt/SRD/bo/SrTrack.java | 5 +++++ .../club/joylink/rtss/simulation/rt/SRD/bo/SrTrain.java | 5 +++++ .../joylink/rtss/simulation/rt/SRD/bo/SrdRepository.java | 2 ++ 8 files changed, 42 insertions(+) diff --git a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrAXC.java b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrAXC.java index 9ae189e3b..c6e0b842b 100644 --- a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrAXC.java +++ b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrAXC.java @@ -34,6 +34,12 @@ public class SrAXC extends SrDevice { return this.state == ON; } + @Override + public void initState() { + this.state = OFF; + this.fault = null; + } + @Override public void applyState(int state) { diff --git a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrDevice.java b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrDevice.java index 6611532b7..f6511356b 100644 --- a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrDevice.java +++ b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrDevice.java @@ -24,6 +24,8 @@ public abstract class SrDevice implements Debug { this.deviceType = deviceType; } + public abstract void initState(); + public abstract void applyState(int state); @Override diff --git a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrPSD.java b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrPSD.java index baa280e87..656df46ba 100644 --- a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrPSD.java +++ b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrPSD.java @@ -61,6 +61,13 @@ public class SrPSD extends SrDevice { this.finishTime = null; } + @Override + public void initState() { + this.state = CLOSE_LOCK; + this.command.set(NONE); + this.finishTime = null; + } + @Override public void applyState(int state) { if (CLOSE_LOCK == state || CLOSED == state || TURNING == state || OPEN_FINISH == state) { diff --git a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrSignal.java b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrSignal.java index 5a25ee00b..9bee14dbe 100644 --- a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrSignal.java +++ b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrSignal.java @@ -97,6 +97,14 @@ public class SrSignal extends SrDevice { this.command.set(NONE); this.finishTime = null; } + + @Override + public void initState() { + this.state = OFF; + this.command.set(NONE); + this.finishTime = null; + } + @Override public void applyState(int state) { if (OFF == state || H == state || L == state || U == state || UH == state) { diff --git a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrSwitch.java b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrSwitch.java index 61df29df7..3c8a826b9 100644 --- a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrSwitch.java +++ b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrSwitch.java @@ -115,6 +115,13 @@ public class SrSwitch extends SrDevice { this.finishTime = null; } + @Override + public void initState() { + this.state = NORMAL; + this.command.set(NONE); + this.finishTime = null; + } + @Override public void applyState(int state) { if (NORMAL == state || REVERSE == state || LOST == state) { diff --git a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrTrack.java b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrTrack.java index 6a484eea1..8115de3a4 100644 --- a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrTrack.java +++ b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrTrack.java @@ -92,6 +92,11 @@ public class SrTrack extends SrDevice implements Debug { return null; } + @Override + public void initState() { + + } + @Override public void applyState(int state) { diff --git a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrTrain.java b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrTrain.java index 178b8421f..57ed59468 100644 --- a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrTrain.java +++ b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrTrain.java @@ -78,6 +78,11 @@ public class SrTrain extends SrDevice { this.speed = v; } + @Override + public void initState() { + + } + @Override public void applyState(int state) { diff --git a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrdRepository.java b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrdRepository.java index 950bb7ae8..3709d7056 100644 --- a/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrdRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/rt/SRD/bo/SrdRepository.java @@ -49,7 +49,9 @@ public class SrdRepository extends SimulationRepository { @Override public void initState() { + for (SrAXC axc : this.axcMap.values()) { + } } public List getAxcList() {