示例#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));
        }
示例#2
0
        public SpectrometerViewModel(StatusViewModel svm)
        {
            base.DisplayName = "SpectrometerViewModel";

            _statusVM = svm;
            _avantes  = new AvantesSpectrometer();

            CommandStop          = new RelayCommand(param => Stop());
            CommandStart         = new RelayCommand(param => Start(-1));
            CommandSnapshot      = new RelayCommand(param => Start(1));
            CommandResetSettings = new RelayCommand(param => ResetSettings());
            CommandSave          = new RelayCommand(param => Save());

            IntegrationTime = GlobalVariables.spectrometerSettings.IntegrationTime;
            NumAverages     = GlobalVariables.spectrometerSettings.NumAverages;

            InitTimer(15000, false);
        }
示例#3
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());
        }
        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));
        }
示例#5
0
        public XYZAxesViewModel(StatusViewModel svm)
        {
            base.DisplayName = "XYZAxesViewModel";
            _statusVM        = svm;

            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())));
            CommandEnableAxis      = new RelayCommand(parm => EnableAxis(int.Parse(parm.ToString())), cc => { return(!_statusVM.IsBusy); });
            CommandDisableAxis     = new RelayCommand(parm => DisableAxis(int.Parse(parm.ToString())), cc => { return(!_statusVM.IsBusy); });
            CommandMoveTo          = new RelayCommand(parm => MoveTo(), cc => { return(!_statusVM.IsBusy); });
            CommandStop            = new RelayCommand(parm => Stop());
            CommandAddNewPoint     = new RelayCommand(parm => AddNewPosition(Point.Parse(parm.ToString())));
            CommandRemoveLastPoint = new RelayCommand(parm => RemoveLastPosition(), cc => { return(!_statusVM.IsBusy && PositionList.Count > 1); });
            CommandClearAllPoints  = new RelayCommand(parm => ClearAllPoints(), cc => { return(!_statusVM.IsBusy); });
            CommandHoming          = new RelayCommand(parm => Homing(), cc => { return(!_statusVM.IsBusy); });
            CommandSaveRefPosition = new RelayCommand(param => SaveRefPosition(), cc => { return(!_statusVM.IsBusy); });

            InitTimer(30000, false);
        }
示例#6
0
 public CameraViewModel(StatusViewModel svm)
 {
     base.DisplayName = "CameraViewModel";
     //_cameraConnected = false;
     _statusVM = svm;
 }