Exemple #1
0
        public AnchorablePlateSolverVM(IProfileService profileService,
                                       ICameraMediator cameraMediator,
                                       ITelescopeMediator telescopeMediator,
                                       IImagingMediator imagingMediator,
                                       IApplicationStatusMediator applicationStatusMediator) : base(profileService)
        {
            Title = "LblPlateSolving";

            this.cameraMediator = cameraMediator;
            this.cameraMediator.RegisterConsumer(this);
            this.telescopeMediator = telescopeMediator;
            this.telescopeMediator.RegisterConsumer(this);
            this.imagingMediator           = imagingMediator;
            this.applicationStatusMediator = applicationStatusMediator;

            ImageGeometry = (System.Windows.Media.GeometryGroup)System.Windows.Application.Current.Resources["PlatesolveSVG"];

            SolveCommand       = new AsyncCommand <bool>(() => CaptureSolveSyncAndReslew(new Progress <ApplicationStatus>(p => Status = p)));
            CancelSolveCommand = new RelayCommand(CancelSolve);

            SnapExposureDuration = profileService.ActiveProfile.PlateSolveSettings.ExposureTime;
            SnapFilter           = profileService.ActiveProfile.PlateSolveSettings.Filter;
            RepeatThreshold      = profileService.ActiveProfile.PlateSolveSettings.Threshold;
            SlewToTarget         = profileService.ActiveProfile.PlateSolveSettings.SlewToTarget;

            profileService.ProfileChanged += (object sender, EventArgs e) => {
                SnapExposureDuration = profileService.ActiveProfile.PlateSolveSettings.ExposureTime;
                SnapFilter           = profileService.ActiveProfile.PlateSolveSettings.Filter;
                RepeatThreshold      = profileService.ActiveProfile.PlateSolveSettings.Threshold;
                SlewToTarget         = profileService.ActiveProfile.PlateSolveSettings.SlewToTarget;
            };
        }
Exemple #2
0
 public CaptureSolver(IPlateSolver plateSolver,
                      IPlateSolver blindSolver,
                      IImagingMediator imagingMediator)
 {
     this.imagingMediator = imagingMediator;
     this.ImageSolver     = new ImageSolver(plateSolver, blindSolver);
 }
Exemple #3
0
        public ExposureCalculatorVM(IProfileService profileService, IImagingMediator imagingMediator, ISharpCapSensorAnalysisReader sharpCapSensorAnalysisReader)
            : base(profileService)
        {
            this._imagingMediator = imagingMediator;
            this.Title            = "LblExposureCalculator";
            this._sharpCapSensorAnalysisReader = sharpCapSensorAnalysisReader;

            if (Application.Current != null)
            {
                ImageGeometry = (System.Windows.Media.GeometryGroup)Application.Current.Resources["CalculatorSVG"];
            }

            DetermineExposureTimeCommand       = new AsyncCommand <bool>(DetermineExposureTime);
            CancelDetermineExposureTimeCommand = new RelayCommand(TriggerCancelToken);
            DetermineBiasCommand        = new AsyncCommand <bool>(DetermineBias);
            ReloadSensorAnalysisCommand = new AsyncCommand <bool>(ReloadSensorAnalysis);
            CancelDetermineBiasCommand  = new RelayCommand(TriggerCancelToken);

            this._sharpCapSensorAnalysisDisabledValue = "(" + Locale.Loc.Instance["LblDisabled"] + ")";
            this._sharpCapSensorNames = new ObservableCollection <string>();
            var configuredPath = this.profileService.ActiveProfile.ImageSettings.SharpCapSensorAnalysisFolder;

            if (String.IsNullOrEmpty(configuredPath))
            {
                // Attempt load for default configuration only if the directory exists to avoid log spam
                if (Directory.Exists(SharpCapSensorAnalysisConstants.DEFAULT_SHARPCAP_SENSOR_ANALYSIS_PATH))
                {
                    LoadSensorAnalysisData(SharpCapSensorAnalysisConstants.DEFAULT_SHARPCAP_SENSOR_ANALYSIS_PATH);
                }
            }
            else
            {
                LoadSensorAnalysisData(configuredPath);
            }
        }
