From ad40eb8b9ae8b9f13b959678b3e2a70d8347e499 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Fri, 23 Apr 2021 20:45:48 +0100 Subject: [PATCH] Fixed problem with Autostar not returning the correct value for IsSlewing --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 1 + Meade.net.Telescope/Telescope.cs | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 1a2c74a..ae762b7 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -2410,6 +2410,7 @@ namespace Meade.net.Telescope.UnitTests [TestCase(TelescopeList.LX200CLASSIC, "", "[FF][FF][FF][FF][FF][FF][FF][FF][FF][FF][FF][FF][FF][FF] [FF][FF][FF][FF][FF][FF]", false)] //The test case below is this same string encoded to return exactly what the telescope will return. [TestCase(TelescopeList.LX200CLASSIC, "", "\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff\x00ff \x00ff\x00ff\x00ff\x00ff\x00ff\x00ff", false)] [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, "|", true)] + [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, "\u007f", true)] [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, "", false)] public void Slewing_WhenTelescopeNotSlewing_ThenReturnsFalse(string productName, string firmwareVersion, string response, bool isSlewing) { diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 1cb7ec9..a6e8271 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -483,7 +483,7 @@ namespace ASCOM.Meade.net else if (SharedResourcesWrapper.ProductName == TelescopeList.Autostar497) { var displayText = Action("Handbox", "readdisplay"); - if (displayText.Contains("€Press 0 to Alignor MODE for Menu")) + if (displayText.Contains("Press 0 to Alignor MODE for Menu")) { for (var i = 0; i < 4; i++) { @@ -2107,6 +2107,12 @@ namespace ASCOM.Meade.net return isSlewing; } + if (result.Contains("\u007f")) + { + isSlewing = true; + return isSlewing; + } + ////classic LX200 return bar with 32 chars. FF is contained from left to right when slewing //byte[] ba = Encoding.Default.GetBytes(result); ////replace fill chars not belonging to a slew bar. Are there others? The bar character is a FF in hex.