internal void SetupSwitches(Switch frontGSwitch, Switch backGSwitch, Switch buttonSwitch) { FrontGSwitch = frontGSwitch; BackGSwitch = backGSwitch; ButtonSwitch = buttonSwitch; this._frontGWatcher = new FGratingWatcher(this); FrontGSwitch.On += _frontGWatcher.ProcessAsync; _frontGWatcher.Busy += OnBusy; _frontGWatcher.FakeCar += (s, e) => _idleTimer.Start(); _frontGWatcher.Error += (s, e) => _idleTimer.Start(); this._buttonWatcher = new ButtonWatcher(this); ButtonSwitch.On += _buttonWatcher.ProcessAsync; _buttonWatcher.Busy += OnBusy; _buttonWatcher.Succeed += (s, e) => _idleTimer.Start(); //this.ButtonIdle += this.OnIdle; _idleTimer.Interval = Timeout; _idleTimer.Elapsed += (s, e) => Ready(); }
protected override void OnAfterLoad() { buttonWatcher = ButtonWatcher.Instance; }