/// <summary>Lowers this pantograph</summary> internal void Lower(bool Automatic) { if (LoweredSound != -1) { SoundManager.Play(LoweredSound, 1.0, 1.0, false); } //Lower the pantograph if (Train.CurrentSpeed == 0 || Automatic) { State = PantographStates.Lowered; Train.DebugLogger.LogMessage("A pantograph was lowered sucessfully"); } else { State = PantographStates.LoweredAtSpeed; Train.DebugLogger.LogMessage("A pantograph was lowered whilst the train was in motion"); } }
/// <summary>Raises this pantograph</summary> private void Raise() { if (Train.ElectricEngine.BreakerTripped == true) { if (RaisedSound != -1) { SoundManager.Play(RaisedSound, 1.0, 1.0, false); } //We can raise the pantograph, so start the line volts timer State = PantographStates.RaisedTimer; Train.DebugLogger.LogMessage("A pantograph was raised sucessfully"); } else { State = PantographStates.RaisedVCBClosed; Train.DebugLogger.LogMessage("An attempt was made to raise a pantograph with the ACB/VCB closed"); } }
internal void Update(double TimeElapsed) { switch (State) { case PantographStates.RaisedTimer: Timer += TimeElapsed; if (Timer > 1000) { State = PantographStates.VCBReady; } break; case PantographStates.VCBResetTimer: Timer += TimeElapsed; if (Timer > RetryInterval) { State = PantographStates.Lowered; Timer = 0.0; } break; case PantographStates.VCBReady: if (Train.ElectricEngine.BreakerTripped == false) { State = PantographStates.OnService; } break; case PantographStates.RaisedVCBClosed: Train.ElectricEngine.TripBreaker(); State = PantographStates.Lowered; break; case PantographStates.LoweredAtSpeed: switch (Behaviour) { case AlarmBehaviour.None: State = PantographStates.Lowered; break; case AlarmBehaviour.TripVCB: if (!Train.ElectricEngine.BreakerTripped) { Train.ElectricEngine.TripBreaker(); } break; case AlarmBehaviour.ApplyBrakesTripVCB: if (AlarmSound != -1) { SoundManager.Play(AlarmSound, 1.0, 1.0, true); } if (!Train.ElectricEngine.BreakerTripped) { Train.ElectricEngine.TripBreaker(); } Train.TractionManager.DemandBrakeApplication(Train.Specs.BrakeNotches + 1, "Brake application demanded by the pantograph being lowered at speed"); break; } break; case PantographStates.LoweredAtspeedBraking: if (Train.CurrentSpeed == 0) { Timer += TimeElapsed; if (Timer > RetryInterval) { State = PantographStates.Lowered; Timer = 0.0; if (AlarmSound != -1) { SoundManager.Stop(AlarmSound); } } } break; } }