From fa7106a1b464c279aaf66403234f92ce11175674 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Tue, 20 Sep 2022 12:47:24 +0100 Subject: [PATCH 1/2] Adding extra tests to ensure that GetTracking is working correctly for the AudoStar --- .../TelescopeUnitTests.cs | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 53f48eb..5e24340 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -2678,22 +2678,27 @@ namespace Meade.net.Telescope.UnitTests Assert.That(result, Is.EqualTo(DriveRates.driveSidereal)); } - [TestCase(DriveRates.driveSidereal, "60.1")] - [TestCase(DriveRates.driveSidereal, "60.0")] - [TestCase(DriveRates.driveLunar, "57.9")] - [TestCase(DriveRates.driveSidereal, "+60.1")] - [TestCase(DriveRates.driveSidereal, "+60.0")] - [TestCase(DriveRates.driveLunar, "+57.9")] - [TestCase(DriveRates.driveLunar, "57.3")] - [TestCase(DriveRates.driveLunar, "58.9")] - public void TrackingRate_Get_WhenConnected_ThenSendsCommandToTelescope(DriveRates rate, string trackingRate) + [TestCase(DriveRates.driveSidereal, "60.1", "Autostar", "43Eg")] + [TestCase(DriveRates.driveSidereal, "60.0", "Autostar", "43Eg")] + [TestCase(DriveRates.driveLunar, "57.9", "Autostar", "43Eg")] + [TestCase(DriveRates.driveSidereal, "+60.1", "Autostar", "43Eg")] + [TestCase(DriveRates.driveSidereal, "+60.0", "Autostar", "43Eg")] + [TestCase(DriveRates.driveLunar, "+57.9", "Autostar", "43Eg")] + [TestCase(DriveRates.driveLunar, "57.3", "Autostar", "43Eg")] + [TestCase(DriveRates.driveLunar, "58.9", "Autostar", "43Eg")] + [TestCase(DriveRates.driveSidereal, "60.1", "Autostar", "A4S4")] + [TestCase(DriveRates.driveSidereal, "60.0", "Autostar", "A4S4")] + [TestCase(DriveRates.driveLunar, "57.9", "Autostar", "A4S4")] + [TestCase(DriveRates.driveSidereal, "+60.1", "Autostar", "A4S4")] + [TestCase(DriveRates.driveSidereal, "+60.0", "Autostar", "A4S4")] + [TestCase(DriveRates.driveLunar, "+57.9", "Autostar", "A4S4")] + [TestCase(DriveRates.driveLunar, "57.3", "Autostar", "A4S4")] + [TestCase(DriveRates.driveLunar, "58.9", "Autostar", "A4S4")] + public void TrackingRate_Get_WhenConnected_ThenSendsCommandToTelescope(DriveRates rate, string trackingRate, string productName, string firmware) { _siderealTrackingRate = trackingRate; - string productName = TelescopeList.Autostar497; - string firmwareVersion = TelescopeList.Autostar497_43Eg; - - ConnectTelescope(productName, firmwareVersion); + ConnectTelescope(productName, firmware); _telescope.TrackingRate = rate; From e851fd0e018077dd096876b4948301b2b44ba0a5 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sun, 25 Sep 2022 17:04:24 +0100 Subject: [PATCH 2/2] Adding support for Audiostar to be returned as a Synonym of Autostar for GW detection. --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 12 +++++++----- Meade.net.Telescope/Telescope.cs | 2 +- Meade.net/TelescopeList.cs | 3 +++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 5e24340..28dca9c 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -1118,15 +1118,17 @@ namespace Meade.net.Telescope.UnitTests Assert.That(result, Is.False); } - [TestCase(TelescopeList.Autostar497_30Ee, false)] - [TestCase(TelescopeList.Autostar497_43Eg, true)] - public void CanSetTracking_Get_ReturnsTrueIffGWCommandIsSupported(string firmware, bool supported) + [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_30Ee, false)] + [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, true)] + [TestCase(TelescopeList.Audiostar, TelescopeList.AudioStar_A4S4, true)] + [TestCase(TelescopeList.Audiostar, TelescopeList.AudioStar_A4S4, true)] + public void CanSetTracking_Get_ReturnsTrueIffGWCommandIsSupported(string product, string firmware, bool expectedSupported) { - ConnectTelescope(firmwareVersion: firmware); + ConnectTelescope(product,firmware); var result = _telescope.CanSetTracking; - Assert.That(result, Is.EqualTo(supported)); + Assert.That(result, Is.EqualTo(expectedSupported)); } [Test] diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index a224e77..d901a05 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -1,5 +1,4 @@ #define Telescope - using System; using System.Collections; using System.Collections.Generic; @@ -769,6 +768,7 @@ namespace ASCOM.Meade.net { case TelescopeList.LX200CLASSIC: return false; + case TelescopeList.Audiostar: case TelescopeList.Autostar497: return FirmwareIsGreaterThan(TelescopeList.Autostar497_43Eg); case TelescopeList.LX200GPS: diff --git a/Meade.net/TelescopeList.cs b/Meade.net/TelescopeList.cs index 082ed89..59514cd 100644 --- a/Meade.net/TelescopeList.cs +++ b/Meade.net/TelescopeList.cs @@ -4,6 +4,7 @@ { #region Autostar 497/Audiostar + public const string Audiostar = "Audiostar"; //This is a synonym for Autostar which can be returned by some of the Audiostar firmware revisions A1f7 public const string Autostar497 = "Autostar"; //Autostar/Audiostar firmware revisions @@ -14,6 +15,8 @@ // ReSharper disable once InconsistentNaming public const string Autostar497_43Eg = "43Eg"; + // ReSharper disable once InconsistentNaming + public const string AudioStar_A1F7 = "A1F7"; // ReSharper disable once InconsistentNaming public const string AudioStar_A4S4 = "A4S4"; #endregion