From 1e5bb048170fd5ffa6f1f0c908a862b49c5771c5 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Thu, 10 Nov 2022 14:34:10 +0000 Subject: [PATCH 01/24] Added attempt to set the TargetRightAscension using the other format if one fails. --- Meade.net.Telescope/Telescope.cs | 46 +++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index d901a05..8a555fe 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -3496,22 +3496,15 @@ namespace ASCOM.Meade.net if (value >= 24) throw new InvalidValueException("Right ascension value cannot be greater than 23:59:59"); - var hms = SharedResourcesWrapper.IsLongFormat - ? _utilities.HoursToHMS(value, ":", ":", ":", _digitsRa) - : _utilities.HoursToHM(value, ":", "", _digitsRa).Replace(',', '.'); - - var command = $"Sr{hms}"; - LogMessage("TargetRightAscension Set", $"{command}"); - var response = SharedResourcesWrapper.SendChar(Tl, command); - //:SrHH:MM.T# - //:SrHH:MM:SS# - //Set target object RA to HH:MM.T or HH: MM: SS depending on the current precision setting. - // Returns: - //0 - Invalid - //1 - Valid - - if (response == "0") - throw new InvalidOperationException("Failed to set TargetRightAscension."); + string hms; + try + { + hms = SetTargetRightAscension(value, SharedResourcesWrapper.IsLongFormat); + } + catch(InvalidOperationException) + { + hms = SetTargetRightAscension(value, !SharedResourcesWrapper.IsLongFormat); + } SharedResourcesWrapper.TargetRightAscension = _utilities.HMSToHours(hms); } @@ -3523,6 +3516,27 @@ namespace ASCOM.Meade.net } } + private string SetTargetRightAscension(double value, bool useLongFormat) + { + var hms = useLongFormat + ? _utilities.HoursToHMS(value, ":", ":", ":", _digitsRa) + : _utilities.HoursToHM(value, ":", "", _digitsRa).Replace(',', '.'); + + var command = $"Sr{hms}"; + LogMessage("TargetRightAscension Set", $"{command}"); + var response = SharedResourcesWrapper.SendChar(Tl, command); + //:SrHH:MM.T# + //:SrHH:MM:SS# + //Set target object RA to HH:MM.T or HH: MM: SS depending on the current precision setting. + // Returns: + //0 - Invalid + //1 - Valid + + if (response == "0") + throw new InvalidOperationException("Failed to set TargetRightAscension."); + return hms; + } + public bool Tracking { get From e93da7343191db6e6d8f0e4a328174a84511055b Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Thu, 10 Nov 2022 14:43:41 +0000 Subject: [PATCH 02/24] 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); From 5c3bb7d4ad3159c6eac4fe9bc8812cbc498c77ef Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Thu, 10 Nov 2022 14:58:12 +0000 Subject: [PATCH 03/24] Modified unit tests for force a pass. --- .../TelescopeUnitTests.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 28dca9c..a844bb6 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -2517,6 +2517,7 @@ namespace Meade.net.Telescope.UnitTests public void TargetRightAscension_Set_WhenTelescopeReportsInvalidRA_ThenThrowsException() { _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny(), false)).Returns("0"); + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); ConnectTelescope(); @@ -3113,6 +3114,8 @@ namespace Meade.net.Telescope.UnitTests [Test] public void SlewToTargetAsync_WhenTargetDeclinationNotSet_ThenThrowsException() { + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); + ConnectTelescope(); _telescope.TargetRightAscension = 1; @@ -3135,6 +3138,8 @@ namespace Meade.net.Telescope.UnitTests [Test] public void SlewToTargetAsync_WhenTargetSet_ThenAttemptsSlew() { + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); + ConnectTelescope(); _telescope.TargetRightAscension = 2; @@ -3149,6 +3154,8 @@ namespace Meade.net.Telescope.UnitTests { _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0"); + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); + ConnectTelescope(); _telescope.TargetRightAscension = 2; @@ -3166,6 +3173,8 @@ namespace Meade.net.Telescope.UnitTests _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Below horizon"); + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); + ConnectTelescope(); _telescope.TargetRightAscension = 2; @@ -3181,6 +3190,8 @@ namespace Meade.net.Telescope.UnitTests _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("2"); _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Above below elevation"); + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); + ConnectTelescope(); _telescope.TargetRightAscension = 2; @@ -3196,6 +3207,8 @@ namespace Meade.net.Telescope.UnitTests _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("3"); _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("the telescope can hit the tripod"); + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); + ConnectTelescope(); _telescope.TargetRightAscension = 2; @@ -3220,6 +3233,9 @@ namespace Meade.net.Telescope.UnitTests var preTestItterations = 1; var slewCounter = 0; var iterations = 10; + + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); + _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns(() => { slewCounter++; From 129fc23d838c0795095c990cfff2d491b91c5f2e Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Thu, 10 Nov 2022 15:30:16 +0000 Subject: [PATCH 04/24] Added an attempt to use the short format to set the TargetRightAscension if the long format fails. --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 1 + Meade.net.Telescope/Telescope.cs | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index a844bb6..c05c0e2 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -2518,6 +2518,7 @@ namespace Meade.net.Telescope.UnitTests { _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny(), false)).Returns("0"); _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); + _utilMock.Setup(x => x.HoursToHM(It.IsAny(), ":", "", It.IsAny())).Returns("00:00:00.00"); ConnectTelescope(); diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index e74f794..35c386d 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -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); } From cfa7e1d1cf27499c58f8ea4df813f8b2cff6faf9 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Thu, 10 Nov 2022 16:53:27 +0000 Subject: [PATCH 05/24] Adding a catch so that when setting the precision, if one mode fails, try the other. --- Meade.net.Telescope/Telescope.cs | 51 +++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 35c386d..54675b5 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -3424,25 +3424,14 @@ namespace ASCOM.Meade.net if (value < -90) throw new InvalidValueException("Declination cannot be less than -90."); - var dms = SharedResourcesWrapper.IsLongFormat - ? _utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe) - : _utilities.DegreesToDM(value, "*", "", _digitsDe); - - var s = value < 0 ? string.Empty : "+"; - - var command = $"Sd{s}{dms}"; - - LogMessage("TargetDeclination Set", $"{command}"); - var result = SharedResourcesWrapper.SendChar(Tl, command); - //:SdsDD*MM# - //Set target object declination to sDD*MM or sDD*MM:SS depending on the current precision setting - //Returns: - //1 - Dec Accepted - //0 - Dec invalid - - if (result == "0") + string dms; + try { - throw new InvalidOperationException("Target declination invalid"); + dms = SetTargetDeslination(value, SharedResourcesWrapper.IsLongFormat); + } + catch (InvalidOperationException) + { + dms = SetTargetDeslination(value, !SharedResourcesWrapper.IsLongFormat); } SharedResourcesWrapper.TargetDeclination = _utilities.DMSToDegrees(dms); @@ -3455,6 +3444,32 @@ namespace ASCOM.Meade.net } } + private string SetTargetDeslination(double value, bool useLongFormat) + { + var dms = useLongFormat + ? _utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe) + : _utilities.DegreesToDM(value, "*", "", _digitsDe); + + var s = value < 0 ? string.Empty : "+"; + + var command = $"Sd{s}{dms}"; + + LogMessage("TargetDeclination Set", $"{command}"); + var result = SharedResourcesWrapper.SendChar(Tl, command); + //:SdsDD*MM# + //Set target object declination to sDD*MM or sDD*MM:SS depending on the current precision setting + //Returns: + //1 - Dec Accepted + //0 - Dec invalid + + if (result == "0") + { + throw new InvalidOperationException("Target declination invalid"); + } + + return dms; + } + public double TargetRightAscension { get From 6db59eaef1e92d8a30174eec171095aa1925bf0b Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Thu, 10 Nov 2022 17:57:21 +0000 Subject: [PATCH 06/24] Corrected Typo in name --- Meade.net.Telescope/Telescope.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 54675b5..3850792 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -3427,11 +3427,11 @@ namespace ASCOM.Meade.net string dms; try { - dms = SetTargetDeslination(value, SharedResourcesWrapper.IsLongFormat); + dms = SetTargetDeclination(value, SharedResourcesWrapper.IsLongFormat); } catch (InvalidOperationException) { - dms = SetTargetDeslination(value, !SharedResourcesWrapper.IsLongFormat); + dms = SetTargetDeclination(value, !SharedResourcesWrapper.IsLongFormat); } SharedResourcesWrapper.TargetDeclination = _utilities.DMSToDegrees(dms); @@ -3444,7 +3444,7 @@ namespace ASCOM.Meade.net } } - private string SetTargetDeslination(double value, bool useLongFormat) + private string SetTargetDeclination(double value, bool useLongFormat) { var dms = useLongFormat ? _utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe) From 3ffa9fbe8b6e81012c18474d114859189c68ca9a Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Thu, 10 Nov 2022 17:57:45 +0000 Subject: [PATCH 07/24] Nuget package updates --- .../AstroMath.UnitTests.csproj | 24 +-- AstroMath.UnitTests/app.config | 2 +- AstroMath.UnitTests/packages.config | 10 +- FocuserTestConsole/FocuserTestConsole.csproj | 4 +- FocuserTestConsole/packages.config | 2 +- .../Meade.net.Focuser.UnitTests.csproj | 47 +++-- Meade.net.Focuser.UnitTests/app.config | 2 +- Meade.net.Focuser.UnitTests/packages.config | 12 +- .../Meade.net.Telescope.UnitTests.csproj | 47 +++-- .../TelescopeUnitTests.cs | 189 +++++++++--------- Meade.net.Telescope.UnitTests/app.config | 2 +- Meade.net.Telescope.UnitTests/packages.config | 12 +- .../Meade.net.Telescope.csproj | 27 ++- Meade.net.Telescope/packages.config | 4 +- .../Meade.net.UnitTests.csproj | 47 +++-- Meade.net.UnitTests/app.config | 2 +- Meade.net.UnitTests/packages.config | 14 +- Meade.net.focuser/Meade.net.focuser.csproj | 27 ++- Meade.net.focuser/packages.config | 4 +- Meade.net/Meade.net.csproj | 27 ++- Meade.net/SetupDialogForm.cs | 10 + Meade.net/SetupDialogForm.designer.cs | 14 +- Meade.net/SetupDialogForm.resx | 147 ++++++++------ Meade.net/packages.config | 4 +- .../TelescopeTestConsole.csproj | 4 +- TelescopeTestConsole/packages.config | 2 +- 26 files changed, 361 insertions(+), 325 deletions(-) diff --git a/AstroMath.UnitTests/AstroMath.UnitTests.csproj b/AstroMath.UnitTests/AstroMath.UnitTests.csproj index cffc483..243721d 100644 --- a/AstroMath.UnitTests/AstroMath.UnitTests.csproj +++ b/AstroMath.UnitTests/AstroMath.UnitTests.csproj @@ -1,6 +1,6 @@  - + Debug @@ -53,23 +53,23 @@ MinimumRecommendedRules.ruleset - - ..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll + + ..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll - - ..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll + + ..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll - - ..\packages\Moq.4.15.2\lib\net45\Moq.dll + + ..\packages\Moq.4.18.2\lib\net462\Moq.dll - - ..\packages\NUnit.3.13.0\lib\net45\nunit.framework.dll + + ..\packages\NUnit.3.13.3\lib\net45\nunit.framework.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.7.0.0-preview.2.22152.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll @@ -104,6 +104,6 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/AstroMath.UnitTests/app.config b/AstroMath.UnitTests/app.config index fe20587..5514db0 100644 --- a/AstroMath.UnitTests/app.config +++ b/AstroMath.UnitTests/app.config @@ -8,7 +8,7 @@ - + diff --git a/AstroMath.UnitTests/packages.config b/AstroMath.UnitTests/packages.config index 2bd4fbf..0e509b4 100644 --- a/AstroMath.UnitTests/packages.config +++ b/AstroMath.UnitTests/packages.config @@ -1,9 +1,9 @@  - - - - - + + + + + \ No newline at end of file diff --git a/FocuserTestConsole/FocuserTestConsole.csproj b/FocuserTestConsole/FocuserTestConsole.csproj index 0b2500d..d2c5559 100644 --- a/FocuserTestConsole/FocuserTestConsole.csproj +++ b/FocuserTestConsole/FocuserTestConsole.csproj @@ -59,8 +59,8 @@ - - ..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll + + ..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll diff --git a/FocuserTestConsole/packages.config b/FocuserTestConsole/packages.config index 97cf0c3..0e46bfa 100644 --- a/FocuserTestConsole/packages.config +++ b/FocuserTestConsole/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Meade.net.Focuser.UnitTests/Meade.net.Focuser.UnitTests.csproj b/Meade.net.Focuser.UnitTests/Meade.net.Focuser.UnitTests.csproj index c47e79d..fbc940d 100644 --- a/Meade.net.Focuser.UnitTests/Meade.net.Focuser.UnitTests.csproj +++ b/Meade.net.Focuser.UnitTests/Meade.net.Focuser.UnitTests.csproj @@ -1,6 +1,6 @@  - + Debug @@ -36,55 +36,55 @@ - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Astrometry.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Attributes.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Cache.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Controls.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DeviceInterfaces.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DriverAccess.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Exceptions.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Internal.Extensions.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.SettingsProvider.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.Video.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll - - ..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll + + ..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll - - ..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll + + ..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll - - ..\packages\Moq.4.15.2\lib\net45\Moq.dll + + ..\packages\Moq.4.18.2\lib\net462\Moq.dll - - ..\packages\NUnit.3.13.0\lib\net45\nunit.framework.dll + + ..\packages\NUnit.3.13.3\lib\net45\nunit.framework.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.7.0.0-preview.2.22152.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll @@ -102,7 +102,6 @@ - @@ -120,6 +119,6 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/Meade.net.Focuser.UnitTests/app.config b/Meade.net.Focuser.UnitTests/app.config index fe20587..5514db0 100644 --- a/Meade.net.Focuser.UnitTests/app.config +++ b/Meade.net.Focuser.UnitTests/app.config @@ -8,7 +8,7 @@ - + diff --git a/Meade.net.Focuser.UnitTests/packages.config b/Meade.net.Focuser.UnitTests/packages.config index 507c431..7765007 100644 --- a/Meade.net.Focuser.UnitTests/packages.config +++ b/Meade.net.Focuser.UnitTests/packages.config @@ -1,10 +1,10 @@  - - - - - - + + + + + + \ No newline at end of file diff --git a/Meade.net.Telescope.UnitTests/Meade.net.Telescope.UnitTests.csproj b/Meade.net.Telescope.UnitTests/Meade.net.Telescope.UnitTests.csproj index 6c8ab97..0770dd6 100644 --- a/Meade.net.Telescope.UnitTests/Meade.net.Telescope.UnitTests.csproj +++ b/Meade.net.Telescope.UnitTests/Meade.net.Telescope.UnitTests.csproj @@ -1,6 +1,6 @@  - + Debug @@ -57,55 +57,55 @@ - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Astrometry.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Attributes.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Cache.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Controls.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DeviceInterfaces.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DriverAccess.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Exceptions.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Internal.Extensions.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.SettingsProvider.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.Video.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll - - ..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll + + ..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll - - ..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll + + ..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll - - ..\packages\Moq.4.15.2\lib\net45\Moq.dll + + ..\packages\Moq.4.18.2\lib\net462\Moq.dll - - ..\packages\NUnit.3.13.0\lib\net45\nunit.framework.dll + + ..\packages\NUnit.3.13.3\lib\net45\nunit.framework.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.7.0.0-preview.2.22152.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll @@ -132,7 +132,6 @@ - @@ -140,6 +139,6 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index c05c0e2..626c4ab 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -18,20 +18,20 @@ namespace Meade.net.Telescope.UnitTests public class TestProperties { public string AlignmentMode { get; internal set; } = "P"; - internal string telescopeRaResult { get; set; } = "HH:MM:SS"; - internal double rightAscension { get; set; } = 1.2; //todo rename to declination; - internal double declination { get; set; } = 45; + internal string TelescopeRaResult { get; set; } = "HH:MM:SS"; + internal double RightAscension { get; set; } = 1.2; //todo rename to declination; + internal double Declination { get; set; } = 45; internal string SiteLatitudeString { get; set; } = "testLatString"; internal double SiteLatitudeValue { get; set; } = 12.45; - internal string telescopeDate { get; set; } = "10/15/20"; - internal string telescopeTime { get; set; } = "20:15:10"; - internal string telescopeUtcCorrection { get; set; } = "-1.0"; + internal string TelescopeDate { get; set; } = "10/15/20"; + internal string TelescopeTime { get; set; } = "20:15:10"; + internal string TelescopeUtcCorrection { get; set; } = "-1.0"; - internal double hourAngle { get; set; } - internal int telescopeAltitude { get; set; } = 45; - internal int telescopeAzimuth { get; set; } = 200; + internal double HourAngle { get; set; } + internal int TelescopeAltitude { get; set; } = 45; + internal int TelescopeAzimuth { get; set; } = 200; internal char[] AlignmentStatus { get; set; } internal string TrackingRate { get; set; } @@ -58,7 +58,6 @@ namespace Meade.net.Telescope.UnitTests private bool _isParked; private ParkedPosition _parkedPosition; private string _siderealTrackingRate; - private bool _restartTracking; [SetUp] public void Setup() @@ -138,12 +137,12 @@ namespace Meade.net.Telescope.UnitTests _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "Gt", false)).Returns( () => _testProperties.SiteLatitudeString); _utilMock.Setup(x => x.DMSToDegrees(_testProperties.SiteLatitudeString)).Returns( () => _testProperties.SiteLatitudeValue); - _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GR", false)).Returns( () =>_testProperties.telescopeRaResult); - _utilMock.Setup(x => x.HMSToHours(_testProperties.telescopeRaResult)).Returns( () => _testProperties.rightAscension); + _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GR", false)).Returns( () =>_testProperties.TelescopeRaResult); + _utilMock.Setup(x => x.HMSToHours(_testProperties.TelescopeRaResult)).Returns( () => _testProperties.RightAscension); - _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GC", false)).Returns(() => _testProperties.telescopeDate); - _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GL", false)).Returns(() => _testProperties.telescopeTime); - _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GG", false)).Returns(() => _testProperties.telescopeUtcCorrection); + _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GC", false)).Returns(() => _testProperties.TelescopeDate); + _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GL", false)).Returns(() => _testProperties.TelescopeTime); + _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GG", false)).Returns(() => _testProperties.TelescopeUtcCorrection); _testProperties.TrackingRate = _siderealTrackingRate; _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GT", false)).Returns(() => _testProperties.TrackingRate); @@ -156,7 +155,6 @@ namespace Meade.net.Telescope.UnitTests _sharedResourcesWrapperMock.Setup(x => x.SetParked(It.IsAny(), It.IsAny(), It.IsAny())).Callback((isParked, parkedPostion, restartTracking) => { _isParked = isParked; _parkedPosition = parkedPostion; - _restartTracking = restartTracking; }); const char ack = (char)6; @@ -169,11 +167,11 @@ namespace Meade.net.Telescope.UnitTests _astroMathsMock .Setup(x => x.ConvertHozToEq(It.IsAny(), It.IsAny(), It.IsAny(), - It.IsAny())).Returns(() => new EquatorialCoordinates { Declination = _testProperties.declination, RightAscension = _testProperties.rightAscension }); + It.IsAny())).Returns(() => new EquatorialCoordinates { Declination = _testProperties.Declination, RightAscension = _testProperties.RightAscension }); - _astroMathsMock.Setup(x => x.RightAscensionToHourAngle(It.IsAny(), It.IsAny(), It.IsAny())).Returns(() =>_testProperties.hourAngle); + _astroMathsMock.Setup(x => x.RightAscensionToHourAngle(It.IsAny(), It.IsAny(), It.IsAny())).Returns(() =>_testProperties.HourAngle); - _astroMathsMock.Setup(x => x.ConvertEqToHoz(_testProperties.hourAngle, It.IsAny(), It.IsAny())).Returns(new HorizonCoordinates { Altitude = _testProperties.telescopeAltitude, Azimuth = _testProperties.telescopeAzimuth }); + _astroMathsMock.Setup(x => x.ConvertEqToHoz(_testProperties.HourAngle, It.IsAny(), It.IsAny())).Returns(new HorizonCoordinates { Altitude = _testProperties.TelescopeAltitude, Azimuth = _testProperties.TelescopeAzimuth }); _telescope.Connected = true; } @@ -502,7 +500,7 @@ namespace Meade.net.Telescope.UnitTests public void Connected_WhenConnectingLX200GPSAndSendDateTimeIsTrue_Then_SpecialStartupInstructionSendOnFirstConnect() { _profileProperties.SendDateTime = true; - _testProperties.telescopeUtcCorrection = "0"; + _testProperties.TelescopeUtcCorrection = "0"; DateTime testNow = DateTime.ParseExact("2021-10-03T20:36:25", "yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture); _clockMock.Setup(x => x.UtcNow).Returns(() => testNow); @@ -525,7 +523,7 @@ namespace Meade.net.Telescope.UnitTests string telescopeTime = "20:36:25"; string telescopeDate = "10/03/21"; - _testProperties.telescopeUtcCorrection = "0"; + _testProperties.TelescopeUtcCorrection = "0"; DateTime endSlewingDatetime = DateTime.ParseExact("2021-10-03T20:36:25", "yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture); _clockMock.Setup(x => x.UtcNow).Returns(() => endSlewingDatetime); @@ -551,7 +549,7 @@ namespace Meade.net.Telescope.UnitTests string telescopeTime = "20:36:25"; string telescopeDate = "10/03/21"; - _testProperties.telescopeUtcCorrection = "0"; + _testProperties.TelescopeUtcCorrection = "0"; DateTime endSlewingDatetime = DateTime.ParseExact("2021-10-03T20:36:25", "yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture); _clockMock.Setup(x => x.UtcNow).Returns(() => @@ -1024,8 +1022,8 @@ namespace Meade.net.Telescope.UnitTests ? false : throw new ArgumentOutOfRangeException(nameof(desiredPresision), desiredPresision, "Should be High or Low")); _sharedResourcesWrapperMock.SetupProperty(x => x.IsLongFormat, isLongFormat); - _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GR", false)).Returns(() => _testProperties.telescopeRaResult); - _utilMock.Setup(x => x.HMSToHours(_testProperties.telescopeRaResult)).Returns(() => _testProperties.rightAscension); + _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GR", false)).Returns(() => _testProperties.TelescopeRaResult); + _utilMock.Setup(x => x.HMSToHours(_testProperties.TelescopeRaResult)).Returns(() => _testProperties.RightAscension); _profileProperties.Precision = desiredPresision; @@ -1821,7 +1819,7 @@ namespace Meade.net.Telescope.UnitTests var telescopeDecResult = "s12*34’56"; var dmsResult = 1.2; - _testProperties.rightAscension = 1.3; + _testProperties.RightAscension = 1.3; _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GD", false)).Returns(telescopeDecResult); _utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(dmsResult); @@ -1975,7 +1973,7 @@ namespace Meade.net.Telescope.UnitTests var result = _telescope.RightAscension; - Assert.That(result, Is.EqualTo(_testProperties.rightAscension)); + Assert.That(result, Is.EqualTo(_testProperties.RightAscension)); } [Test] @@ -2029,9 +2027,9 @@ namespace Meade.net.Telescope.UnitTests Assert.DoesNotThrow(() => { var result = _telescope.SideOfPier; }); } - [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, AlignmentModes.algAltAz, 'A')] - [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, AlignmentModes.algPolar, 'P')] - public void SideOfPier_Get_WhenMeridianFlipNotSupportedByAlignementMode_ThenThrowsException(string model, string firmware, AlignmentModes alignmode, char alignmentStatus) + [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, 'A')] + [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, 'P')] + public void SideOfPier_Get_WhenMeridianFlipNotSupportedByAlignementMode_ThenThrowsException(string model, string firmware, char alignmentStatus) { ConnectTelescope(model, firmware); _testProperties.AlignmentStatus = new[] { alignmentStatus, 'T', '1' }; @@ -2046,8 +2044,8 @@ namespace Meade.net.Telescope.UnitTests Assert.That(excpetion.AccessorSet, Is.False); } - [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, AlignmentModes.algGermanPolar, 'G')] - public void SideOfPier_Get_WhenMeridianFlipSupportedByAlignementMode_ThenDoesNotThrow(string model, string firmware, AlignmentModes alignmode, char alignmentStatus) + [TestCase(TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg, 'G')] + public void SideOfPier_Get_WhenMeridianFlipSupportedByAlignementMode_ThenDoesNotThrow(string model, string firmware, char alignmentStatus) { ConnectTelescope(model, firmware); _testProperties.AlignmentStatus = new[] { alignmentStatus, 'T', '1' }; @@ -2252,11 +2250,11 @@ namespace Meade.net.Telescope.UnitTests } - [TestCase("5", 5, -5)] - [TestCase("-5", -5, 5)] - [TestCase("185", 185, 175)] - [TestCase("350", 350, 10)] - public void SiteLongitude_Get_WhenConnected_ThenRetrivesAndReturnsExpectedValue(string telescopelongitudeString, double telescopeLongitudeValue, double expectedResult) + [TestCase(5, -5)] + [TestCase(-5, 5)] + [TestCase(185, 175)] + [TestCase(350, 10)] + public void SiteLongitude_Get_WhenConnected_ThenRetrivesAndReturnsExpectedValue(double telescopeLongitudeValue, double expectedResult) { var telescopeLongitude = "testLongitude"; @@ -2671,9 +2669,8 @@ namespace Meade.net.Telescope.UnitTests Assert.That(exception.Message, Is.EqualTo("Exception of type 'System.ArgumentOutOfRangeException' was thrown.\r\nParameter name: value\r\nActual value was driveKing.")); } - [TestCase("60.1")] - [TestCase("+60.1")] - public void TrackingRage_Get_WhenReadingDefaultValue_ThenAssumesSidereal(string trackingRate) + [Test] + public void TrackingRage_Get_WhenReadingDefaultValue_ThenAssumesSidereal() { ConnectTelescope(); @@ -2711,11 +2708,9 @@ namespace Meade.net.Telescope.UnitTests Assert.That(result, Is.EqualTo(rate)); } - [TestCase(DriveRates.driveSidereal, "60.1")] - [TestCase(DriveRates.driveLunar, "60.1")] - [TestCase(DriveRates.driveSidereal, "+60.1")] - [TestCase(DriveRates.driveLunar, "+60.1")] - public void TrackingRate_Set_WhenConnectedToLX200_ThenThrowsException(DriveRates rate, string trackingRate) + [TestCase(DriveRates.driveSidereal)] + [TestCase(DriveRates.driveLunar)] + public void TrackingRate_Set_WhenConnectedToLX200_ThenThrowsException(DriveRates rate) { string productName = TelescopeList.LX200CLASSIC; string firmwareVersion = string.Empty; @@ -2764,9 +2759,9 @@ namespace Meade.net.Telescope.UnitTests public void UTCDate_Get_WhenConnected_ThenReturnsUTCDateTime(string telescopeDate, string telescopeTime, string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second) { - _testProperties.telescopeDate = telescopeDate; - _testProperties.telescopeTime = telescopeTime; - _testProperties.telescopeUtcCorrection = telescopeUtcCorrection; + _testProperties.TelescopeDate = telescopeDate; + _testProperties.TelescopeTime = telescopeTime; + _testProperties.TelescopeUtcCorrection = telescopeUtcCorrection; ConnectTelescope(); @@ -2790,9 +2785,9 @@ namespace Meade.net.Telescope.UnitTests Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: UTCDate Set")); } - [TestCase("10/15/20", "20:15:10", "-1.0", 2020, 10, 15, 19, 15, 10)] - [TestCase("12/03/15", "21:30:45", "+0.0", 2015, 12, 3, 21, 30, 45)] - public void UTCDate_Set_WhenFailsToSetTelescopeTime_ThenThrowsException(string telescopeDate, string telescopeTime, string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second) + [TestCase("20:15:10", "-1.0", 2020, 10, 15, 19, 15, 10)] + [TestCase("21:30:45", "+0.0", 2015, 12, 3, 21, 30, 45)] + public void UTCDate_Set_WhenFailsToSetTelescopeTime_ThenThrowsException(string telescopeTime, string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second) { double utcOffsetHours = double.Parse(telescopeUtcCorrection); TimeSpan utcCorrection = TimeSpan.FromHours(utcOffsetHours); @@ -2809,11 +2804,11 @@ namespace Meade.net.Telescope.UnitTests Assert.That(exception.Message, Is.EqualTo("Failed to set local time")); } - [TestCase("10/15/20", "20:15:10", "-1.0", 2020, 10, 15, 20, 15, 10)] - [TestCase("12/03/15", "21:30:45", "+0.0", 2015, 12, 3, 21, 30, 45)] - public void UTCDate_Set_WhenFailsToSetTelescopeDate_ThenThrowsException(string telescopeDate, string telescopeTime, string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second) + [TestCase("20:15:10", "-1.0", 2020, 10, 15, 20, 15, 10)] + [TestCase("21:30:45", "+0.0", 2015, 12, 3, 21, 30, 45)] + public void UTCDate_Set_WhenFailsToSetTelescopeDate_ThenThrowsException(string telescopeTime, string telescopeUtcCorrection, int year, int month, int day, int hour, int min, int second) { - _testProperties.telescopeUtcCorrection = telescopeUtcCorrection; + _testProperties.TelescopeUtcCorrection = telescopeUtcCorrection; double utcOffsetHours = double.Parse(telescopeUtcCorrection); TimeSpan utcCorrection = TimeSpan.FromHours(utcOffsetHours); @@ -2838,7 +2833,7 @@ namespace Meade.net.Telescope.UnitTests double utcOffsetHours = double.Parse(telescopeUtcCorrection); TimeSpan utcCorrection = TimeSpan.FromHours(utcOffsetHours); - _testProperties.telescopeUtcCorrection = telescopeUtcCorrection; + _testProperties.TelescopeUtcCorrection = telescopeUtcCorrection; var newDate = new DateTime(year, month, day, hour, min, second, DateTimeKind.Local) + utcCorrection; @@ -2872,23 +2867,23 @@ namespace Meade.net.Telescope.UnitTests var telescopeDecResult = "s12*34’56"; string hms = "05:30:00"; - _testProperties.rightAscension = 5.5; + _testProperties.RightAscension = 5.5; double declination = -30.5; string dec = "-30*30:00"; var digitsRA = 2; - _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{_testProperties.telescopeRaResult}", false)).Returns("1"); + _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{_testProperties.TelescopeRaResult}", false)).Returns("1"); - _utilMock.Setup(x => x.HoursToHMS(_testProperties.rightAscension, ":", ":", ":", digitsRA)).Returns(_testProperties.telescopeRaResult); - _utilMock.Setup(x => x.HMSToHours(hms)).Returns(_testProperties.rightAscension); + _utilMock.Setup(x => x.HoursToHMS(_testProperties.RightAscension, ":", ":", ":", digitsRA)).Returns(_testProperties.TelescopeRaResult); + _utilMock.Setup(x => x.HMSToHours(hms)).Returns(_testProperties.RightAscension); _utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult); _utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(declination); _utilMock.Setup(x => x.DMSToDegrees(dec)).Returns(declination); - _utilMock.Setup(x => x.HoursToHMS(_testProperties.rightAscension, ":", ":", ":", 2)).Returns(hms); + _utilMock.Setup(x => x.HoursToHMS(_testProperties.RightAscension, ":", ":", ":", 2)).Returns(hms); _utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", digitsRA)).Returns(dec); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{hms}", false)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sd{dec}", false)).Returns("1"); @@ -2899,10 +2894,10 @@ namespace Meade.net.Telescope.UnitTests ConnectTelescope(); - _telescope.SyncToCoordinates(_testProperties.rightAscension, declination); + _telescope.SyncToCoordinates(_testProperties.RightAscension, declination); _sharedResourcesWrapperMock.Verify(x => x.SendString(_traceLoggerMock.Object, "CM", false), Times.Once); - Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.rightAscension)); + Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.RightAscension)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination)); } @@ -3269,7 +3264,7 @@ namespace Meade.net.Telescope.UnitTests { var digitsRA = 2; - _testProperties.rightAscension = 1; + _testProperties.RightAscension = 1; var declination = 2; @@ -3277,18 +3272,18 @@ namespace Meade.net.Telescope.UnitTests _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0"); - _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{_testProperties.telescopeRaResult}", false)).Returns("1"); + _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{_testProperties.TelescopeRaResult}", false)).Returns("1"); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GD", false)).Returns(telescopeDecResult); - _utilMock.Setup(x => x.HoursToHMS(_testProperties.rightAscension, ":", ":", ":", digitsRA)).Returns(_testProperties.telescopeRaResult); + _utilMock.Setup(x => x.HoursToHMS(_testProperties.RightAscension, ":", ":", ":", digitsRA)).Returns(_testProperties.TelescopeRaResult); _utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(declination); _utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult); ConnectTelescope(); - _telescope.SlewToCoordinatesAsync(_testProperties.rightAscension, declination); + _telescope.SlewToCoordinatesAsync(_testProperties.RightAscension, declination); - Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.rightAscension)); + Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.RightAscension)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(declination)); _sharedResourcesWrapperMock.Verify(x => x.SendChar(_traceLoggerMock.Object, "MS", false), Times.Once); } @@ -3303,7 +3298,7 @@ namespace Meade.net.Telescope.UnitTests [Test] public void SlewToCoordinates_WhenCalled_ThenSetsTargetAndSlews() { - _testProperties.rightAscension = 1; + _testProperties.RightAscension = 1; var declination = 2; var telescopeDecResult = "s12*34’56"; @@ -3311,9 +3306,9 @@ namespace Meade.net.Telescope.UnitTests var digitsRA = 2; _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GD", false)).Returns(telescopeDecResult); - _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{_testProperties.telescopeRaResult}", false)).Returns("1"); + _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{_testProperties.TelescopeRaResult}", false)).Returns("1"); - _utilMock.Setup(x => x.HoursToHMS(_testProperties.rightAscension, ":", ":", ":", digitsRA)).Returns(_testProperties.telescopeRaResult); + _utilMock.Setup(x => x.HoursToHMS(_testProperties.RightAscension, ":", ":", ":", digitsRA)).Returns(_testProperties.TelescopeRaResult); _utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(dmsResult); _utilMock.Setup(x => x.DegreesToDMS(declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult); @@ -3334,8 +3329,8 @@ namespace Meade.net.Telescope.UnitTests ConnectTelescope(); - _telescope.SlewToCoordinates(_testProperties.rightAscension, declination); - Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.rightAscension)); + _telescope.SlewToCoordinates(_testProperties.RightAscension, declination); + Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.RightAscension)); Assert.That(_telescope.TargetDeclination, Is.EqualTo(dmsResult)); _sharedResourcesWrapperMock.Verify(x => x.SendChar(_traceLoggerMock.Object, "MS", false), Times.Once); @@ -3388,8 +3383,8 @@ namespace Meade.net.Telescope.UnitTests [Test] public void SlewToAltAzAsync_WhenAltAndAzValid_ThenConvertsToRADec() { - _testProperties.rightAscension = 20; - _testProperties.declination = 10; + _testProperties.RightAscension = 20; + _testProperties.Declination = 10; var altitude = 30; var azimuth = 45; @@ -3404,17 +3399,17 @@ namespace Meade.net.Telescope.UnitTests _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, $"Sr{telescopeRaResult}", false)).Returns("1"); - _utilMock.Setup(x => x.HoursToHMS(_testProperties.rightAscension, ":", ":", ":", digitsRA)).Returns(telescopeRaResult); - _utilMock.Setup(x => x.HMSToHours(telescopeRaResult)).Returns(_testProperties.rightAscension); - _utilMock.Setup(x => x.DegreesToDMS(_testProperties.declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult); - _utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(_testProperties.declination); + _utilMock.Setup(x => x.HoursToHMS(_testProperties.RightAscension, ":", ":", ":", digitsRA)).Returns(telescopeRaResult); + _utilMock.Setup(x => x.HMSToHours(telescopeRaResult)).Returns(_testProperties.RightAscension); + _utilMock.Setup(x => x.DegreesToDMS(_testProperties.Declination, "*", ":", ":", digitsRA)).Returns(telescopeDecResult); + _utilMock.Setup(x => x.DMSToDegrees(telescopeDecResult)).Returns(_testProperties.Declination); ConnectTelescope(); _telescope.SlewToAltAzAsync(azimuth, altitude); - Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.rightAscension)); - Assert.That(_telescope.TargetDeclination, Is.EqualTo(_testProperties.declination)); + Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.RightAscension)); + Assert.That(_telescope.TargetDeclination, Is.EqualTo(_testProperties.Declination)); _sharedResourcesWrapperMock.Verify(x => x.SendChar(_traceLoggerMock.Object, "MS", false), Times.Once); } @@ -3428,14 +3423,14 @@ namespace Meade.net.Telescope.UnitTests [Test] public void SlewToAltAz_WhenCalled_ThenSetsTargetAndSlews() { - _testProperties.rightAscension = 10.0; - _testProperties.declination = 20; + _testProperties.RightAscension = 10.0; + _testProperties.Declination = 20; var azimuth = 30; var altitude = 40; - _utilMock.Setup(x => x.HoursToHMS(_testProperties.rightAscension, ":", ":", ":", 2)).Returns(_testProperties.telescopeRaResult); - _utilMock.Setup(x => x.DegreesToDMS(_testProperties.declination, "*", ":", ":", 2)).Returns(_testProperties.telescopeRaResult); - _utilMock.Setup(x => x.DMSToDegrees(_testProperties.telescopeRaResult)).Returns(_testProperties.declination); + _utilMock.Setup(x => x.HoursToHMS(_testProperties.RightAscension, ":", ":", ":", 2)).Returns(_testProperties.TelescopeRaResult); + _utilMock.Setup(x => x.DegreesToDMS(_testProperties.Declination, "*", ":", ":", 2)).Returns(_testProperties.TelescopeRaResult); + _utilMock.Setup(x => x.DMSToDegrees(_testProperties.TelescopeRaResult)).Returns(_testProperties.Declination); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GG", false)).Returns("-1.0"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "Sd+HH:MM:SS", false)).Returns("1"); @@ -3459,8 +3454,8 @@ namespace Meade.net.Telescope.UnitTests _telescope.SlewToAltAz(azimuth, altitude); - Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.rightAscension)); - Assert.That(_telescope.TargetDeclination, Is.EqualTo(_testProperties.declination)); + Assert.That(_telescope.TargetRightAscension, Is.EqualTo(_testProperties.RightAscension)); + Assert.That(_telescope.TargetDeclination, Is.EqualTo(_testProperties.Declination)); _sharedResourcesWrapperMock.Verify(x => x.SendChar(_traceLoggerMock.Object, "MS", false), Times.Once); _utilMock.Verify(x => x.WaitForMilliseconds(It.IsAny()), Times.Exactly(iterations - preTestItterations)); } @@ -3482,9 +3477,9 @@ namespace Meade.net.Telescope.UnitTests var telescopeLongitude = "350"; var telescopeLongitudeValue = 350; - _testProperties.telescopeAltitude = 45; - _testProperties.telescopeAzimuth = 200; - _testProperties.hourAngle = 3; + _testProperties.TelescopeAltitude = 45; + _testProperties.TelescopeAzimuth = 200; + _testProperties.HourAngle = 3; _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "GG", false)).Returns("-1.0"); @@ -3496,7 +3491,7 @@ namespace Meade.net.Telescope.UnitTests var result = _telescope.Azimuth; - Assert.That(result, Is.EqualTo(_testProperties.telescopeAzimuth)); + Assert.That(result, Is.EqualTo(_testProperties.TelescopeAzimuth)); } [Test] @@ -3522,9 +3517,9 @@ namespace Meade.net.Telescope.UnitTests _utilMock.Setup(x => x.DMSToDegrees(telescopeLongitude)).Returns(telescopeLongitudeValue); - _astroMathsMock.Setup(x => x.RightAscensionToHourAngle(It.IsAny(), It.IsAny(), It.IsAny())).Returns(_testProperties.hourAngle); + _astroMathsMock.Setup(x => x.RightAscensionToHourAngle(It.IsAny(), It.IsAny(), It.IsAny())).Returns(_testProperties.HourAngle); - _astroMathsMock.Setup(x => x.ConvertEqToHoz(_testProperties.hourAngle, It.IsAny(), It.IsAny())).Returns(new HorizonCoordinates { Altitude = expectedAltitude, Azimuth = 200 }); + _astroMathsMock.Setup(x => x.ConvertEqToHoz(_testProperties.HourAngle, It.IsAny(), It.IsAny())).Returns(new HorizonCoordinates { Altitude = expectedAltitude, Azimuth = 200 }); ConnectTelescope(); @@ -3756,7 +3751,7 @@ namespace Meade.net.Telescope.UnitTests _profileProperties.ParkedAz = 180; DateTime testNow = DateTime.ParseExact("2021-10-03T20:36:25", "yyyy-MM-dd'T'HH:mm:ss", CultureInfo.InvariantCulture); - _testProperties.declination = 45; + _testProperties.Declination = 45; _clockMock.Setup(x => x.UtcNow).Returns(() => testNow); @@ -3771,7 +3766,7 @@ namespace Meade.net.Telescope.UnitTests break; case ParkedBehaviour.ReportCoordinates: var dec = _telescope.Declination; - Assert.That(dec, Is.EqualTo(_testProperties.declination)); + Assert.That(dec, Is.EqualTo(_testProperties.Declination)); break; default: Assert.Throws(() => { var d = _telescope.Declination; }); @@ -3795,7 +3790,7 @@ namespace Meade.net.Telescope.UnitTests _astroMathsMock .Setup(x => x.ConvertHozToEq(It.IsAny(), It.IsAny(), It.IsAny(), - It.IsAny())).Returns(new EquatorialCoordinates { Declination = declination, RightAscension = _testProperties.rightAscension }); + It.IsAny())).Returns(new EquatorialCoordinates { Declination = declination, RightAscension = _testProperties.RightAscension }); ConnectTelescope(); _telescope.Park(); @@ -3808,7 +3803,7 @@ namespace Meade.net.Telescope.UnitTests break; case ParkedBehaviour.ReportCoordinates: var reportRa = _telescope.RightAscension; - Assert.That(reportRa, Is.EqualTo(_testProperties.rightAscension)); + Assert.That(reportRa, Is.EqualTo(_testProperties.RightAscension)); break; default: Assert.Throws(() => { var ra = _telescope.RightAscension; }); diff --git a/Meade.net.Telescope.UnitTests/app.config b/Meade.net.Telescope.UnitTests/app.config index 7b9c9ee..134bd4d 100644 --- a/Meade.net.Telescope.UnitTests/app.config +++ b/Meade.net.Telescope.UnitTests/app.config @@ -4,7 +4,7 @@ - + diff --git a/Meade.net.Telescope.UnitTests/packages.config b/Meade.net.Telescope.UnitTests/packages.config index 507c431..7765007 100644 --- a/Meade.net.Telescope.UnitTests/packages.config +++ b/Meade.net.Telescope.UnitTests/packages.config @@ -1,10 +1,10 @@  - - - - - - + + + + + + \ No newline at end of file diff --git a/Meade.net.Telescope/Meade.net.Telescope.csproj b/Meade.net.Telescope/Meade.net.Telescope.csproj index e37c209..ee86a57 100644 --- a/Meade.net.Telescope/Meade.net.Telescope.csproj +++ b/Meade.net.Telescope/Meade.net.Telescope.csproj @@ -71,40 +71,40 @@ - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Astrometry.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Attributes.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Cache.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Controls.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DeviceInterfaces.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DriverAccess.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Exceptions.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Internal.Extensions.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.SettingsProvider.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.Video.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll - - ..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll + + ..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll @@ -156,7 +156,6 @@ - SettingsSingleFileGenerator diff --git a/Meade.net.Telescope/packages.config b/Meade.net.Telescope/packages.config index 6ea2d84..57da55c 100644 --- a/Meade.net.Telescope/packages.config +++ b/Meade.net.Telescope/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/Meade.net.UnitTests/Meade.net.UnitTests.csproj b/Meade.net.UnitTests/Meade.net.UnitTests.csproj index 3ab6018..3093ac2 100644 --- a/Meade.net.UnitTests/Meade.net.UnitTests.csproj +++ b/Meade.net.UnitTests/Meade.net.UnitTests.csproj @@ -1,6 +1,6 @@  - + Debug @@ -35,55 +35,55 @@ - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Astrometry.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Attributes.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Cache.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Controls.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DeviceInterfaces.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DriverAccess.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Exceptions.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Internal.Extensions.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.SettingsProvider.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.Video.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll - - ..\packages\Castle.Core.4.4.1\lib\net45\Castle.Core.dll + + ..\packages\Castle.Core.5.1.0\lib\net462\Castle.Core.dll - - ..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll + + ..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll - - ..\packages\Moq.4.15.2\lib\net45\Moq.dll + + ..\packages\Moq.4.18.2\lib\net462\Moq.dll - - ..\packages\NUnit.3.13.0\lib\net45\nunit.framework.dll + + ..\packages\NUnit.3.13.3\lib\net45\nunit.framework.dll - - ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + + ..\packages\System.Runtime.CompilerServices.Unsafe.7.0.0-preview.2.22152.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll @@ -111,7 +111,6 @@ - @@ -119,6 +118,6 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/Meade.net.UnitTests/app.config b/Meade.net.UnitTests/app.config index fe20587..5514db0 100644 --- a/Meade.net.UnitTests/app.config +++ b/Meade.net.UnitTests/app.config @@ -8,7 +8,7 @@ - + diff --git a/Meade.net.UnitTests/packages.config b/Meade.net.UnitTests/packages.config index ad73520..8d0b71a 100644 --- a/Meade.net.UnitTests/packages.config +++ b/Meade.net.UnitTests/packages.config @@ -1,11 +1,11 @@  - - - - - - - + + + + + + + \ No newline at end of file diff --git a/Meade.net.focuser/Meade.net.focuser.csproj b/Meade.net.focuser/Meade.net.focuser.csproj index 16584f2..0e1e5fa 100644 --- a/Meade.net.focuser/Meade.net.focuser.csproj +++ b/Meade.net.focuser/Meade.net.focuser.csproj @@ -83,40 +83,40 @@ - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Astrometry.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Attributes.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Cache.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Controls.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DeviceInterfaces.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DriverAccess.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Exceptions.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Internal.Extensions.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.SettingsProvider.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.Video.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll - - ..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll + + ..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll @@ -154,7 +154,6 @@ - SettingsSingleFileGenerator diff --git a/Meade.net.focuser/packages.config b/Meade.net.focuser/packages.config index 6ea2d84..57da55c 100644 --- a/Meade.net.focuser/packages.config +++ b/Meade.net.focuser/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/Meade.net/Meade.net.csproj b/Meade.net/Meade.net.csproj index 8681147..25ad3a8 100644 --- a/Meade.net/Meade.net.csproj +++ b/Meade.net/Meade.net.csproj @@ -86,40 +86,40 @@ - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Astrometry.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Astrometry.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Attributes.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Attributes.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Cache.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Cache.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Controls.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Controls.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DeviceInterfaces.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DeviceInterfaces.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.DriverAccess.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.DriverAccess.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Exceptions.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Exceptions.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Internal.Extensions.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Internal.Extensions.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.SettingsProvider.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.SettingsProvider.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.dll - ..\packages\ASCOM.Platform.6.5.1\lib\net40\ASCOM.Utilities.Video.dll + ..\packages\ASCOM.Platform.6.5.2\lib\net40\ASCOM.Utilities.Video.dll - - ..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll + + ..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll @@ -179,7 +179,6 @@ - diff --git a/Meade.net/SetupDialogForm.cs b/Meade.net/SetupDialogForm.cs index e8f067d..656a863 100644 --- a/Meade.net/SetupDialogForm.cs +++ b/Meade.net/SetupDialogForm.cs @@ -376,6 +376,16 @@ namespace ASCOM.Meade.net txtFocalLength.Text = txtFocalLength.Text.Remove(txtFocalLength.Text.Length - 1); } } + + private void button1_Click(object sender, EventArgs e) + { + Process.Start(new ProcessStartInfo() + { + FileName = "C:\\", + UseShellExecute = true, + Verb = "open" + }); + } } } diff --git a/Meade.net/SetupDialogForm.designer.cs b/Meade.net/SetupDialogForm.designer.cs index 7d0266b..182c198 100644 --- a/Meade.net/SetupDialogForm.designer.cs +++ b/Meade.net/SetupDialogForm.designer.cs @@ -91,6 +91,7 @@ namespace ASCOM.Meade.net this.label29 = new System.Windows.Forms.Label(); this.txtApertureArea = new System.Windows.Forms.TextBox(); this.label30 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.picASCOM)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudSettleTime)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numDatabits)).BeginInit(); @@ -419,7 +420,7 @@ namespace ASCOM.Meade.net resources.ApplyResources(this.label27, "label27"); this.label27.Name = "label27"; // - // txtApetureDiameter + // txtApertureDiameter // resources.ApplyResources(this.txtApertureDiameter, "txtApertureDiameter"); this.txtApertureDiameter.Name = "txtApertureDiameter"; @@ -434,7 +435,7 @@ namespace ASCOM.Meade.net resources.ApplyResources(this.label29, "label29"); this.label29.Name = "label29"; // - // txtApetureArea + // txtApertureArea // resources.ApplyResources(this.txtApertureArea, "txtApertureArea"); this.txtApertureArea.Name = "txtApertureArea"; @@ -444,10 +445,18 @@ namespace ASCOM.Meade.net resources.ApplyResources(this.label30, "label30"); this.label30.Name = "label30"; // + // button1 + // + resources.ApplyResources(this.button1, "button1"); + this.button1.Name = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // // SetupDialogForm // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button1); this.Controls.Add(this.label29); this.Controls.Add(this.txtApertureArea); this.Controls.Add(this.label30); @@ -580,5 +589,6 @@ namespace ASCOM.Meade.net private Label label29; private TextBox txtApertureArea; private Label label30; + private Button button1; } } \ No newline at end of file diff --git a/Meade.net/SetupDialogForm.resx b/Meade.net/SetupDialogForm.resx index 56169b2..c64acf9 100644 --- a/Meade.net/SetupDialogForm.resx +++ b/Meade.net/SetupDialogForm.resx @@ -145,7 +145,7 @@ $this - 56 + 57 Bottom, Right @@ -172,7 +172,7 @@ $this - 55 + 56 12, 9 @@ -196,7 +196,7 @@ $this - 54 + 55 Top, Right @@ -223,7 +223,7 @@ $this - 53 + 54 True @@ -250,7 +250,7 @@ $this - 52 + 53 True @@ -277,7 +277,7 @@ $this - 51 + 52 97, 87 @@ -298,7 +298,7 @@ $this - 50 + 51 True @@ -325,8 +325,11 @@ $this - 49 + 50 + + 17, 17 + 388, 259 @@ -339,9 +342,6 @@ 10.0 - - 17, 17 - LX-200GPS only @@ -355,7 +355,7 @@ $this - 48 + 49 True @@ -382,7 +382,7 @@ $this - 47 + 48 True @@ -409,7 +409,7 @@ $this - 46 + 47 True @@ -436,7 +436,7 @@ $this - 45 + 46 Unchanged @@ -466,7 +466,7 @@ $this - 44 + 45 True @@ -496,7 +496,7 @@ $this - 43 + 44 Auto @@ -526,7 +526,7 @@ $this - 42 + 43 True @@ -556,7 +556,7 @@ $this - 41 + 42 True @@ -589,7 +589,7 @@ $this - 40 + 41 388, 377 @@ -613,7 +613,7 @@ $this - 38 + 39 True @@ -643,7 +643,7 @@ $this - 39 + 40 True @@ -673,7 +673,7 @@ $this - 37 + 38 True @@ -706,7 +706,7 @@ $this - 36 + 37 True @@ -733,7 +733,7 @@ $this - 35 + 36 True @@ -760,7 +760,7 @@ $this - 34 + 35 True @@ -793,8 +793,11 @@ $this - 33 + 34 + + 17, 17 + True @@ -826,7 +829,7 @@ $this - 15 + 16 True @@ -853,7 +856,7 @@ $this - 32 + 33 388, 186 @@ -874,7 +877,7 @@ $this - 31 + 32 True @@ -901,7 +904,7 @@ $this - 30 + 31 True @@ -928,7 +931,7 @@ $this - 29 + 30 388, 218 @@ -949,7 +952,7 @@ $this - 28 + 29 True @@ -976,7 +979,7 @@ $this - 27 + 28 True @@ -1003,7 +1006,7 @@ $this - 26 + 27 97, 163 @@ -1024,7 +1027,7 @@ $this - 25 + 26 97, 137 @@ -1045,7 +1048,7 @@ $this - 24 + 25 97, 190 @@ -1066,7 +1069,7 @@ $this - 23 + 24 97, 217 @@ -1087,7 +1090,7 @@ $this - 22 + 23 97, 244 @@ -1108,7 +1111,7 @@ $this - 21 + 22 True @@ -1135,7 +1138,7 @@ $this - 20 + 21 True @@ -1162,7 +1165,7 @@ $this - 19 + 20 True @@ -1189,7 +1192,7 @@ $this - 18 + 19 True @@ -1216,7 +1219,7 @@ $this - 17 + 18 True @@ -1249,7 +1252,7 @@ $this - 16 + 17 No Coordinates @@ -1279,7 +1282,7 @@ $this - 14 + 15 True @@ -1306,7 +1309,7 @@ $this - 13 + 14 True @@ -1333,7 +1336,7 @@ $this - 12 + 13 True @@ -1360,7 +1363,7 @@ $this - 11 + 12 697, 151 @@ -1381,7 +1384,7 @@ $this - 10 + 11 697, 177 @@ -1402,7 +1405,7 @@ $this - 9 + 10 True @@ -1432,7 +1435,7 @@ $this - 8 + 9 388, 87 @@ -1453,7 +1456,7 @@ $this - 7 + 8 True @@ -1483,7 +1486,7 @@ $this - 6 + 7 True @@ -1513,7 +1516,7 @@ $this - 3 + 4 388, 111 @@ -1534,7 +1537,7 @@ $this - 4 + 5 True @@ -1564,7 +1567,7 @@ $this - 5 + 6 True @@ -1594,7 +1597,7 @@ $this - 0 + 1 388, 136 @@ -1615,7 +1618,7 @@ $this - 1 + 2 True @@ -1645,7 +1648,31 @@ $this - 2 + 3 + + + 112, 399 + + + 75, 23 + + + 57 + + + Open logs + + + button1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 True diff --git a/Meade.net/packages.config b/Meade.net/packages.config index 6ea2d84..57da55c 100644 --- a/Meade.net/packages.config +++ b/Meade.net/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/TelescopeTestConsole/TelescopeTestConsole.csproj b/TelescopeTestConsole/TelescopeTestConsole.csproj index 4d30bf2..63847a2 100644 --- a/TelescopeTestConsole/TelescopeTestConsole.csproj +++ b/TelescopeTestConsole/TelescopeTestConsole.csproj @@ -59,8 +59,8 @@ - - ..\packages\JetBrains.Annotations.2020.3.0\lib\net20\JetBrains.Annotations.dll + + ..\packages\JetBrains.Annotations.2022.3.1\lib\net20\JetBrains.Annotations.dll diff --git a/TelescopeTestConsole/packages.config b/TelescopeTestConsole/packages.config index 97cf0c3..0e46bfa 100644 --- a/TelescopeTestConsole/packages.config +++ b/TelescopeTestConsole/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file From 7afa7458c7b5303e7fccc0f87d78d3fef88ccc0b Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Thu, 10 Nov 2022 18:05:39 +0000 Subject: [PATCH 08/24] Added comments for unit testing --- Meade.net.Telescope/Telescope.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 3850792..81dcdfb 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -3431,7 +3431,7 @@ namespace ASCOM.Meade.net } catch (InvalidOperationException) { - dms = SetTargetDeclination(value, !SharedResourcesWrapper.IsLongFormat); + dms = SetTargetDeclination(value, !SharedResourcesWrapper.IsLongFormat); //todo add unit test for this scenario } SharedResourcesWrapper.TargetDeclination = _utilities.DMSToDegrees(dms); @@ -3518,7 +3518,7 @@ namespace ASCOM.Meade.net } catch (InvalidOperationException) { - hms = SetTargetRightAscension(value, !SharedResourcesWrapper.IsLongFormat); + hms = SetTargetRightAscension(value, !SharedResourcesWrapper.IsLongFormat); //todo add unit test for this scenario } SharedResourcesWrapper.TargetRightAscension = _utilities.HMSToHours(hms); From febf52738e07a2ca44f1ed3540d1f031ce41c5c9 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Thu, 10 Nov 2022 20:31:30 +0000 Subject: [PATCH 09/24] Set the path to open the logs folder properly --- Meade.net/SetupDialogForm.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Meade.net/SetupDialogForm.cs b/Meade.net/SetupDialogForm.cs index 656a863..d41d3f9 100644 --- a/Meade.net/SetupDialogForm.cs +++ b/Meade.net/SetupDialogForm.cs @@ -379,9 +379,11 @@ namespace ASCOM.Meade.net private void button1_Click(object sender, EventArgs e) { + string myDocumentsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + Process.Start(new ProcessStartInfo() { - FileName = "C:\\", + FileName = $"{myDocumentsPath}\\ASCOM", UseShellExecute = true, Verb = "open" }); From c380016b717f82b9a5dbc2b9d7d9e011dcd55921 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sat, 12 Nov 2022 15:33:49 +0000 Subject: [PATCH 10/24] Changes the low precision target so that it's using seconds, instead of a fraction of a minute for the seconds portion of the coordinates. --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 9 +++++---- Meade.net.Telescope/Telescope.cs | 11 +++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 626c4ab..3c53564 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -1041,8 +1041,9 @@ namespace Meade.net.Telescope.UnitTests var ra = 12d; var dec = 34d; - _utilMock.Setup(x => x.HoursToHM(ra, ":", "", 1)).Returns(ra + "HM"); - _utilMock.Setup(x => x.DegreesToDM(dec, "*", "", 0)).Returns(dec + "DM"); + _utilMock.Setup(x => x.HoursToHMS(ra, ":", ":", ":", 0)).Returns(ra + "HM"); + _utilMock.Setup(x => x.DegreesToDMS(dec, "*", ":", ":", 0)).Returns(dec + "DM"); + _utilMock.Setup(x => x.DMSToDegrees(_testProperties.TelescopeRaResult)).Returns(_testProperties.Declination); ConnectTelescope(TelescopeList.LX200CLASSIC); @@ -1063,8 +1064,8 @@ namespace Meade.net.Telescope.UnitTests secondTelescopeInstance.TargetRightAscension = ra; secondTelescopeInstance.TargetDeclination = dec; - _utilMock.Verify(x => x.HoursToHM(ra, ":", "", 1), Times.Exactly(2)); - _utilMock.Verify(x => x.DegreesToDM(dec, "*", "", 0), Times.Exactly(2)); + _utilMock.Verify(x => x.HoursToHMS(ra, ":", ":", ":", 0), Times.Exactly(2)); + _utilMock.Verify(x => x.DegreesToDMS(dec, "*", ":", ":", 0), Times.Exactly(2)); _utilMock.Verify(x => x.HoursToHMS(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), 2), Times.Never); _utilMock.Verify(x => x.DegreesToDMS(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), 2), Times.Never); } diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 81dcdfb..3de6c6c 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -1747,10 +1747,11 @@ namespace ASCOM.Meade.net try { CheckConnected("CanUnpark"); + var canUnPark = IsUnparkable; - LogMessage("CanUnpark", "Get - " + true); + LogMessage("CanUnpark", "Get - " + canUnPark); - return IsUnparkable; + return canUnPark; } catch (Exception ex) { @@ -3448,7 +3449,8 @@ namespace ASCOM.Meade.net { var dms = useLongFormat ? _utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe) - : _utilities.DegreesToDM(value, "*", "", _digitsDe); + //: _utilities.DegreesToDM(value, "*", "", _digitsDe); + : _utilities.DegreesToDMS(value, "*", ":", ":", 0); var s = value < 0 ? string.Empty : "+"; @@ -3535,7 +3537,8 @@ namespace ASCOM.Meade.net { var hms = useLongFormat ? _utilities.HoursToHMS(value, ":", ":", ":", _digitsRa) - : _utilities.HoursToHM(value, ":", "", _digitsRa).Replace(',', '.'); + //: _utilities.HoursToHM(value, ":", "", _digitsRa).Replace(',', '.'); + : _utilities.HoursToHMS(value, ":", ":", ":", 0); hms = hms.TrimEnd(':'); From a2b15f291d756ad9cbfb18568e8125bf96559a33 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sat, 12 Nov 2022 15:47:35 +0000 Subject: [PATCH 11/24] Needed to change one more thing --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 10 +++++----- Meade.net.Telescope/Telescope.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 3c53564..b6fc5b3 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -1041,8 +1041,8 @@ namespace Meade.net.Telescope.UnitTests var ra = 12d; var dec = 34d; - _utilMock.Setup(x => x.HoursToHMS(ra, ":", ":", ":", 0)).Returns(ra + "HM"); - _utilMock.Setup(x => x.DegreesToDMS(dec, "*", ":", ":", 0)).Returns(dec + "DM"); + _utilMock.Setup(x => x.HoursToHMS(ra, ":", ":", ".", 0)).Returns(ra + "HM"); + _utilMock.Setup(x => x.DegreesToDMS(dec, "*", ":", ".", 0)).Returns(dec + "DM"); _utilMock.Setup(x => x.DMSToDegrees(_testProperties.TelescopeRaResult)).Returns(_testProperties.Declination); ConnectTelescope(TelescopeList.LX200CLASSIC); @@ -1064,8 +1064,8 @@ namespace Meade.net.Telescope.UnitTests secondTelescopeInstance.TargetRightAscension = ra; secondTelescopeInstance.TargetDeclination = dec; - _utilMock.Verify(x => x.HoursToHMS(ra, ":", ":", ":", 0), Times.Exactly(2)); - _utilMock.Verify(x => x.DegreesToDMS(dec, "*", ":", ":", 0), Times.Exactly(2)); + _utilMock.Verify(x => x.HoursToHMS(ra, ":", ":", ".", 0), Times.Exactly(2)); + _utilMock.Verify(x => x.DegreesToDMS(dec, "*", ":", ".", 0), Times.Exactly(2)); _utilMock.Verify(x => x.HoursToHMS(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), 2), Times.Never); _utilMock.Verify(x => x.DegreesToDMS(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), 2), Times.Never); } @@ -2517,7 +2517,7 @@ namespace Meade.net.Telescope.UnitTests { _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny(), false)).Returns("0"); _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); - _utilMock.Setup(x => x.HoursToHM(It.IsAny(), ":", "", It.IsAny())).Returns("00:00:00.00"); + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ".", 0)).Returns("00:00.00"); ConnectTelescope(); diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 3de6c6c..56d31f6 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -3450,7 +3450,7 @@ namespace ASCOM.Meade.net var dms = useLongFormat ? _utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe) //: _utilities.DegreesToDM(value, "*", "", _digitsDe); - : _utilities.DegreesToDMS(value, "*", ":", ":", 0); + : _utilities.DegreesToDMS(value, "*", ":", ".", 0); var s = value < 0 ? string.Empty : "+"; @@ -3538,7 +3538,7 @@ namespace ASCOM.Meade.net var hms = useLongFormat ? _utilities.HoursToHMS(value, ":", ":", ":", _digitsRa) //: _utilities.HoursToHM(value, ":", "", _digitsRa).Replace(',', '.'); - : _utilities.HoursToHMS(value, ":", ":", ":", 0); + : _utilities.HoursToHMS(value, ":", ":", ".", 0); hms = hms.TrimEnd(':'); From da1d1baa303ab93e28931de0a9c099c5eb9061b3 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sat, 12 Nov 2022 16:54:12 +0000 Subject: [PATCH 12/24] Another tweak for the low preceion code. --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 10 +++++----- Meade.net.Telescope/Telescope.cs | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index b6fc5b3..808ea3b 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -1041,8 +1041,8 @@ namespace Meade.net.Telescope.UnitTests var ra = 12d; var dec = 34d; - _utilMock.Setup(x => x.HoursToHMS(ra, ":", ":", ".", 0)).Returns(ra + "HM"); - _utilMock.Setup(x => x.DegreesToDMS(dec, "*", ":", ".", 0)).Returns(dec + "DM"); + _utilMock.Setup(x => x.HoursToHMS(ra, ":", ".", "", 0)).Returns(ra + "HM"); + _utilMock.Setup(x => x.DegreesToDM(dec, "*", "", 0)).Returns(dec + "DM"); _utilMock.Setup(x => x.DMSToDegrees(_testProperties.TelescopeRaResult)).Returns(_testProperties.Declination); ConnectTelescope(TelescopeList.LX200CLASSIC); @@ -1064,8 +1064,8 @@ namespace Meade.net.Telescope.UnitTests secondTelescopeInstance.TargetRightAscension = ra; secondTelescopeInstance.TargetDeclination = dec; - _utilMock.Verify(x => x.HoursToHMS(ra, ":", ":", ".", 0), Times.Exactly(2)); - _utilMock.Verify(x => x.DegreesToDMS(dec, "*", ":", ".", 0), Times.Exactly(2)); + _utilMock.Verify(x => x.HoursToHMS(ra, ":", ".", "", 0), Times.Exactly(2)); + _utilMock.Verify(x => x.DegreesToDM(dec, "*", "", 0), Times.Exactly(2)); _utilMock.Verify(x => x.HoursToHMS(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), 2), Times.Never); _utilMock.Verify(x => x.DegreesToDMS(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), 2), Times.Never); } @@ -2517,7 +2517,7 @@ namespace Meade.net.Telescope.UnitTests { _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny(), false)).Returns("0"); _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); - _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ".", 0)).Returns("00:00.00"); + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ".", "", 0)).Returns("00:00.00"); ConnectTelescope(); diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 56d31f6..db9cf01 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -3432,7 +3432,7 @@ namespace ASCOM.Meade.net } catch (InvalidOperationException) { - dms = SetTargetDeclination(value, !SharedResourcesWrapper.IsLongFormat); //todo add unit test for this scenario + dms = SetTargetDeclination(value, !SharedResourcesWrapper.IsLongFormat); } SharedResourcesWrapper.TargetDeclination = _utilities.DMSToDegrees(dms); @@ -3450,7 +3450,7 @@ namespace ASCOM.Meade.net var dms = useLongFormat ? _utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe) //: _utilities.DegreesToDM(value, "*", "", _digitsDe); - : _utilities.DegreesToDMS(value, "*", ":", ".", 0); + : _utilities.DegreesToDM(value, "*", "", 0); var s = value < 0 ? string.Empty : "+"; @@ -3520,7 +3520,7 @@ namespace ASCOM.Meade.net } catch (InvalidOperationException) { - hms = SetTargetRightAscension(value, !SharedResourcesWrapper.IsLongFormat); //todo add unit test for this scenario + hms = SetTargetRightAscension(value, !SharedResourcesWrapper.IsLongFormat); } SharedResourcesWrapper.TargetRightAscension = _utilities.HMSToHours(hms); @@ -3538,7 +3538,7 @@ namespace ASCOM.Meade.net var hms = useLongFormat ? _utilities.HoursToHMS(value, ":", ":", ":", _digitsRa) //: _utilities.HoursToHM(value, ":", "", _digitsRa).Replace(',', '.'); - : _utilities.HoursToHMS(value, ":", ":", ".", 0); + : _utilities.HoursToHMS(value, ":", ".", "", 0); hms = hms.TrimEnd(':'); From cd304f5955786ebff2a96f0be528b2af200be606 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sat, 12 Nov 2022 17:28:25 +0000 Subject: [PATCH 13/24] Let's see what this does --- .../TelescopeUnitTests.cs | 20 +++++++++++++++++++ Meade.net.Telescope/Telescope.cs | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 808ea3b..a4e35a7 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -2389,6 +2389,8 @@ namespace Meade.net.Telescope.UnitTests public void TargetDeclination_Set_WhenTelescopeReportsInvalidDec_ThenThrowsException() { _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny(), false)).Returns("0"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); ConnectTelescope(); @@ -3124,6 +3126,9 @@ namespace Meade.net.Telescope.UnitTests [Test] public void SlewToTargetAsync_WhenTargetRightAscensionNotSet_ThenThrowsException() { + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); + ConnectTelescope(); _telescope.TargetDeclination = 1; @@ -3136,6 +3141,8 @@ namespace Meade.net.Telescope.UnitTests public void SlewToTargetAsync_WhenTargetSet_ThenAttemptsSlew() { _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); ConnectTelescope(); @@ -3152,6 +3159,8 @@ namespace Meade.net.Telescope.UnitTests _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0"); _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); ConnectTelescope(); @@ -3171,6 +3180,8 @@ namespace Meade.net.Telescope.UnitTests _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Below horizon"); _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); ConnectTelescope(); @@ -3184,6 +3195,9 @@ namespace Meade.net.Telescope.UnitTests [Test] public void SlewToTargetAsync_WhenTargetBelowElevation_ThenThrowsException() { + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); + _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("2"); _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Above below elevation"); @@ -3203,6 +3217,8 @@ namespace Meade.net.Telescope.UnitTests { _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("3"); _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("the telescope can hit the tripod"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); @@ -3231,6 +3247,10 @@ namespace Meade.net.Telescope.UnitTests var slewCounter = 0; var iterations = 10; + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); + + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); _sharedResourcesWrapperMock.Setup(x => x.SendString(_traceLoggerMock.Object, "D", false)).Returns(() => diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index db9cf01..1272d7e 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -3449,9 +3449,10 @@ namespace ASCOM.Meade.net { var dms = useLongFormat ? _utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe) - //: _utilities.DegreesToDM(value, "*", "", _digitsDe); : _utilities.DegreesToDM(value, "*", "", 0); + dms = dms.TrimEnd(':'); + var s = value < 0 ? string.Empty : "+"; var command = $"Sd{s}{dms}"; From 8539308cf3e12e0d92c79e836744af0b3eb258b0 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sat, 12 Nov 2022 17:34:24 +0000 Subject: [PATCH 14/24] oops --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index a4e35a7..5ff7e62 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -2389,8 +2389,8 @@ namespace Meade.net.Telescope.UnitTests public void TargetDeclination_Set_WhenTelescopeReportsInvalidDec_ThenThrowsException() { _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny(), false)).Returns("0"); - _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); - _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", "", 0)).Returns("50*00"); + _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("50*00"); ConnectTelescope(); From 005643a7c735d6fa683bafcb737227d023712448 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sat, 12 Nov 2022 17:35:33 +0000 Subject: [PATCH 15/24] Corrected all unit test setups. --- .../TelescopeUnitTests.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 5ff7e62..725e747 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -3126,7 +3126,7 @@ namespace Meade.net.Telescope.UnitTests [Test] public void SlewToTargetAsync_WhenTargetRightAscensionNotSet_ThenThrowsException() { - _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", "", 0)).Returns("00*00"); _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); ConnectTelescope(); @@ -3141,7 +3141,7 @@ namespace Meade.net.Telescope.UnitTests public void SlewToTargetAsync_WhenTargetSet_ThenAttemptsSlew() { _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); - _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", "", 0)).Returns("00*00"); _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); ConnectTelescope(); @@ -3159,7 +3159,7 @@ namespace Meade.net.Telescope.UnitTests _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("0"); _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); - _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", "", 0)).Returns("00*00"); _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); ConnectTelescope(); @@ -3180,7 +3180,7 @@ namespace Meade.net.Telescope.UnitTests _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("Below horizon"); _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); - _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", "", 0)).Returns("00*00"); _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); ConnectTelescope(); @@ -3195,7 +3195,7 @@ namespace Meade.net.Telescope.UnitTests [Test] public void SlewToTargetAsync_WhenTargetBelowElevation_ThenThrowsException() { - _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", "", 0)).Returns("00*00"); _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("2"); @@ -3217,7 +3217,7 @@ namespace Meade.net.Telescope.UnitTests { _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, "MS", false)).Returns("3"); _sharedResourcesWrapperMock.Setup(x => x.ReadTerminated()).Returns("the telescope can hit the tripod"); - _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", "", 0)).Returns("00*00"); _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); @@ -3247,7 +3247,7 @@ namespace Meade.net.Telescope.UnitTests var slewCounter = 0; var iterations = 10; - _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", ":", 0)).Returns("00*00"); + _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", "", 0)).Returns("00*00"); _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("00*00"); _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); From 21d1d93235d6ce6776133395c6fa701c1ea74bee Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sat, 12 Nov 2022 19:16:41 +0000 Subject: [PATCH 16/24] Another attempt at the Dec value --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 11 ++++++----- Meade.net.Telescope/Telescope.cs | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 725e747..9344b10 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -1038,11 +1038,11 @@ namespace Meade.net.Telescope.UnitTests [Test] public void IsLongFormat_WhenHighPrecisionNotSupportedAndSecondConnectionMade_ThenDigitPrecisionValuesArePreserved() { - var ra = 12d; - var dec = 34d; + double ra = 12; + double dec = 34; _utilMock.Setup(x => x.HoursToHMS(ra, ":", ".", "", 0)).Returns(ra + "HM"); - _utilMock.Setup(x => x.DegreesToDM(dec, "*", "", 0)).Returns(dec + "DM"); + _utilMock.Setup(x => x.DegreesToDMS(dec, "*", ".", "", 0)).Returns(dec + "DM"); _utilMock.Setup(x => x.DMSToDegrees(_testProperties.TelescopeRaResult)).Returns(_testProperties.Declination); ConnectTelescope(TelescopeList.LX200CLASSIC); @@ -1065,7 +1065,7 @@ namespace Meade.net.Telescope.UnitTests secondTelescopeInstance.TargetDeclination = dec; _utilMock.Verify(x => x.HoursToHMS(ra, ":", ".", "", 0), Times.Exactly(2)); - _utilMock.Verify(x => x.DegreesToDM(dec, "*", "", 0), Times.Exactly(2)); + _utilMock.Verify(x => x.DegreesToDMS(dec, "*", ".", "", 0), Times.Exactly(2)); _utilMock.Verify(x => x.HoursToHMS(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), 2), Times.Never); _utilMock.Verify(x => x.DegreesToDMS(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), 2), Times.Never); } @@ -2390,7 +2390,8 @@ namespace Meade.net.Telescope.UnitTests { _sharedResourcesWrapperMock.Setup(x => x.SendChar(_traceLoggerMock.Object, It.IsAny(), false)).Returns("0"); _utilMock.Setup(x => x.DegreesToDM(It.IsAny(), "*", "", 0)).Returns("50*00"); - _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("50*00"); + _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ":", ":", It.IsAny())).Returns("50*00"); + _utilMock.Setup(x => x.DegreesToDMS(It.IsAny(), "*", ".", "", It.IsAny())).Returns("50*00"); ConnectTelescope(); diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 1272d7e..099d64d 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -3449,7 +3449,7 @@ namespace ASCOM.Meade.net { var dms = useLongFormat ? _utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe) - : _utilities.DegreesToDM(value, "*", "", 0); + : _utilities.DegreesToDMS(value, "*", ".", "", 0); dms = dms.TrimEnd(':'); From 888ab1aa46019797da9ba2daddbed9878264a632 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sat, 12 Nov 2022 20:50:48 +0000 Subject: [PATCH 17/24] Added LX800 series to scope as an autostar II based telescope. --- Meade.net.Telescope/Telescope.cs | 14 ++++++++++++-- Meade.net/TelescopeList.cs | 7 +++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 099d64d..be7a241 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -582,6 +582,7 @@ namespace ASCOM.Meade.net { case TelescopeList.LX200GPS: case TelescopeList.RCX400: + case TelescopeList.LX800: { LogMessage("SendTimeTimeToHandbox", $"{SharedResourcesWrapper.ProductName} Detecting if daylight savings message on screen: {_profileProperties.SendDateTime}"); @@ -655,7 +656,8 @@ namespace ASCOM.Meade.net { case TelescopeList.LX200GPS: case TelescopeList.RCX400: - { + case TelescopeList.LX800: + { var displayText = Action("Handbox", "readdisplay"); if (displayText.Contains("Daylight")) @@ -725,6 +727,7 @@ namespace ASCOM.Meade.net case TelescopeList.Autostar497: return FirmwareIsGreaterThan(TelescopeList.Autostar497_31Ee); case TelescopeList.LX200GPS: + case TelescopeList.LX800: return true; case TelescopeList.RCX400: return FirmwareIsGreaterThan(TelescopeList.RCX400_22I); @@ -756,6 +759,7 @@ namespace ASCOM.Meade.net { case TelescopeList.LX200GPS: case TelescopeList.RCX400: + case TelescopeList.LX800: return true; default: return false; @@ -771,6 +775,8 @@ namespace ASCOM.Meade.net case TelescopeList.Audiostar: case TelescopeList.Autostar497: return FirmwareIsGreaterThan(TelescopeList.Autostar497_43Eg); + case TelescopeList.LX800: + return FirmwareIsGreaterThan(TelescopeList.LX800_11i); case TelescopeList.LX200GPS: return FirmwareIsGreaterThan(TelescopeList.LX200GPS_42G); case TelescopeList.RCX400: @@ -1243,6 +1249,7 @@ namespace ASCOM.Meade.net { case TelescopeList.LX200GPS: case TelescopeList.RCX400: + case TelescopeList.LX800: return GetRealTelescopeAltitude(); default: var altAz = CalcAltAzFromTelescopeEqData(); @@ -1409,6 +1416,7 @@ namespace ASCOM.Meade.net { case TelescopeList.LX200GPS: case TelescopeList.RCX400: + case TelescopeList.LX800: return GetRealTelescopeAzimuth(); default: var altAz = CalcAltAzFromTelescopeEqData(); @@ -1769,7 +1777,8 @@ namespace ASCOM.Meade.net { TelescopeList.LX200GPS, TelescopeList.RCX400, - TelescopeList.LX200CLASSIC + TelescopeList.LX200CLASSIC, + TelescopeList.LX800 }; return unParkableScopes.Contains(SharedResourcesWrapper.ProductName); @@ -3869,6 +3878,7 @@ namespace ASCOM.Meade.net { case TelescopeList.RCX400: case TelescopeList.LX200GPS: + case TelescopeList.LX800: SharedResourcesWrapper.SendChar(Tl, "I"); //:I# LX200 GPS Only - Causes the telescope to cease current operations and restart at its power on initialization. //Returns: X once the handset restart has completed diff --git a/Meade.net/TelescopeList.cs b/Meade.net/TelescopeList.cs index 59514cd..9cac51c 100644 --- a/Meade.net/TelescopeList.cs +++ b/Meade.net/TelescopeList.cs @@ -31,6 +31,13 @@ public const string LX200GPS_42G = "4.2g"; #endregion + #region LX800 + public const string LX800 = "LX800"; + + public const string LX800_11i = "1.1i"; + + #endregion + #region LX200EMC // ReSharper disable once InconsistentNaming public const string LX200CLASSIC = "LX200 Classic"; //GVP command is not supported! From d5108cf4db2e785dac77cb0af65d4b6322d52694 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Wed, 23 Nov 2022 16:06:38 +0000 Subject: [PATCH 18/24] Adding a possible workaround to the Autostart not syncing problem --- Meade.net.Telescope/Telescope.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index be7a241..3491dd6 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -3354,7 +3354,16 @@ namespace ASCOM.Meade.net CheckConnected("SyncToTarget"); CheckParked(); - var result = SharedResourcesWrapper.SendString(Tl, "CM"); + string result; + try + { + result = SharedResourcesWrapper.SendString(Tl, "CM"); + } + catch (TimeoutException) + { + //Some old autostars timeout as the result isn't properly returned, until the next successful command is sent! + result = SharedResourcesWrapper.SendString(Tl, "Ga"); + } //: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. From 1ce2afe9cef9697117a34ff23c90157d42e55364 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Thu, 24 Nov 2022 15:21:32 +0000 Subject: [PATCH 19/24] Trying the Ack command instead to see if this can workaround the CM bug. --- Meade.net.Telescope/Telescope.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 3491dd6..d8fcfdf 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -3362,7 +3362,7 @@ namespace ASCOM.Meade.net catch (TimeoutException) { //Some old autostars timeout as the result isn't properly returned, until the next successful command is sent! - result = SharedResourcesWrapper.SendString(Tl, "Ga"); + result = GetAlignmentString(); } //:CM# Synchronizes the telescope's position with the currently selected database object's coordinates. //Returns: From 466d995873dda9299e99f40ccd676b53a39578c2 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sat, 26 Nov 2022 17:10:46 +0000 Subject: [PATCH 20/24] Upgraded max steps to 30000 to allow for much much longer moves. --- Meade.net.Focuser.UnitTests/FocuserUnitTests.cs | 8 ++++---- Meade.net.focuser/Focuser.cs | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Meade.net.Focuser.UnitTests/FocuserUnitTests.cs b/Meade.net.Focuser.UnitTests/FocuserUnitTests.cs index e5699dc..3984680 100644 --- a/Meade.net.Focuser.UnitTests/FocuserUnitTests.cs +++ b/Meade.net.Focuser.UnitTests/FocuserUnitTests.cs @@ -364,7 +364,7 @@ namespace Meade.net.Focuser.UnitTests { var result = _focuser.MaxIncrement; - Assert.That(result, Is.EqualTo(7000)); + Assert.That(result, Is.EqualTo(30000)); } [Test] @@ -372,7 +372,7 @@ namespace Meade.net.Focuser.UnitTests { var result = _focuser.MaxStep; - Assert.That(result, Is.EqualTo(7000)); + Assert.That(result, Is.EqualTo(30000)); } [Test] @@ -382,8 +382,8 @@ namespace Meade.net.Focuser.UnitTests Assert.That(exception.Message, Is.EqualTo("Not connected to focuser when trying to execute: Move")); } - [TestCase(-7001)] - [TestCase(7001)] + [TestCase(-30001)] + [TestCase(300001)] public void Move_WhenLargerThanMaxIncrement_ThenThrowsException(int position) { ConnectFocuser(); diff --git a/Meade.net.focuser/Focuser.cs b/Meade.net.focuser/Focuser.cs index 9753bb6..c417413 100644 --- a/Meade.net.focuser/Focuser.cs +++ b/Meade.net.focuser/Focuser.cs @@ -260,7 +260,7 @@ namespace ASCOM.Meade.net } } - private readonly int _maxIncrement = 7000; + private readonly int _maxIncrement = 30000; public int MaxIncrement { get @@ -270,7 +270,7 @@ namespace ASCOM.Meade.net } } - private readonly int _maxStep = 7000; + private readonly int _maxStep = 30000; public int MaxStep { From 4b78d8fb4f4d6933e710236caac418de90fcbd47 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sat, 31 Dec 2022 22:03:39 +0000 Subject: [PATCH 21/24] Added code to check for LX200GPS firmware version 4G0m which does not support the GW command. --- Meade.net.Telescope/Telescope.cs | 4 ++++ Meade.net/TelescopeList.cs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index d8fcfdf..d35e2ea 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -778,6 +778,10 @@ namespace ASCOM.Meade.net case TelescopeList.LX800: return FirmwareIsGreaterThan(TelescopeList.LX800_11i); case TelescopeList.LX200GPS: + if (SharedResourcesWrapper.FirmwareVersion.Equals(TelescopeList.LX200GPS_4G0M, + StringComparison.InvariantCultureIgnoreCase)) + return false; + return FirmwareIsGreaterThan(TelescopeList.LX200GPS_42G); case TelescopeList.RCX400: return FirmwareIsGreaterThan(TelescopeList.RCX400_22I); diff --git a/Meade.net/TelescopeList.cs b/Meade.net/TelescopeList.cs index 9cac51c..15c8307 100644 --- a/Meade.net/TelescopeList.cs +++ b/Meade.net/TelescopeList.cs @@ -29,6 +29,8 @@ public const string LX200GPS_42F = "4.2f"; // ReSharper disable once InconsistentNaming public const string LX200GPS_42G = "4.2g"; + + public const string LX200GPS_4G0M = "4G0m"; #endregion #region LX800 From 4be35eb5d727e4cb87080e07580bce503b391857 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sun, 1 Jan 2023 22:31:23 +0000 Subject: [PATCH 22/24] Added unit test for LX200GPS with german firmware --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 9344b10..62b3a12 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -635,6 +635,7 @@ namespace Meade.net.Telescope.UnitTests [TestCase("Auto", "Autostar", "A4S4", true)] [TestCase("Auto", "Autostar II", "", false)] [TestCase("Auto", "LX2001", "", true)] + [TestCase("Auto", "LX2001", "4G0m", false)] [TestCase("Auto", ":GVP", "", false)] //LX200 Classic [TestCase("Guide Rate Slew", "LX2001", "", false)] //force old style [TestCase("Pulse Guiding", ":GVP", "", true)] //force new style From b263d5f3e2d8519e166ecd1d6a83ba274b9fa083 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Sun, 1 Jan 2023 22:37:22 +0000 Subject: [PATCH 23/24] Removed wrong test. --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 62b3a12..9344b10 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -635,7 +635,6 @@ namespace Meade.net.Telescope.UnitTests [TestCase("Auto", "Autostar", "A4S4", true)] [TestCase("Auto", "Autostar II", "", false)] [TestCase("Auto", "LX2001", "", true)] - [TestCase("Auto", "LX2001", "4G0m", false)] [TestCase("Auto", ":GVP", "", false)] //LX200 Classic [TestCase("Guide Rate Slew", "LX2001", "", false)] //force old style [TestCase("Pulse Guiding", ":GVP", "", true)] //force new style From 5678285e0e62079e29f106c700ddbf87eb760950 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Mon, 2 Jan 2023 09:31:05 +0000 Subject: [PATCH 24/24] Added unit test to make sure that the LX200GPS with german firmware works as expected. --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 2 +- Meade.net.Telescope/Telescope.cs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index 9344b10..f8f66fb 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -791,12 +791,12 @@ namespace Meade.net.Telescope.UnitTests Assert.That(exception.Message, Is.EqualTo("Not connected to telescope when trying to execute: AlignmentMode Get")); } - [TestCase("A", AlignmentModes.algAltAz, TelescopeList.Autostar497, TelescopeList.Autostar497_31Ee)] [TestCase("P", AlignmentModes.algPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_31Ee)] [TestCase("A", AlignmentModes.algAltAz, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)] [TestCase("P", AlignmentModes.algPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)] [TestCase("G", AlignmentModes.algGermanPolar, TelescopeList.Autostar497, TelescopeList.Autostar497_43Eg)] + [TestCase("P", AlignmentModes.algPolar, TelescopeList.LX200GPS, TelescopeList.LX200GPS_4G0M)] public void AlignmentMode_Get_WhenScopeInAltAz_ReturnsAltAz(string telescopeMode, AlignmentModes alignmentMode, string productName, string firmware) { _testProperties.AlignmentMode = telescopeMode; diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index d35e2ea..5d1bc68 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -1102,7 +1102,7 @@ namespace ASCOM.Meade.net LogMessage("AlignmentMode Get", $"Sending Ack code."); var alignmentString = GetAlignmentString(); AlignmentModes alignmentMode; - switch (alignmentString) + switch (alignmentString.ToUpperInvariant()) { case "A": LogMessage("AlignmentMode Get", $"Telescope is in AltAz"); @@ -1116,9 +1116,10 @@ namespace ASCOM.Meade.net LogMessage("AlignmentMode Get", $"Telescope is in Land mode"); alignmentMode = AlignmentModes.algAltAz; break; - //case "G": - //alignmentMode = AlignmentModes.algGermanPolar; - //break; + case "G": + LogMessage("AlignmentMode Get", $"Telescope is in German Polar mode"); + alignmentMode = AlignmentModes.algGermanPolar; + break; default: var msg = $"unknown alignment returned from telescope: {alignmentString}"; LogMessage("AlignmentMode Get", msg);