예제 #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();
        }
예제 #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);
        }
예제 #3
0
        public PhosphorescenceViewModel(StatusViewModel svm)

        {
            base.DisplayName = "PhosphorescenceViewModel";

            _statusVM = svm;

            PreviousPhosImageCmd = new RelayCommand(param => PreviousPhosImage());
            NextPhosImageCmd     = new RelayCommand(param => NextPhosImage());
            CommandSaveAll       = new RelayCommand(param => Save(true));

            PixelSize = 0;
        }
예제 #4
0
        public CameraViewModel(StatusViewModel svm)
        {
            base.DisplayName = "CameraViewModel";
            _statusVM        = svm;

            CommandResetSettings = new RelayCommand(param => ResetSettings());
            CommandSave          = new RelayCommand(param => Save());

            _cameraConnected                      = false;
            _phosImagesToCollect                  = 0;
            bwCameraConnector.DoWork             += ConnectCameraDoWork;
            bwCameraConnector.RunWorkerCompleted += ConnectCameraCompleted;
            bwCameraConnector.RunWorkerAsync();
        }
예제 #5
0
        public AnalyzerViewModel(StatusViewModel svm)
        {
            base.DisplayName = "AnalyzerViewModel";
            _statusVM        = svm;

            MeasurementTypes = new ObservableCollection <string>()
            {
                "WHITE_LIGHT", "N3_FL", "PHOS", "DP_FL", "DP_FL2", "DARK_BG"
            };
            ResultList = new ObservableCollection <Result>();

            CommandPreviousItem  = new RelayCommand(param => PreviousItem());
            CommandNextItem      = new RelayCommand(param => NextItem());
            CommandAddMask       = new RelayCommand(param => AddMask());
            CommandRemoveMasks   = new RelayCommand(param => RemoveMasks());
            CommandAnalyze       = new RelayCommand(param => Analyze());
            CommandRemoveLastOne = new RelayCommand(param => RemoveLastOne());
            CommandSave          = new RelayCommand(param => Save());
        }