public void PulseGuide(GuideDirections direction, int duration) { traceLogger.LogMessage("PulseGuide", "Direction - " + direction.ToString() + "Duration - " + duration.ToString()); //Duration in milliseconds TimeSpan moveDuration = TimeSpan.FromMilliseconds(duration); switch (direction) { case GuideDirections.guideEast: axisControllers[(int)Axis.RA].Move(moveDuration, Orientation.PLUS); break; case GuideDirections.guideWest: axisControllers[(int)Axis.RA].Move(moveDuration, Orientation.MINUS); break; case GuideDirections.guideNorth: axisControllers[(int)Axis.DEC].Move(moveDuration, Orientation.PLUS); break; case GuideDirections.guideSouth: axisControllers[(int)Axis.DEC].Move(moveDuration, Orientation.MINUS); break; } }
public void PulseGuide(GuideDirections Direction, int Duration) { this.CheckConnected("PulseGuide"); if (Duration < this.pulseGuideMin || this.pulseGuideMax < Duration) { throw new InvalidValueException("PulseGuide", Duration.ToString(), pulseGuideMin.ToString(), pulseGuideMax.ToString()); } ComPort.Response response; switch (Direction) { case GuideDirections.guideEast: response = this.comPort.East(Duration); break; case GuideDirections.guideNorth: response = this.comPort.North(Duration); break; case GuideDirections.guideSouth: response = this.comPort.South(Duration); break; case GuideDirections.guideWest: response = this.comPort.West(Duration); break; default: throw new InvalidValueException("PulseGuide", Direction.ToString(), "guideEast,guideNorth,guideSouth,guideWest"); } LogMessage("PulseGuide", response.ToString()); if (response != ComPort.Response.OK) { throw new InvalidOperationException("PulseGuide"); } HashSet <string> states = new HashSet <string>(); while (true) { response = this.comPort.State(states); LogMessage("PulseGuide", response.ToString()); if (response != ComPort.Response.OK) { throw new InvalidOperationException("PulseGuide"); } if (!states.Contains(ComPort.PulseGuide)) { break; } Thread.Sleep(1); } }
/// <summary> /// Supported by GotoStar /// </summary> public void PulseGuide(GuideDirections direction, int duration) { Log.Debug("PulseGuide - To {0}, for {1} ms", direction.ToString(), duration); gotoStar.PulseGuide(direction, duration); }
public void Guide(GuideDirections Direction, long Duration) { #if DEBUG if (!PerformanceWindow.Visible) { PerformanceWindow.Show(); } #endif Common.eFixedRate Rate = Common.eFixedRate.Rate1; Common.eDeviceId DevId = 0; Common.eDirection Dir = 0; switch (Direction) { // Dec case GuideDirections.guideNorth: DevId = Common.eDeviceId.ALT; Dir = Common.eDirection.Positive; break; case GuideDirections.guideSouth: DevId = Common.eDeviceId.ALT; Dir = Common.eDirection.Negitve; break; // Ra case GuideDirections.guideEast: DevId = Common.eDeviceId.AZM; switch (Scope.TrackingMode) { case Common.eTrackingMode.EQNORTH: Dir = Common.eDirection.Negitve; break; case Common.eTrackingMode.EQSOUTH: Dir = Common.eDirection.Positive; break; } break; case GuideDirections.guideWest: DevId = Common.eDeviceId.AZM; switch (Scope.TrackingMode) { case Common.eTrackingMode.EQNORTH: Dir = Common.eDirection.Positive; break; case Common.eTrackingMode.EQSOUTH: Dir = Common.eDirection.Negitve; break; } break; default: Common.Log.LogMessage(Common.DriverId, "Guide() : invalid guide direction " + Direction.ToString()); throw new ASCOM.InvalidValueException(Common.DriverId + ": Guide() : invalid guide direction " + Direction.ToString()); } // guide Dec switch (DevId) { case Common.eDeviceId.ALT: if (Duration > 0 && GuideEnabled) { Scope.isGuiding = true; DecTimer.Interval = Duration; Common.SlewFixedRate(DevId, Dir, Rate); #if DEBUG DecStopWatch.Reset(); DecStopWatch.Start(); #endif DecTimer.Start(); #if DEBUG DecIntvlUpdt(Duration); DecIntvl = Duration; #endif } else { Common.SlewFixedRate(DevId, Dir, Common.eFixedRate.Rate0); } break; // guide Ra case Common.eDeviceId.AZM: if (Duration > 0 && GuideEnabled) { Scope.isGuiding = true; RaTimer.Interval = Duration; Common.SlewFixedRate(DevId, Dir, Rate); #if DEBUG RaStopWatch.Reset(); RaStopWatch.Start(); #endif RaTimer.Start(); #if DEBUG RaIntvlUpdt(Duration); RaIntvl = Duration; #endif } else { Common.SlewFixedRate(DevId, Dir, Common.eFixedRate.Rate0); } break; } }