Skip to content

Commit 1c5a0b2

Browse files
committed
EOT: improve restore when delay timer was on
1 parent f2b6299 commit 1c5a0b2

File tree

1 file changed

+15
-0
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks/SubSystems

1 file changed

+15
-0
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/EOT.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,21 @@ public override void Restore(BinaryReader inf)
200200
ID = inf.ReadInt32();
201201
EOTState = (EOTstate)(inf.ReadInt32());
202202
DelayTimer = new Timer(this);
203+
switch (EOTState)
204+
{
205+
case EOTstate.CommTestOn:
206+
// restart timer
207+
DelayTimer.Setup(CommTestDelayS);
208+
DelayTimer.Start();
209+
break;
210+
case EOTstate.LocalTestOn:
211+
// restart timer
212+
DelayTimer.Setup(LocalTestDelayS);
213+
DelayTimer.Start();
214+
break;
215+
default:
216+
break;
217+
}
203218
base.Restore(inf);
204219
if (Train != null) Train.EOT = this;
205220
}

0 commit comments

Comments
 (0)