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/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.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 28dca9c..f8f66fb 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(() => @@ -793,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; @@ -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; @@ -1040,11 +1038,12 @@ 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.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); @@ -1065,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); } @@ -1821,7 +1820,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 +1974,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 +2028,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 +2045,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 +2251,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"; @@ -2390,6 +2389,9 @@ 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("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(); @@ -2517,6 +2519,8 @@ 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"); + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ".", "", 0)).Returns("00:00.00"); ConnectTelescope(); @@ -2669,9 +2673,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(); @@ -2709,11 +2712,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; @@ -2762,9 +2763,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(); @@ -2788,9 +2789,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); @@ -2807,11 +2808,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); @@ -2836,7 +2837,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; @@ -2870,23 +2871,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"); @@ -2897,10 +2898,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)); } @@ -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; @@ -3124,6 +3127,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; @@ -3135,6 +3141,10 @@ 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"); + _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.TargetRightAscension = 2; @@ -3149,6 +3159,10 @@ 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(); _telescope.TargetRightAscension = 2; @@ -3166,6 +3180,10 @@ 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"); + _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.TargetRightAscension = 2; @@ -3178,9 +3196,14 @@ 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"); + _utilMock.Setup(x => x.HoursToHMS(It.IsAny(), ":", ":", ":", It.IsAny())).Returns("00:00:00.00"); + ConnectTelescope(); _telescope.TargetRightAscension = 2; @@ -3195,6 +3218,10 @@ 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"); ConnectTelescope(); @@ -3220,6 +3247,13 @@ namespace Meade.net.Telescope.UnitTests var preTestItterations = 1; 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(() => { slewCounter++; @@ -3252,7 +3286,7 @@ namespace Meade.net.Telescope.UnitTests { var digitsRA = 2; - _testProperties.rightAscension = 1; + _testProperties.RightAscension = 1; var declination = 2; @@ -3260,18 +3294,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); } @@ -3286,7 +3320,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"; @@ -3294,9 +3328,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); @@ -3317,8 +3351,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); @@ -3371,8 +3405,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; @@ -3387,17 +3421,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); } @@ -3411,14 +3445,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"); @@ -3442,8 +3476,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)); } @@ -3465,9 +3499,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"); @@ -3479,7 +3513,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] @@ -3505,9 +3539,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(); @@ -3739,7 +3773,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); @@ -3754,7 +3788,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; }); @@ -3778,7 +3812,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(); @@ -3791,7 +3825,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/Telescope.cs b/Meade.net.Telescope/Telescope.cs index d901a05..5d1bc68 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,7 +775,13 @@ 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: + if (SharedResourcesWrapper.FirmwareVersion.Equals(TelescopeList.LX200GPS_4G0M, + StringComparison.InvariantCultureIgnoreCase)) + return false; + return FirmwareIsGreaterThan(TelescopeList.LX200GPS_42G); case TelescopeList.RCX400: return FirmwareIsGreaterThan(TelescopeList.RCX400_22I); @@ -1092,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"); @@ -1106,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); @@ -1243,6 +1254,7 @@ namespace ASCOM.Meade.net { case TelescopeList.LX200GPS: case TelescopeList.RCX400: + case TelescopeList.LX800: return GetRealTelescopeAltitude(); default: var altAz = CalcAltAzFromTelescopeEqData(); @@ -1409,6 +1421,7 @@ namespace ASCOM.Meade.net { case TelescopeList.LX200GPS: case TelescopeList.RCX400: + case TelescopeList.LX800: return GetRealTelescopeAzimuth(); default: var altAz = CalcAltAzFromTelescopeEqData(); @@ -1747,10 +1760,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) { @@ -1768,7 +1782,8 @@ namespace ASCOM.Meade.net { TelescopeList.LX200GPS, TelescopeList.RCX400, - TelescopeList.LX200CLASSIC + TelescopeList.LX200CLASSIC, + TelescopeList.LX800 }; return unParkableScopes.Contains(SharedResourcesWrapper.ProductName); @@ -3344,7 +3359,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 = GetAlignmentString(); + } //: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. @@ -3424,25 +3448,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 = SetTargetDeclination(value, SharedResourcesWrapper.IsLongFormat); + } + catch (InvalidOperationException) + { + dms = SetTargetDeclination(value, !SharedResourcesWrapper.IsLongFormat); } SharedResourcesWrapper.TargetDeclination = _utilities.DMSToDegrees(dms); @@ -3455,6 +3468,34 @@ namespace ASCOM.Meade.net } } + private string SetTargetDeclination(double value, bool useLongFormat) + { + var dms = useLongFormat + ? _utilities.DegreesToDMS(value, "*", ":", ":", _digitsDe) + : _utilities.DegreesToDMS(value, "*", ".", "", 0); + + dms = dms.TrimEnd(':'); + + 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 @@ -3496,22 +3537,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 +3557,30 @@ namespace ASCOM.Meade.net } } + private string SetTargetRightAscension(double value, bool useLongFormat) + { + var hms = useLongFormat + ? _utilities.HoursToHMS(value, ":", ":", ":", _digitsRa) + //: _utilities.HoursToHM(value, ":", "", _digitsRa).Replace(',', '.'); + : _utilities.HoursToHMS(value, ":", ".", "", 0); + + hms = hms.TrimEnd(':'); + + 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 @@ -3834,6 +3892,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.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/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 { 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..d41d3f9 100644 --- a/Meade.net/SetupDialogForm.cs +++ b/Meade.net/SetupDialogForm.cs @@ -376,6 +376,18 @@ namespace ASCOM.Meade.net txtFocalLength.Text = txtFocalLength.Text.Remove(txtFocalLength.Text.Length - 1); } } + + private void button1_Click(object sender, EventArgs e) + { + string myDocumentsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + + Process.Start(new ProcessStartInfo() + { + FileName = $"{myDocumentsPath}\\ASCOM", + 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/TelescopeList.cs b/Meade.net/TelescopeList.cs index 59514cd..15c8307 100644 --- a/Meade.net/TelescopeList.cs +++ b/Meade.net/TelescopeList.cs @@ -29,6 +29,15 @@ 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 + public const string LX800 = "LX800"; + + public const string LX800_11i = "1.1i"; + #endregion #region LX200EMC 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