예제 #1
0
파일: BaseStep.cs 프로젝트: rwg0/ConeSharp
        public IStep OnNext()
        {
            if (State.Mount.Slewing)
            {
                State.ShowMessage("Wait until all mount movement is complete before pressing next.");
                return(null);
            }

            if (!State.Mount.Tracking)
            {
                State.ShowMessage("The mount must be tracking to perform the cone error adjustment.");
                return(null);
            }

            if (State.Mount.TrackingRate != DriveRates.driveSidereal)
            {
                State.ShowMessage("The mount must be tracking at sidereal rate to perform the cone error adjustment.");
                return(null);
            }


            if (!IsOKPosition())
            {
                return(null);
            }

            State.AddPosition(GetPositionId(), State.Mount.RightAscension, State.Mount.Declination);
            return(CreateNextStep());
        }
예제 #2
0
        protected override bool IsOKPosition()
        {
            var lat  = State.Mount.SiteLatitude;
            var decl = State.Mount.Declination;
            var az   = State.Mount.Azimuth;

            if (Math.Abs(decl) > 20)
            {
                State.ShowMessage("You need to GoTo a star with a declination between -20 and +20.");
                return(false);
            }

            if (lat > 0 && (az < 150 || az > 180))
            {
                State.ShowMessage("You need to GoTo a star within 30 degrees of the meridian (on the east side).");
                return(false);
            }

            if (lat < 0 && (az > 30))
            {
                State.ShowMessage("You need to GoTo a star within 30 degrees of the meridian (on the east side).");
                return(false);
            }


            if (State.Mount.SideOfPier == State.SideOfPierOnGotoWest)
            {
                State.ShowMessage("At this step, the mount should have move to the *other* side of the pier.\r\n\r\nSome ASCOM drivers cannot accurately report the correct side of pier, so this could be a false alarm.\r\n\r\nIf you are sure the mount has swapped sides then it is OK to continue.");
            }
            State.SideOfPierOnGotoEast = State.Mount.SideOfPier;

            return(true);
        }
예제 #3
0
        protected override bool IsOKPosition()
        {
            if (State.Mount.SideOfPier != State.SideOfPierOnGotoEast)
            {
                State.ShowMessage("At this step, the mount must still be on the same side of the pier as in the previous GOTO step.");
                return(false);
            }

            return(true);
        }
예제 #4
0
        public IStep OnNext()
        {
            ITelescope scope = null;

            if (string.IsNullOrEmpty(Settings1.Default.LastMountId))
            {
                _state.ShowMessage("No telescope mount driver selected.");
                return(null);
            }

            try
            {
                scope = CreateScope(Settings1.Default.LastMountId);
            }
            catch (Exception e)
            {
                _state.ShowMessage("Cannot create ASCOM mount driver " + Settings1.Default.LastMount + "\r\nBecause : " + e.Message);
                return(null);
            }

            if (scope.AlignmentMode != AlignmentModes.algGermanPolar)
            {
                _state.ShowMessage(_state.AppName + " will only work with a German Equatorial style mount (as it needs the meridian flip to happen when swapping sides of the meridian).");
                return(null);
            }

            try
            {
                scope.Connected = true;
                _state.Mount    = scope;
            }
            catch (Exception ex)
            {
                _state.ShowMessage("Could not connect to scope driver : " + ex.Message);
                return(null);
            }

            return(new ScopePropertiesStep());
        }
예제 #5
0
        protected override bool IsOKPosition()
        {
            var lat = State.Mount.SiteLatitude;


            var decl = State.Mount.Declination;
            var az   = State.Mount.Azimuth;

            if (Math.Abs(decl) > 20)
            {
                State.ShowMessage("You need to GoTo a star with a declination between -20 and +20.");
                return(false);
            }

            if (lat > 0 && (az < 180 || az > 210))
            {
                State.ShowMessage("You need to GoTo a star within 30 degrees of the meridian (on the west side).");
                return(false);
            }

            if (lat == 0)
            {
                State.ShowMessage("Your mount reports a site latitude of zero - this isn't going to work without a correct latitude because the calculation is different in the southern hemisphere.");
                return(false);
            }

            if (lat < 0 && (az < 330))
            {
                State.ShowMessage("You need to GoTo a star within 30 degrees of the meridian (on the west side).");
                return(false);
            }

            State.SideOfPierOnGotoWest = State.Mount.SideOfPier;

            return(true);
        }