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:
2019-10-04 18:20:32 +01:00
parent 5df0e21a58
commit 9af0613183
2 changed files with 119 additions and 50 deletions
+48 -8
View File
@@ -9,6 +9,9 @@
#define UseChooser
using System;
using System.Linq;
using System.Threading;
using ASCOM.DeviceInterface;
using ASCOM.DriverAccess;
namespace ASCOM.Meade.net
@@ -18,17 +21,17 @@ namespace ASCOM.Meade.net
public static void Main()
{
// Uncomment the code that's required
#if UseChooser
//#if UseChooser
// choose the device
string id = Telescope.Choose("ASCOM.MeadeGeneric.Telescope");
string id = Telescope.Choose("ASCOM.Meade.net.Telescope");
if (string.IsNullOrEmpty(id))
return;
// create this device
Telescope device = new Telescope(id);
#else
//#else
// 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");
#endif
//ASCOM.DriverAccess.Telescope device = new ASCOM.DriverAccess.Telescope("ASCOM.Meade.net.Telescope");
//#endif
// now run some tests, adding code to your driver so that the tests will pass.
// these first tests are common to all drivers.
@@ -50,9 +53,46 @@ namespace ASCOM.Meade.net
//Console.WriteLine($"Ra {device.RightAscension}");
//Console.WriteLine($"Dec {device.Declination}");
Console.WriteLine($"Altitude {device.Altitude}");
Console.WriteLine($"Azimuth {device.Azimuth}");
//Console.WriteLine($"Altitude {device.Altitude}");
//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;
Console.WriteLine("Press Enter to finish");
Console.ReadLine();