From 5678285e0e62079e29f106c700ddbf87eb760950 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Mon, 2 Jan 2023 09:31:05 +0000 Subject: [PATCH] Added unit test to make sure that the LX200GPS with german firmware works as expected. --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 2 +- Meade.net.Telescope/Telescope.cs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 9344b10..f8f66fb 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -791,12 +791,12 @@ namespace Meade.net.Telescope.UnitTests Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: AlignmentMode Get")); } - [TestCase("A", AlignmentModes.algAltAz, TelescopeList.Autostar497, TelescopeList.Autostar497_31Ee)] [TestCase("P", AlignmentModes.algPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_31Ee)] [TestCase("A", AlignmentModes.algAltAz, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)] [TestCase("P", AlignmentModes.algPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)] [TestCase("G", AlignmentModes.algGermanPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)] + [TestCase("P", AlignmentModes.algPolar, TelescopeList.LX200GPS, TelescopeList.LX200GPS_4G0M)] public void AlignmentMode_Get_WhenScopeInAltAz_ReturnsAltAz(string telescopeMode, AlignmentModes alignmentMode, string productName, string firmware) { _testProperties.AlignmentMode = telescopeMode; diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index d35e2ea..5d1bc68 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -1102,7 +1102,7 @@ namespace ASCOM.Meade.net LogMessage("AlignmentMode Get", $"Sending Ack code."); var alignmentString = GetAlignmentString(); AlignmentModes alignmentMode; - switch (alignmentString) + switch (alignmentString.ToUpperInvariant()) { case "A": LogMessage("AlignmentMode Get", $"Telescope is in AltAz"); @@ -1116,9 +1116,10 @@ namespace ASCOM.Meade.net LogMessage("AlignmentMode Get", $"Telescope is in Land mode"); alignmentMode = AlignmentModes.algAltAz; break; - //case "G": - //alignmentMode = AlignmentModes.algGermanPolar; - //break; + case "G": + LogMessage("AlignmentMode Get", $"Telescope is in German Polar mode"); + alignmentMode = AlignmentModes.algGermanPolar; + break; default: var msg = $"unknown alignment returned from telescope: {alignmentString}"; LogMessage("AlignmentMode Get", msg);