Added an attempt to use the short format to set the TargetRightAscension if the long format fails.

This commit is contained in:
2022-11-10 15:30:16 +00:00
parent 5c3bb7d4ad
commit 129fc23d83
2 changed files with 10 additions and 1 deletions
+9 -1
View File
@@ -3496,7 +3496,15 @@ namespace ASCOM.Meade.net
if (value >= 24)
throw new InvalidValueException("Right ascension value cannot be greater than 23:59:59");
var hms = SetTargetRightAscension(value, SharedResourcesWrapper.IsLongFormat);
string hms;
try
{
hms = SetTargetRightAscension(value, SharedResourcesWrapper.IsLongFormat);
}
catch (InvalidOperationException)
{
hms = SetTargetRightAscension(value, !SharedResourcesWrapper.IsLongFormat);
}
SharedResourcesWrapper.TargetRightAscension = _utilities.HMSToHours(hms);
}