Exemple #4
0
 public CenteringSolver(IPlateSolver plateSolver,
                        IPlateSolver blindSolver,
                        IImagingMediator imagingMediator,
                        ITelescopeMediator telescopeMediator)
 {
     this.telescopeMediator = telescopeMediator;
     this.CaptureSolver     = new CaptureSolver(plateSolver, blindSolver, imagingMediator);
 }
Exemple #5
0
        public ThumbnailVM(IProfileService profileService, IImagingMediator imagingMediator) : base(profileService)
        {
            Title         = "LblImageHistory";
            CanClose      = false;
            ImageGeometry = (GeometryGroup)System.Windows.Application.Current.Resources["HistorySVG"];

            this.imagingMediator = imagingMediator;

            this.imagingMediator.ImageSaved += ImagingMediator_ImageSaved;

            SelectCommand = new AsyncCommand <bool>((object o) => {
                return(SelectImage((Thumbnail)o));
            });
        }
Exemple #6
0
        public ImagingVM(
            IProfileService profileService,
            IImagingMediator imagingMediator,
            ICameraMediator cameraMediator,
            ITelescopeMediator telescopeMediator,
            IFilterWheelMediator filterWheelMediator,
            IFocuserMediator focuserMediator,
            IRotatorMediator rotatorMediator,
            IGuiderMediator guiderMediator,
            IWeatherDataMediator weatherDataMediator,
            IApplicationStatusMediator applicationStatusMediator
            ) : base(profileService)
        {
            this.imagingMediator = imagingMediator;
            this.imagingMediator.RegisterHandler(this);

            this.cameraMediator = cameraMediator;
            this.cameraMediator.RegisterConsumer(this);

            this.telescopeMediator = telescopeMediator;
            this.telescopeMediator.RegisterConsumer(this);

            this.filterWheelMediator = filterWheelMediator;
            this.filterWheelMediator.RegisterConsumer(this);

            this.focuserMediator = focuserMediator;
            this.focuserMediator.RegisterConsumer(this);

            this.rotatorMediator = rotatorMediator;
            this.rotatorMediator.RegisterConsumer(this);

            this.guiderMediator            = guiderMediator;
            this.applicationStatusMediator = applicationStatusMediator;

            this.weatherDataMediator = weatherDataMediator;
            this.weatherDataMediator.RegisterConsumer(this);

            progress = new Progress <ApplicationStatus>(p => Status = p);

            ImageControl = new ImageControlVM(profileService, cameraMediator, telescopeMediator, applicationStatusMediator);
        }
Exemple #7
0
        public AnchorableSnapshotVM(
            IProfileService profileService,
            IImagingMediator imagingMediator,
            ICameraMediator cameraMediator,
            IApplicationStatusMediator applicationStatusMediator) : base(profileService)
        {
            Title         = "LblImaging";
            ImageGeometry = (System.Windows.Media.GeometryGroup)System.Windows.Application.Current.Resources["ImagingSVG"];
            this.applicationStatusMediator = applicationStatusMediator;
            this.cameraMediator            = cameraMediator;
            this.cameraMediator.RegisterConsumer(this);
            this.imagingMediator = imagingMediator;
            progress             = new Progress <ApplicationStatus>(p => Status = p);
            SnapCommand          = new AsyncCommand <bool>(() => SnapImage(progress));
            CancelSnapCommand    = new RelayCommand(CancelSnapImage);
            StartLiveViewCommand = new AsyncCommand <bool>(StartLiveView);
            StopLiveViewCommand  = new RelayCommand(StopLiveView);
            SnapFilter           = profileService.ActiveProfile.FilterWheelSettings.FilterWheelFilters?.FirstOrDefault(x => x.Name == profileService.ActiveProfile.SnapShotControlSettings.Filter?.Name);

            profileService.ProfileChanged += (object sender, EventArgs e) => {
                SnapFilter = profileService.ActiveProfile.FilterWheelSettings.FilterWheelFilters?.FirstOrDefault(x => x.Name == profileService.ActiveProfile.SnapShotControlSettings.Filter?.Name);
            };
        }
