From e93da7343191db6e6d8f0e4a328174a84511055b Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Thu, 10 Nov 2022 14:43:41 +0000 Subject: [PATCH] Tried trimming a traingin : if it exists, that should not be part of the command sent to the scope. --- Meade.net.Telescope/Telescope.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 8a555fe..e74f794 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -3496,15 +3496,7 @@ namespace ASCOM.Meade.net if (value >= 24) throw new InvalidValueException("Right ascension value cannot be greater than 23:59:59"); - string hms; - try - { - hms = SetTargetRightAscension(value, SharedResourcesWrapper.IsLongFormat); - } - catch(InvalidOperationException) - { - hms = SetTargetRightAscension(value, !SharedResourcesWrapper.IsLongFormat); - } + var hms = SetTargetRightAscension(value, SharedResourcesWrapper.IsLongFormat); SharedResourcesWrapper.TargetRightAscension = _utilities.HMSToHours(hms); } @@ -3522,6 +3514,8 @@ namespace ASCOM.Meade.net ? _utilities.HoursToHMS(value, ":", ":", ":", _digitsRa) : _utilities.HoursToHM(value, ":", "", _digitsRa).Replace(',', '.'); + hms = hms.TrimEnd(':'); + var command = $"Sr{hms}"; LogMessage("TargetRightAscension Set", $"{command}"); var response = SharedResourcesWrapper.SendChar(Tl, command);