Added support for RCX400 using newer pulse guiding commands.
Refactored the connect set to be a little less cluttered.
This commit is contained in:
@@ -638,7 +638,8 @@ namespace Meade.net.Telescope.UnitTests
|
|||||||
[TestCase("Auto", ":GVP", "", false)] //LX200 Classic
|
[TestCase("Auto", ":GVP", "", false)] //LX200 Classic
|
||||||
[TestCase("Guide Rate Slew", "LX2001", "", false)] //force old style
|
[TestCase("Guide Rate Slew", "LX2001", "", false)] //force old style
|
||||||
[TestCase("Pulse Guiding", ":GVP", "", true)] //force new style
|
[TestCase("Pulse Guiding", ":GVP", "", true)] //force new style
|
||||||
|
[TestCase("Auto", "RCX400", "2.1i", false)] //don't what the real minimum firmware is.
|
||||||
|
[TestCase("Auto", "RCX400", "2.2i", true)]
|
||||||
public void IsNewPulseGuidingSupported_ThenIsSupported_ThenReturnsTrue(string guidingStyle, string productName, string firmware, bool isSupported)
|
public void IsNewPulseGuidingSupported_ThenIsSupported_ThenReturnsTrue(string guidingStyle, string productName, string firmware, bool isSupported)
|
||||||
{
|
{
|
||||||
_profileProperties.GuidingStyle = guidingStyle;
|
_profileProperties.GuidingStyle = guidingStyle;
|
||||||
|
|||||||
@@ -522,39 +522,7 @@ namespace ASCOM.Meade.net
|
|||||||
SharedResourcesWrapper.TargetDeclination = InvalidParameter;
|
SharedResourcesWrapper.TargetDeclination = InvalidParameter;
|
||||||
SharedResourcesWrapper.TargetRightAscension = InvalidParameter;
|
SharedResourcesWrapper.TargetRightAscension = InvalidParameter;
|
||||||
|
|
||||||
LogMessage("Connected Set", $"SendDateTime: {_profileProperties.SendDateTime}");
|
SendTimeTimeToHandbox();
|
||||||
if (_profileProperties.SendDateTime)
|
|
||||||
{
|
|
||||||
if (SharedResourcesWrapper.ProductName == TelescopeList.LX200GPS)
|
|
||||||
{
|
|
||||||
LogMessage("Connected Set",
|
|
||||||
$"LX200GPS Detecting if daylight savings message on screen: {_profileProperties.SendDateTime}");
|
|
||||||
var displayText = Action("Handbox", "readdisplay");
|
|
||||||
LogMessage("Connected Set", $"Current Handset display: {displayText}");
|
|
||||||
if (displayText.Contains("Daylight"))
|
|
||||||
{
|
|
||||||
LogMessage("Connected Set",
|
|
||||||
$"LX200GPS Setting Date time and bypassing settings screens: {_profileProperties.SendDateTime}");
|
|
||||||
BypassHandboxEntryForAutostarII();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LogMessage("Connected Set",
|
|
||||||
$"LX200GPS Sending current date and time: {_profileProperties.SendDateTime}");
|
|
||||||
SendCurrentDateTime("Connect");
|
|
||||||
LogMessage("Connected Set",
|
|
||||||
$"LX200GPS Attempting manual bypass of prompts: {_profileProperties.SendDateTime}");
|
|
||||||
ApplySkipAutoStarPrompts("Connect");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LogMessage("Connected Set", "Autostar Attempting manual bypass of prompts");
|
|
||||||
ApplySkipAutoStarPrompts("Connect");
|
|
||||||
SendCurrentDateTime("Connect");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SharedResources.AlignmentMode = AlignmentMode;
|
SharedResources.AlignmentMode = AlignmentMode;
|
||||||
}
|
}
|
||||||
@@ -606,6 +574,42 @@ namespace ASCOM.Meade.net
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SendTimeTimeToHandbox()
|
||||||
|
{
|
||||||
|
LogMessage("SendTimeTimeToHandbox", $"SendDateTime: {_profileProperties.SendDateTime}");
|
||||||
|
if (_profileProperties.SendDateTime)
|
||||||
|
{
|
||||||
|
if (SharedResourcesWrapper.ProductName == TelescopeList.LX200GPS)
|
||||||
|
{
|
||||||
|
LogMessage("SendTimeTimeToHandbox",
|
||||||
|
$"LX200GPS Detecting if daylight savings message on screen: {_profileProperties.SendDateTime}");
|
||||||
|
var displayText = Action("Handbox", "readdisplay");
|
||||||
|
LogMessage("SendTimeTimeToHandbox", $"Current Handset display: {displayText}");
|
||||||
|
if (displayText.Contains("Daylight"))
|
||||||
|
{
|
||||||
|
LogMessage("SendTimeTimeToHandbox",
|
||||||
|
$"LX200GPS Setting Date time and bypassing settings screens: {_profileProperties.SendDateTime}");
|
||||||
|
BypassHandboxEntryForAutostarII();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogMessage("SendTimeTimeToHandbox",
|
||||||
|
$"LX200GPS Sending current date and time: {_profileProperties.SendDateTime}");
|
||||||
|
SendCurrentDateTime();
|
||||||
|
LogMessage("SendTimeTimeToHandbox",
|
||||||
|
$"LX200GPS Attempting manual bypass of prompts: {_profileProperties.SendDateTime}");
|
||||||
|
ApplySkipAutoStarPrompts();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogMessage("Connected Set", "Autostar Attempting manual bypass of prompts");
|
||||||
|
ApplySkipAutoStarPrompts();
|
||||||
|
SendCurrentDateTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool IsStarPatch()
|
private bool IsStarPatch()
|
||||||
{
|
{
|
||||||
var isStarPatch = false;
|
var isStarPatch = false;
|
||||||
@@ -633,7 +637,7 @@ namespace ASCOM.Meade.net
|
|||||||
return isStarPatch;
|
return isStarPatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SendCurrentDateTime(string connect)
|
private void SendCurrentDateTime()
|
||||||
{
|
{
|
||||||
if (_profileProperties.SendDateTime)
|
if (_profileProperties.SendDateTime)
|
||||||
{
|
{
|
||||||
@@ -641,9 +645,9 @@ namespace ASCOM.Meade.net
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ApplySkipAutoStarPrompts(string connect)
|
private void ApplySkipAutoStarPrompts()
|
||||||
{
|
{
|
||||||
if (SharedResourcesWrapper.ProductName == TelescopeList.LX200GPS)
|
if (SharedResourcesWrapper.ProductName == TelescopeList.LX200GPS || SharedResourcesWrapper.ProductName == TelescopeList.RCX400)
|
||||||
{
|
{
|
||||||
var displayText = Action("Handbox", "readdisplay");
|
var displayText = Action("Handbox", "readdisplay");
|
||||||
|
|
||||||
@@ -715,6 +719,11 @@ namespace ASCOM.Meade.net
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SharedResourcesWrapper.ProductName == TelescopeList.RCX400)
|
||||||
|
{
|
||||||
|
return FirmwareIsGreaterThan(TelescopeList.RCX400_22I);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -755,6 +764,8 @@ namespace ASCOM.Meade.net
|
|||||||
return FirmwareIsGreaterThan(TelescopeList.Autostar497_43Eg);
|
return FirmwareIsGreaterThan(TelescopeList.Autostar497_43Eg);
|
||||||
case TelescopeList.LX200GPS:
|
case TelescopeList.LX200GPS:
|
||||||
return FirmwareIsGreaterThan(TelescopeList.LX200GPS_42G);
|
return FirmwareIsGreaterThan(TelescopeList.LX200GPS_42G);
|
||||||
|
case TelescopeList.RCX400:
|
||||||
|
return FirmwareIsGreaterThan(TelescopeList.RCX400_22I);
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -769,7 +780,7 @@ namespace ASCOM.Meade.net
|
|||||||
private bool FirmwareIsGreaterThan(string minVersion)
|
private bool FirmwareIsGreaterThan(string minVersion)
|
||||||
{
|
{
|
||||||
var currentVersion = SharedResourcesWrapper.FirmwareVersion;
|
var currentVersion = SharedResourcesWrapper.FirmwareVersion;
|
||||||
var comparison = string.Compare(currentVersion, minVersion, StringComparison.Ordinal);
|
var comparison = string.Compare(currentVersion, minVersion, StringComparison.OrdinalIgnoreCase);
|
||||||
return comparison >= 0;
|
return comparison >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,5 +32,13 @@
|
|||||||
// ReSharper disable once InconsistentNaming
|
// ReSharper disable once InconsistentNaming
|
||||||
public const string LX200CLASSIC = "LX200 Classic"; //GVP command is not supported!
|
public const string LX200CLASSIC = "LX200 Classic"; //GVP command is not supported!
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region RCX400
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
|
public const string RCX400 = "RCX400";
|
||||||
|
|
||||||
|
public const string RCX400_22I = "2.2i";
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user