Exemple #8
0
        public MeridianFlipVM(IProfileService profileService, ITelescopeMediator telescopeMediator, IGuiderMediator guiderMediator, IImagingMediator imagingMediator, IApplicationStatusMediator applicationStatusMediator) : base(profileService)
        {
            this.telescopeMediator         = telescopeMediator;
            this.guiderMediator            = guiderMediator;
            this.imagingMediator           = imagingMediator;
            this.applicationStatusMediator = applicationStatusMediator;

            CancelCommand = new RelayCommand(Cancel);
        }
Exemple #9
0
        public PolarAlignmentVM(
            IProfileService profileService,
            ICameraMediator cameraMediator,
            ITelescopeMediator telescopeMediator,
            IImagingMediator imagingMediator,
            IApplicationStatusMediator applicationStatusMediator
            ) : base(profileService)
        {
            Title = "LblPolarAlignment";

            ImageGeometry = (System.Windows.Media.GeometryGroup)System.Windows.Application.Current.Resources["PolarAlignSVG"];

            this.cameraMediator = cameraMediator;
            this.cameraMediator.RegisterConsumer(this);

            this.imagingMediator = imagingMediator;

            this.telescopeMediator = telescopeMediator;
            this.telescopeMediator.RegisterConsumer(this);
            this.applicationStatusMediator = applicationStatusMediator;

            updateValues          = new DispatcherTimer();
            updateValues.Interval = TimeSpan.FromSeconds(10);
            updateValues.Tick    += UpdateValues_Tick;

            MeasureAzimuthErrorCommand = new AsyncCommand <bool>(
                () => MeasurePolarError(new Progress <ApplicationStatus>(p => AzimuthPolarErrorStatus = p), Direction.AZIMUTH),
                (p) => (TelescopeInfo?.Connected == true && CameraInfo?.Connected == true));
            MeasureAltitudeErrorCommand = new AsyncCommand <bool>(
                () => MeasurePolarError(new Progress <ApplicationStatus>(p => AltitudePolarErrorStatus = p), Direction.ALTITUDE),
                (p) => (TelescopeInfo?.Connected == true && CameraInfo?.Connected == true));
            SlewToAltitudeMeridianOffsetCommand = new AsyncCommand <bool>(
                () => SlewToMeridianOffset(AltitudeMeridianOffset, AltitudeDeclination),
                (p) => (TelescopeInfo?.Connected == true));
            SlewToAzimuthMeridianOffsetCommand = new AsyncCommand <bool>(
                () => SlewToMeridianOffset(AzimuthMeridianOffset, AzimuthDeclination),
                (p) => (TelescopeInfo?.Connected == true));
            DARVSlewCommand = new AsyncCommand <bool>(
                () => Darvslew(new Progress <ApplicationStatus>(p => Status = p), new Progress <string>(p => DarvStatus = p)),
                (p) => (TelescopeInfo?.Connected == true && CameraInfo?.Connected == true));
            CancelDARVSlewCommand = new RelayCommand(
                Canceldarvslew,
                (p) => cancelDARVSlewToken != null);
            CancelMeasureAltitudeErrorCommand = new RelayCommand(
                CancelMeasurePolarError,
                (p) => cancelMeasureErrorToken != null);
            CancelMeasureAzimuthErrorCommand = new RelayCommand(
                CancelMeasurePolarError,
                (p) => cancelMeasureErrorToken != null);

            DARVSlewDuration     = 60;
            DARVSlewRate         = 0.01;
            SnapExposureDuration = 2;

            profileService.ProfileChanged += (object sender, EventArgs e) => {
                RaisePropertyChanged(nameof(AzimuthMeridianOffset));
                RaisePropertyChanged(nameof(AzimuthDeclination));
                RaisePropertyChanged(nameof(AltitudeMeridianOffset));
                RaisePropertyChanged(nameof(AltitudeDeclination));
            };
        }