Pulse guiding support added
This commit is contained in:
@@ -620,8 +620,9 @@ namespace ASCOM.MeadeAutostar497
|
||||
{
|
||||
get
|
||||
{
|
||||
tl.LogMessage("IsPulseGuiding Get", "Not implemented");
|
||||
throw new ASCOM.PropertyNotImplementedException("IsPulseGuiding", false);
|
||||
tl.LogMessage("IsPulseGuiding Get", "pulse guiding is synchronous for this driver");
|
||||
//throw new ASCOM.PropertyNotImplementedException("IsPulseGuiding", false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,8 +640,8 @@ namespace ASCOM.MeadeAutostar497
|
||||
|
||||
public void PulseGuide(GuideDirections Direction, int Duration)
|
||||
{
|
||||
tl.LogMessage("PulseGuide", "Not implemented");
|
||||
throw new ASCOM.MethodNotImplementedException("PulseGuide");
|
||||
tl.LogMessage("PulseGuide", $"pulse guide direction {Direction} duration {Duration}");
|
||||
_telescopeController.PulseGuide(Direction, Duration);
|
||||
}
|
||||
|
||||
public double RightAscension
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using ASCOM.DeviceInterface;
|
||||
|
||||
namespace ASCOM.MeadeAutostar497.Controller
|
||||
{
|
||||
@@ -12,5 +13,6 @@ namespace ASCOM.MeadeAutostar497.Controller
|
||||
double SiteLatitude { get; set; }
|
||||
double SiteLongitude { get; set; }
|
||||
void AbortSlew();
|
||||
void PulseGuide(GuideDirections direction, int duration);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using ASCOM.DeviceInterface;
|
||||
|
||||
namespace ASCOM.MeadeAutostar497.Controller
|
||||
{
|
||||
@@ -250,5 +252,44 @@ namespace ASCOM.MeadeAutostar497.Controller
|
||||
{
|
||||
SerialPort.Command("#:Q#");
|
||||
}
|
||||
|
||||
public void PulseGuide(GuideDirections direction, int duration)
|
||||
{
|
||||
string d = string.Empty;
|
||||
switch (direction)
|
||||
{
|
||||
case GuideDirections.guideEast:
|
||||
d = "e";
|
||||
break;
|
||||
case GuideDirections.guideNorth:
|
||||
d = "n";
|
||||
break;
|
||||
case GuideDirections.guideSouth:
|
||||
d = "s";
|
||||
break;
|
||||
case GuideDirections.guideWest:
|
||||
d = "w";
|
||||
break;
|
||||
}
|
||||
|
||||
if (UserNewerPulseGuiding)
|
||||
{
|
||||
_serialPort.Command($":Mg{d}{duration:0000}#");
|
||||
Thread.Sleep(duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
_serialPort.Command(":RG#"); //Make sure we are at guide rate
|
||||
_serialPort.Command($":M{d}#");
|
||||
Thread.Sleep(duration);
|
||||
_serialPort.Command($":Q{d}#");
|
||||
|
||||
//classic only !!!, this is needed since once in a while one is not enough
|
||||
Thread.Sleep(200);
|
||||
_serialPort.Command($":Q{d}#");
|
||||
}
|
||||
}
|
||||
|
||||
public bool UserNewerPulseGuiding { get; set; } = true; //todo make this a device setting
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user