From cc05808542c95ebed64890a09741eb0305a9c330 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 23 Jul 2019 10:41:19 +0100 Subject: [PATCH] Added extra logging when reading the profile into the driver. Added readprofile just before the connection is made to make sure that the latest values are used. --- Meade.net.Telescope/Telescope.cs | 8 +++++++- Meade.net.focuser/Focuser.cs | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Meade.net.Telescope/Telescope.cs b/Meade.net.Telescope/Telescope.cs index 600ef4e..bcc866a 100644 --- a/Meade.net.Telescope/Telescope.cs +++ b/Meade.net.Telescope/Telescope.cs @@ -367,9 +367,11 @@ namespace ASCOM.Meade.net if (value) { - LogMessage("Connected Set", "Connecting to port {0}", _comPort); try { + ReadProfile(); + + LogMessage("Connected Set", "Connecting to port {0}", _comPort); _sharedResourcesWrapper.Connect("Serial"); try { @@ -2246,6 +2248,10 @@ namespace ASCOM.Meade.net _tl.Enabled = profileProperties.TraceLogger; _comPort = profileProperties.ComPort; _guideRate = profileProperties.GuideRateArcSecondsPerSecond; + + LogMessage("ReadProfile", $"Trace logger enabled: {_tl.Enabled}"); + LogMessage("ReadProfile", $"Com Port: {_comPort}"); + LogMessage("ReadProfile", $"Guide Rate: {_guideRate}"); } internal void WriteProfile() diff --git a/Meade.net.focuser/Focuser.cs b/Meade.net.focuser/Focuser.cs index 2e80def..cbd9ad2 100644 --- a/Meade.net.focuser/Focuser.cs +++ b/Meade.net.focuser/Focuser.cs @@ -178,6 +178,7 @@ namespace ASCOM.Meade.net { try { + ReadProfile(); _sharedResourcesWrapper.Connect("Serial"); try { @@ -579,6 +580,9 @@ namespace ASCOM.Meade.net var profileProperties = _sharedResourcesWrapper.ReadProfile(); Tl.Enabled = profileProperties.TraceLogger; _comPort = profileProperties.ComPort; + + LogMessage("ReadProfile", $"Trace logger enabled: {Tl.Enabled}"); + LogMessage("ReadProfile", $"Com Port: {_comPort}"); } ///