Unit tests for TargetDeclination

This commit is contained in:
2019-07-16 22:03:56 +01:00
parent ee60613a95
commit 0ac7b8b7bd
2 changed files with 152 additions and 6 deletions
+8 -6
View File
@@ -309,8 +309,10 @@ namespace ASCOM.Meade.net
SetLongFormat(true);
_userNewerPulseGuiding = IsNewPulseGuidingSupported();
LogMessage("Connected Set", $"New Pulse Guiding Supported: {_userNewerPulseGuiding}");
_targetDeclination = INVALID_PARAMETER;
_targetRightAscension = INVALID_PARAMETER;
LogMessage("Connected Set", $"New Pulse Guiding Supported: {_userNewerPulseGuiding}");
IsConnected = true;
}
catch (Exception)
@@ -1601,7 +1603,7 @@ namespace ASCOM.Meade.net
//:CM# Synchronizes the telescope's position with the currently selected database object's coordinates.
//Returns:
//LX200's - a "#" terminated string with the name of the object that was synced.
// Autostars & Autostar II - At static string: " M31 EX GAL MAG 3.5 SZ178.0'#"
// Autostars & Autostar II - A static string: " M31 EX GAL MAG 3.5 SZ178.0'#"
if (result == string.Empty)
throw new ASCOM.InvalidOperationException("Unable to perform sync");
@@ -1630,16 +1632,16 @@ namespace ASCOM.Meade.net
set
{
LogMessage("TargetDeclination Set", $"{value}");
CheckConnected("TargetDeclination Set");
//todo implement low precision version of this.
if (value > 90)
throw new ASCOM.InvalidValueException("Declination cannot be greater than 90.");
if (value < -90)
throw new ASCOM.InvalidValueException("Declination cannot be less than -90.");
CheckConnected("TargetDeclination Set");
var dms = _utilities.DegreesToDMS(value, "*", ":", ":", 2);
var s = value < 0 ? string.Empty : "+";