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.

This commit is contained in:
2019-07-23 10:41:19 +01:00
parent e9d41a2412
commit cc05808542
2 changed files with 11 additions and 1 deletions
+7 -1
View File
@@ -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()
+4
View File
@@ -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}");
}
/// <summary>