From 3dc87e37241f178c560b098f9e07c7ec4b13bee5 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 4 Oct 2019 20:42:46 +0100 Subject: [PATCH] Added new alignment mode to the log --- Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs | 13 +++++++++++++ Meade.net.Telescope/Telescope.cs | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs index b2565f0..b6568ad 100644 --- a/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs +++ b/Meade.net.Telescope.UnitTests/TelescopeUnitTests.cs @@ -348,6 +348,9 @@ namespace Meade.net.Telescope.UnitTests [TestCase(false)] public void Connected_Get_ReturnsExpectedValue(bool expectedConnected) { + const char ack = (char)6; + _sharedResourcesWrapperMock.Setup(x => x.SendChar(ack.ToString())).Returns("P"); + _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(() => TelescopeList.Autostar497); _sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(() => TelescopeList.Autostar497_31Ee); _telescope.Connected = expectedConnected; @@ -367,6 +370,10 @@ namespace Meade.net.Telescope.UnitTests var productName = TelescopeList.LX200GPS; var firmware = string.Empty; + + const char ack = (char)6; + _sharedResourcesWrapperMock.Setup(x => x.SendChar(ack.ToString())).Returns("P"); + _sharedResourcesWrapperMock.Setup(x => x.ProductName).Returns(productName); _sharedResourcesWrapperMock.Setup(x => x.FirmwareVersion).Returns(firmware); _telescope.Connected = true; @@ -409,6 +416,9 @@ namespace Meade.net.Telescope.UnitTests [Test] public void Connected_Set_SettingFalseWhenTrue_ThenDisconnects() { + const char ack = (char)6; + _sharedResourcesWrapperMock.Setup(x => x.SendChar(ack.ToString())).Returns("P"); + ConnectTelescope(); _sharedResourcesWrapperMock.Verify(x => x.Connect(It.IsAny(), It.IsAny()), Times.Once); @@ -804,6 +814,9 @@ namespace Meade.net.Telescope.UnitTests [TestCase("Low", true, false)] public void Precision_Set_WhenConnectedAndPrecisionSetHighScopeIsLow_ThenTelescopePrecisionChanged(string desiredPresision, bool telescopePrecision, bool finalPrecision) { + const char ack = (char)6; + _sharedResourcesWrapperMock.Setup(x => x.SendChar(ack.ToString())).Returns("P"); + _profileProperties.Precision = desiredPresision; var currentPrecision = telescopePrecision; diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 5f7ee87..75682f6 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -388,6 +388,10 @@ namespace ASCOM.Meade.net if (connectionInfo.SameDevice == 1) { LogMessage("Connected Set", "Making first connection telescope adjustments"); + + AlignmentModes alignmode = AlignmentMode; + LogMessage("Connected Set", alignmode.ToString()); + //These settings are applied only when the first device connects to the telescope. SetLongFormat(true);