public void CloseShutter() { #region debug debugger.WriteLine(Common.Debugger.DebugLevel.DebugASCOM, "CloseShutter"); #endregion wisedome.CloseShutter(); }
public void Abort() { pulseGuideCTS.Cancel(); pulseGuideCTS = new CancellationTokenSource(); #region debug debugger.WriteLine(Common.Debugger.DebugLevel.DebugLogic, "Aborted PulseGuiding"); #endregion }
public ShortestDistanceResult ShortestDistance(Angle other) { Angle incSide, decSide; ShortestDistanceResult result = new ShortestDistanceResult(); Debugger debugger = Debugger.Instance; if (other == this) { return(new ShortestDistanceResult(new Angle(0.0, this._type), Const.AxisDirection.None)); } if (_periodic) { if (other > this) { decSide = other - this; incSide = this + ((_isHMS) ? Angle.FromHours(_highest - other.Hours, this._type) : Angle.FromRadians(_highest - other.Radians, this._type)); } else { decSide = other + ((_isHMS) ? Angle.FromHours(_highest - this.Hours, this._type) : Angle.FromRadians(_highest - this.Radians, this._type)); incSide = this - other; } if (incSide < decSide) { result.angle = incSide; result.direction = Const.AxisDirection.Decreasing; } else { result.angle = decSide; result.direction = Const.AxisDirection.Increasing; } result.angle._type = this._type; } else { result.angle = Angle.FromRadians(Math.Abs(this.Radians - other.Radians), this._type); result.direction = (this.Radians > other.Radians) ? Const.AxisDirection.Decreasing : Const.AxisDirection.Increasing; } debugger.WriteLine(Debugger.DebugLevel.DebugDevice, "ShortestDistance: {0} -> {1} ==> {2} {3}", this, other, result.angle, result.direction); return(result); }
public void Run() { Stopwatch sw = new Stopwatch(); sw.Start(); _motor.SetOn(Const.rateGuide); while (sw.ElapsedMilliseconds < _duration) { if (Pulsing.pulseGuideCT.IsCancellationRequested) { #region debug debugger.WriteLine(Common.Debugger.DebugLevel.DebugLogic, "PulserTask on {0} aborted after {1} millis.", _axis.ToString(), sw.ElapsedMilliseconds); #endregion break; } Thread.Sleep(10); } _motor.SetOff(); sw.Stop(); }