From 554b1af082c049c143f0f3401d48ae86ea3abf48 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sat, 7 May 2022 19:37:16 +0100 Subject: [PATCH] Maybe this is what's missing to get the telescope to park --- .../TelescopeUnitTests.cs | 16 +++++++------- Meade.net.Telescope/Telescope.cs | 21 +++++++------------ 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 36ff739..12eaea1 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -2715,15 +2715,15 @@ namespace Meade.net.Telescope.UnitTests Assert.That(_telescope.Tracking, Is.True); } - [TestCase(true)] - [TestCase(false)] - public void Tracking_Set_WhenCanSetTrackingIsFalse_ThenThrowsNotImplementedException(bool tracking) - { - // GW is not supported, so CanSetTracking is false - ConnectTelescope(firmwareVersion: TelescopeList.Autostar497_30Ee); + //[TestCase(true)] + //[TestCase(false)] + //public void Tracking_Set_WhenCanSetTrackingIsFalse_ThenThrowsNotImplementedException(bool tracking) + //{ + // // GW is not supported, so CanSetTracking is false + // ConnectTelescope(firmwareVersion: TelescopeList.Autostar497_30Ee); - Assert.Throws( () => { _telescope.Tracking = tracking; } ); - } + // Assert.Throws( () => { _telescope.Tracking = tracking; } ); + //} [TestCase(true, "AP")] [TestCase(false, "AL")] diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index ac62ae2..55d1b0a 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -1782,17 +1782,10 @@ namespace ASCOM.Meade.net else { LogMessage("Park", $"Parking LX200 Classic"); - //LogMessage("Park", $"Setting Telescope to land targets."); - //try - //{ - // SharedResourcesWrapper.SendBlind("AL"); //todo need to route this to the real commands. - // _utilities.WaitForMilliseconds(1000); //Need to wait 1 second according to old driver. - //} - //catch (Exception ex) - //{ - // LogMessage("Park", $"AL command failed: {ex.Message}"); - //} + + Tracking = false; + LogMessage("Park", $"Calculating Park Altitude"); var parkAlt = AlignmentMode == AlignmentModes.algAltAz ? 0 : 90 - SiteLatitude; LogMessage("Park", $"Slewing to park position az:0 alt:{parkAlt}"); SlewToAltAz(0, parkAlt, false); @@ -2812,10 +2805,10 @@ namespace ASCOM.Meade.net } set { - if (!CanSetTracking) - { - throw new ASCOM.NotImplementedException("Tracking Set"); - } + //if (!CanSetTracking) + //{ + // throw new ASCOM.NotImplementedException("Tracking Set"); + //} LogMessage("Tracking Set", $"{value}"); SharedResourcesWrapper.SendBlind(value ? "AP" : "AL"); //todo need to route this to the real commands.