Esempio n. 1
0
        public ExciterViewModel()
        {
            InitializeExciter();

            PowerSupplyView       = new PowerSupplyViewModel(_exciterModel);
            PowerTray1View        = new PowerTray1ViewModel(_exciterModel);
            PowerTray2View        = new PowerTray2ViewModel(_exciterModel);
            WarningsView          = new WarningsViewModel(_exciterModel);
            ErrorsView            = new ErrorsViewModel(_exciterModel);
            LightweightStatusView = new LightweightStatusViewModel(_exciterModel);
            SelfTestView          = new SelfTestViewModel(_exciterModel);

            CommandExciterInitialize = new DelegateCommand(() =>
            {
                if (_exciterModel != null)
                {
                    return;
                }
            });

            CommandExciterUninitialize = new DelegateCommand(Dispose);

            CommandSelfTest = new DelegateCommand(() => _exciterModel.SelfTest());

            DispatcherTimer dispatcherTimer = new DispatcherTimer();

            dispatcherTimer.Tick    += DispatcherTimerTick;
            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 100);
            dispatcherTimer.Start();
        }