Fixed problem with Autostar not returning the correct value for IsSlewing

This commit is contained in:
2021-04-23 20:45:48 +01:00
parent aca01de4ee
commit ad40eb8b9a
2 changed files with 8 additions and 1 deletions
@@ -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, "", "[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.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, "|", true)]
[TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, "\u007f", true)]
[TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, "", false)] [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, "", false)]
public void Slewing_WhenTelescopeNotSlewing_ThenReturnsFalse(string productName, string firmwareVersion, string response, bool isSlewing) public void Slewing_WhenTelescopeNotSlewing_ThenReturnsFalse(string productName, string firmwareVersion, string response, bool isSlewing)
{ {
+7 -1
View File
@@ -483,7 +483,7 @@ namespace ASCOM.Meade.net
else if (SharedResourcesWrapper.ProductName == TelescopeList.Autostar497) else if (SharedResourcesWrapper.ProductName == TelescopeList.Autostar497)
{ {
var displayText = Action("Handbox", "readdisplay"); 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++) for (var i = 0; i < 4; i++)
{ {
@@ -2107,6 +2107,12 @@ namespace ASCOM.Meade.net
return isSlewing; 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 ////classic LX200 return bar with 32 chars. FF is contained from left to right when slewing
//byte[] ba = Encoding.Default.GetBytes(result); //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. ////replace fill chars not belonging to a slew bar. Are there others? The bar character is a FF in hex.