Example #1
0
        public MeasurementViewModel(MainWindowViewModel mvm,
                                    StatusViewModel svm, CameraViewModel cvm, PhosphorescenceViewModel pvm, AnalyzerViewModel avm)
        {
            base.DisplayName = "MeasurementViewModel";
            _mainVM          = mvm;
            _statusVM        = svm;
            _cameraVM        = cvm;
            _resultVM        = pvm;
            _analyzerVM      = avm;

            ArduinoConnected = false;

            CommandEnd                     = new RelayCommand(param => End(), cc => _camPhosActive);
            CommandStartDarkBG             = new RelayCommand(param => StartDarkBG(), cc => !_camPhosActive);
            CommandStartLed                = new RelayCommand(param => StartLed(), cc => !_camPhosActive);
            CommandStartN3Fluorescence     = new RelayCommand(param => StartN3Fluorescence(), cc => !_camPhosActive);
            CommandStartDeepUVFluorescence = new RelayCommand(param => StartDeepUVFluorescence(int.Parse(param.ToString())), cc => !_camPhosActive);
            CommandStartPhosphorescence    = new RelayCommand(param => StartPhosphorescence(), cc => ArduinoConnected && !_camPhosActive);
            CommandSaveSettings            = new RelayCommand(param => ShowSaveSettings());

            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork             += ConnectToArduino;
            bw.RunWorkerCompleted += ConnectToArduinoCompleted;
            bw.RunWorkerAsync();
        }
Example #2
0
        public MainWindowViewModel()
        {
            base.DisplayName = "MainWindowViewModel";

            StatusVM      = new StatusViewModel();
            StatusVM.Busy = 0;

            ResultVM      = new PhosphorescenceViewModel(StatusVM);
            AnalyzerVM    = new AnalyzerViewModel(StatusVM);
            CameraVM      = new CameraViewModel(StatusVM);
            MeasurementVM = new MeasurementViewModel(this, StatusVM, CameraVM, ResultVM, AnalyzerVM);
        }