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() {