Exemple #1
0
        public override void elapse(OpenBveApi.Runtime.ElapseData data)
        {
            globalTime = data.TotalTime;

            if (closedSignal && (globalTime.Milliseconds - time.Milliseconds) > tempo)
                handleManager.applyEmergencyBrake();
        }
Exemple #2
0
        public ClosedSignal(TrainSoundManager soundManager,
		                     TrainHandleManager handleManager,
		                     TrainControlManager controlManager)
            : base(soundManager,handleManager,controlManager)
        {
            globalTime = new OpenBveApi.Runtime.Time(0);
            time = new OpenBveApi.Runtime.Time(0);
            this.reset();
        }
        public TrainControlManager(ref OpenBveApi.Runtime.LoadProperties properties)
        {
            controlBlinking = new List<int>();
            lastTime = new OpenBveApi.Runtime.Time(0);

            panel = new int[cabControls.count];
            for (int i=0; i<cabControls.count; i++)
                panel[i] = 0;
            properties.Panel = panel;
        }
        public void elapse(OpenBveApi.Runtime.ElapseData data)
        {
            globalTime = data.TotalTime;

            if (globalTime.Milliseconds - lastTime.Milliseconds > halfBlinkingPeriod)
            {
                controlBlinking.ForEach(delegate (int control) {
                    if (getState(control) == 1)
                        setState(control, 0);
                    else
                        setState(control, 1);
                });
                lastTime = globalTime;
            }
        }
Exemple #5
0
 private void crossingClosedSignal()
 {
     this.beep();
     closedSignal = true;
     controlManager.startBlinking(cabControls.LSSF);
     time = globalTime;
 }