Modified how the old guiding method is implmented - it's now much simplified and uses the same move axis commands as normal slewing, which is what it does under the hood anyway.
This commit is contained in:
@@ -1374,6 +1374,10 @@ namespace ASCOM.Meade.net
|
|||||||
Declination = Declination
|
Declination = Declination
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (_userNewerPulseGuiding && duration < 10000)
|
||||||
|
{
|
||||||
string d = string.Empty;
|
string d = string.Empty;
|
||||||
switch (direction)
|
switch (direction)
|
||||||
{
|
{
|
||||||
@@ -1391,8 +1395,6 @@ namespace ASCOM.Meade.net
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_userNewerPulseGuiding && duration < 10000)
|
|
||||||
{
|
|
||||||
LogMessage("PulseGuide", "Using new pulse guiding technique");
|
LogMessage("PulseGuide", "Using new pulse guiding technique");
|
||||||
_sharedResourcesWrapper.SendBlind($"#:Mg{d}{duration:0000}#");
|
_sharedResourcesWrapper.SendBlind($"#:Mg{d}{duration:0000}#");
|
||||||
//:MgnDDDD#
|
//:MgnDDDD#
|
||||||
@@ -1407,32 +1409,59 @@ namespace ASCOM.Meade.net
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LogMessage("PulseGuide", "Using old pulse guiding technique");
|
string d = string.Empty;
|
||||||
_sharedResourcesWrapper.Lock(() =>
|
switch (direction)
|
||||||
{
|
{
|
||||||
_sharedResourcesWrapper.SendBlind("#:RG#"); //Make sure we are at guide rate
|
case GuideDirections.guideEast:
|
||||||
//:RG# Set Slew rate to Guiding Rate (slowest)
|
MoveAxis(TelescopeAxes.axisPrimary, 1);
|
||||||
//Returns: Nothing
|
|
||||||
_sharedResourcesWrapper.SendBlind($"#:M{d}#");
|
|
||||||
//:Me# Move Telescope East at current slew rate
|
|
||||||
//Returns: Nothing
|
|
||||||
//:Mn# Move Telescope North at current slew rate
|
|
||||||
//Returns: Nothing
|
|
||||||
//:Ms# Move Telescope South at current slew rate
|
|
||||||
//Returns: Nothing
|
|
||||||
//:Mw# Move Telescope West at current slew rate
|
|
||||||
//Returns: Nothing
|
|
||||||
_utilities.WaitForMilliseconds(duration);
|
_utilities.WaitForMilliseconds(duration);
|
||||||
_sharedResourcesWrapper.SendBlind($"#:Q{d}#");
|
MoveAxis(TelescopeAxes.axisPrimary, 0);
|
||||||
//:Qe# Halt eastward Slews
|
break;
|
||||||
//Returns: Nothing
|
case GuideDirections.guideNorth:
|
||||||
//:Qn# Halt northward Slews
|
MoveAxis(TelescopeAxes.axisSecondary, 1);
|
||||||
//Returns: Nothing
|
_utilities.WaitForMilliseconds(duration);
|
||||||
//:Qs# Halt southward Slews
|
MoveAxis(TelescopeAxes.axisSecondary, 0);
|
||||||
//Returns: Nothing
|
break;
|
||||||
//:Qw# Halt westward Slews
|
case GuideDirections.guideSouth:
|
||||||
//Returns: Nothing
|
MoveAxis(TelescopeAxes.axisSecondary, -1);
|
||||||
});
|
_utilities.WaitForMilliseconds(duration);
|
||||||
|
MoveAxis(TelescopeAxes.axisSecondary, 0);
|
||||||
|
break;
|
||||||
|
case GuideDirections.guideWest:
|
||||||
|
MoveAxis(TelescopeAxes.axisPrimary, -1);
|
||||||
|
_utilities.WaitForMilliseconds(duration);
|
||||||
|
MoveAxis(TelescopeAxes.axisPrimary, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//LogMessage("PulseGuide", "Using old pulse guiding technique");
|
||||||
|
//_sharedResourcesWrapper.Lock(() =>
|
||||||
|
//{
|
||||||
|
// _sharedResourcesWrapper.SendBlind("#:RG#"); //Make sure we are at guide rate
|
||||||
|
// //:RG# Set Slew rate to Guiding Rate (slowest)
|
||||||
|
// //Returns: Nothing
|
||||||
|
// _sharedResourcesWrapper.SendBlind($"#:M{d}#");
|
||||||
|
// //:Me# Move Telescope East at current slew rate
|
||||||
|
// //Returns: Nothing
|
||||||
|
// //:Mn# Move Telescope North at current slew rate
|
||||||
|
// //Returns: Nothing
|
||||||
|
// //:Ms# Move Telescope South at current slew rate
|
||||||
|
// //Returns: Nothing
|
||||||
|
// //:Mw# Move Telescope West at current slew rate
|
||||||
|
// //Returns: Nothing
|
||||||
|
// _utilities.WaitForMilliseconds(duration);
|
||||||
|
// _sharedResourcesWrapper.SendBlind($"#:Q{d}#");
|
||||||
|
// //:Qe# Halt eastward Slews
|
||||||
|
// //Returns: Nothing
|
||||||
|
// //:Qn# Halt northward Slews
|
||||||
|
// //Returns: Nothing
|
||||||
|
// //:Qs# Halt southward Slews
|
||||||
|
// //Returns: Nothing
|
||||||
|
// //:Qw# Halt westward Slews
|
||||||
|
// //Returns: Nothing
|
||||||
|
//});
|
||||||
}
|
}
|
||||||
|
|
||||||
var coordinatesAfterMove = new EquatorialCoordinates
|
var coordinatesAfterMove = new EquatorialCoordinates
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
#define UseChooser
|
#define UseChooser
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
using ASCOM.DeviceInterface;
|
||||||
using ASCOM.DriverAccess;
|
using ASCOM.DriverAccess;
|
||||||
|
|
||||||
namespace ASCOM.Meade.net
|
namespace ASCOM.Meade.net
|
||||||
@@ -18,17 +21,17 @@ namespace ASCOM.Meade.net
|
|||||||
public static void Main()
|
public static void Main()
|
||||||
{
|
{
|
||||||
// Uncomment the code that's required
|
// Uncomment the code that's required
|
||||||
#if UseChooser
|
//#if UseChooser
|
||||||
// choose the device
|
// choose the device
|
||||||
string id = Telescope.Choose("ASCOM.MeadeGeneric.Telescope");
|
string id = Telescope.Choose("ASCOM.Meade.net.Telescope");
|
||||||
if (string.IsNullOrEmpty(id))
|
if (string.IsNullOrEmpty(id))
|
||||||
return;
|
return;
|
||||||
// create this device
|
// create this device
|
||||||
Telescope device = new Telescope(id);
|
Telescope device = new Telescope(id);
|
||||||
#else
|
//#else
|
||||||
// this can be replaced by this code, it avoids the chooser and creates the driver class directly.
|
// this can be replaced by this code, it avoids the chooser and creates the driver class directly.
|
||||||
ASCOM.DriverAccess.Telescope device = new ASCOM.DriverAccess.Telescope("ASCOM.Meade.net.Telescope");
|
//ASCOM.DriverAccess.Telescope device = new ASCOM.DriverAccess.Telescope("ASCOM.Meade.net.Telescope");
|
||||||
#endif
|
//#endif
|
||||||
// now run some tests, adding code to your driver so that the tests will pass.
|
// now run some tests, adding code to your driver so that the tests will pass.
|
||||||
// these first tests are common to all drivers.
|
// these first tests are common to all drivers.
|
||||||
|
|
||||||
@@ -50,8 +53,45 @@ namespace ASCOM.Meade.net
|
|||||||
//Console.WriteLine($"Ra {device.RightAscension}");
|
//Console.WriteLine($"Ra {device.RightAscension}");
|
||||||
//Console.WriteLine($"Dec {device.Declination}");
|
//Console.WriteLine($"Dec {device.Declination}");
|
||||||
|
|
||||||
Console.WriteLine($"Altitude {device.Altitude}");
|
//Console.WriteLine($"Altitude {device.Altitude}");
|
||||||
Console.WriteLine($"Azimuth {device.Azimuth}");
|
//Console.WriteLine($"Azimuth {device.Azimuth}");
|
||||||
|
|
||||||
|
var seconds = 10;
|
||||||
|
|
||||||
|
Console.WriteLine($"Slewing tests 10 second in each direction");
|
||||||
|
Console.WriteLine($"test 1");
|
||||||
|
device.MoveAxis(TelescopeAxes.axisPrimary, 4);
|
||||||
|
Thread.Sleep(seconds * 1000);
|
||||||
|
device.MoveAxis(TelescopeAxes.axisPrimary, 0);
|
||||||
|
Console.WriteLine($"test 2");
|
||||||
|
device.MoveAxis(TelescopeAxes.axisPrimary, -4);
|
||||||
|
Thread.Sleep(seconds * 1000);
|
||||||
|
device.MoveAxis(TelescopeAxes.axisPrimary, 0);
|
||||||
|
|
||||||
|
Console.WriteLine($"test 3");
|
||||||
|
device.MoveAxis(TelescopeAxes.axisSecondary, 4);
|
||||||
|
Thread.Sleep(seconds * 1000);
|
||||||
|
device.MoveAxis(TelescopeAxes.axisSecondary, 0);
|
||||||
|
|
||||||
|
Console.WriteLine($"test 4");
|
||||||
|
device.MoveAxis(TelescopeAxes.axisSecondary, -4);
|
||||||
|
Thread.Sleep(seconds * 1000);
|
||||||
|
device.MoveAxis(TelescopeAxes.axisSecondary, 0);
|
||||||
|
Console.WriteLine($"Slewing tests complete");
|
||||||
|
|
||||||
|
|
||||||
|
seconds = 120;
|
||||||
|
|
||||||
|
Console.WriteLine($"Guiding for {seconds} seconds!");
|
||||||
|
|
||||||
|
foreach( var direction in Enum.GetValues(typeof(GuideDirections)).Cast<GuideDirections>())
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{direction.ToString()}");
|
||||||
|
device.PulseGuide(direction, seconds* 1000);
|
||||||
|
}
|
||||||
|
Console.WriteLine($"Guiding Finished");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
device.Connected = false;
|
device.Connected = false;
|
||||||
Console.WriteLine("Press Enter to finish");
|
Console.WriteLine("Press Enter to finish");
|
||||||
|
|||||||
Reference in New Issue
Block a user