Added an attempt to use the short format to set the TargetRightAscension if the long format fails.
This commit is contained in:
@@ -2518,6 +2518,7 @@ namespace Meade.net.Telescope.UnitTests
|
|||||||
{
|
{
|
||||||
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny<string>(), false)).Returns("0");
|
_sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny<string>(), false)).Returns("0");
|
||||||
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
|
_utilMock.Setup(x => x.HoursToHMS(It.IsAny<double>(), ":", ":", ":", It.IsAny<int>())).Returns("00:00:00.00");
|
||||||
|
_utilMock.Setup(x => x.HoursToHM(It.IsAny<double>(), ":", "", It.IsAny<int>())).Returns("00:00:00.00");
|
||||||
|
|
||||||
ConnectTelescope();
|
ConnectTelescope();
|
||||||
|
|
||||||
|
|||||||
@@ -3496,7 +3496,15 @@ namespace ASCOM.Meade.net
|
|||||||
if (value >= 24)
|
if (value >= 24)
|
||||||
throw new InvalidValueException("Right ascension value cannot be greater than 23:59:59");
|
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);
|
SharedResourcesWrapper.TargetRightAscension = _utilities.HMSToHours(hms);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user