Esempio n. 1
0
        public MainWindowVM()
        {
            base.DisplayName = "MainWindowViewModel";

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

            CameraVM       = new CameraViewModel(StatusVM);
            XYZMotorVM     = new XYZAxesViewModel(StatusVM);
            SpectrometerVM = new SpectrometerViewModel(StatusVM);
            MeasurementVM  = new MeasurementViewModel(CameraVM, XYZMotorVM, SpectrometerVM, StatusVM);

            CameraVM.AddCameraConnectedSubscriber(new CameraConnectionHandler(OnCameraConnected));
            CameraVM.AddRemoveRectMarkerEventSubscriber(new RemoveRectMarkerHandler(MeasurementVM.OnRemovePointListOnRectMarker));
        }
Esempio n. 2
0
        public MeasurementViewModel(CameraViewModel cameraVM, XYZAxesViewModel xyzAxesVM, SpectrometerViewModel spectrometerVM, StatusViewModel statusVM)
        {
            base.DisplayName = "MeasurementViewModel";
            _cameraVM        = cameraVM;
            _xyzAxesVM       = xyzAxesVM;
            _spectrometerVM  = spectrometerVM;
            _statusVM        = statusVM;

            CommandCalibrateRefPoint   = new RelayCommand(param => CalibrateRefPoint(), cc => { return(!_statusVM.IsBusy); });
            CommandCalibrate           = new RelayCommand(param => Calibrate(), cc => { return(!_statusVM.IsBusy); });
            CommandCameraSettings      = new RelayCommand(param => EditCameraSettings());
            CommandMeasure             = new RelayCommand(param => Measure(), cc => { return(!_statusVM.IsBusy); });
            CommandMotorSettings       = new RelayCommand(param => EditMotorSettings());
            CommandDisplayMarkedPoints = new RelayCommand(param => DisplayMarkedPoints());
            CommandBatchMeasure        = new RelayCommand(param => BatchMeasure(), cc => { return(_xyzAxesVM.PositionCount > 1 && !_statusVM.IsBusy); });
            CommandToggleLaser         = new RelayCommand(param => ToggleLaser());
            CommandSpectrumSettings    = new RelayCommand(param => EditSpectrumSettings(), cc => { return(_spectrometerVM.SpectrometerConnected); });
            CommandToggleLED           = new RelayCommand(param => ToggleLED());
            CommandMappingMeasure      = new RelayCommand(param => MappingMeasure());
        }
Esempio n. 3
0
        public SpectrumSettingsViewModel(SpectrometerViewModel spectroMeterVM, XYZAxesViewModel xyzAxesVM, StatusViewModel statusVM)
        {
            base.DisplayName = "SpectrumSettingsViewModel";
            _spectroMeterVM  = spectroMeterVM;
            _xyzAxesVM       = xyzAxesVM;
            _statusVM        = statusVM;
            IntegrationTime  = GlobalVariables.spectrometerSettings.IntegrationTime;
            NumAverage       = GlobalVariables.spectrometerSettings.NumAverages;
            Delay            = GlobalVariables.spectrometerSettings.Delay;
            Counts           = GlobalVariables.spectrometerSettings.Counts;

            _spectroMeterVM.AddLiveViewUpdateSubscriber(new LiveViewUpdateHandler(LiveViewUpdate));

            JogX    = new RelayCommand(parm => Jog(0, GlobalVariables.motorSettings.JogVelX, int.Parse(parm.ToString())), cc => { return(!_statusVM.IsBusy); });
            JogY    = new RelayCommand(parm => Jog(1, GlobalVariables.motorSettings.JogVelY, int.Parse(parm.ToString())), cc => { return(!_statusVM.IsBusy); });
            JogZ    = new RelayCommand(parm => Jog(2, GlobalVariables.motorSettings.JogVelZ, int.Parse(parm.ToString())), cc => { return(!_statusVM.IsBusy); });
            JogStop = new RelayCommand(parm => Stop(int.Parse(parm.ToString())));
            CommandUpdateSettings = new RelayCommand(param => UpdateSettings(param));
            CommandCancelSettings = new RelayCommand(param => CancelSettings(param));
        }