Changed the initialisation order to avoid issue with ISharedResourcesWrapper being called before it's created.

This commit is contained in:
2019-07-08 22:07:35 +01:00
parent ca3dd0e4fd
commit f8cbc3fa8d
2 changed files with 15 additions and 20 deletions
+8 -8
View File
@@ -74,20 +74,20 @@ namespace ASCOM.Meade.net
/// </summary>
public Telescope()
{
tl = new TraceLogger("", "Meade.net.Telescope");
ReadProfile(); // Read device configuration from the ASCOM Profile store
tl.LogMessage("Telescope", "Starting initialisation");
IsConnected = false; // Initialise connected to false
//todo move this out to IOC
_utilities = new Util(); //Initialise util object
_utilitiesExtra = new Util(); //Initialise util object
_astroUtilities = new AstroUtils(); // Initialise astro utilities object
_sharedResourcesWrapper = new SharedResourcesWrapper();
//TODO: Implement your additional construction here
_astroMaths = new AstroMaths();
tl = new TraceLogger("", "Meade.net.Telescope");
tl.LogMessage("Telescope", "Starting initialisation");
ReadProfile(); // Read device configuration from the ASCOM Profile store
IsConnected = false; // Initialise connected to false
tl.LogMessage("Telescope", "Completed initialisation");
}
+7 -12
View File
@@ -1,14 +1,8 @@
#define Focuser
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Runtime.InteropServices;
using ASCOM;
using ASCOM.Astrometry;
using ASCOM.Astrometry.AstroUtils;
using ASCOM.Utilities;
using ASCOM.DeviceInterface;
using System.Globalization;
@@ -71,15 +65,16 @@ namespace ASCOM.Meade.net
/// </summary>
public Focuser()
{
tl = new TraceLogger("", "Meade.net.focusser");
ReadProfile(); // Read device configuration from the ASCOM Profile store
tl.LogMessage("Focuser", "Starting initialisation");
IsConnected = false; // Initialise connected to false
//todo move this out to IOC
_utilities = new Util(); //Initialise util object
_sharedResourcesWrapper = new SharedResourcesWrapper();
tl = new TraceLogger("", "Meade.net.focusser");
tl.LogMessage("Focuser", "Starting initialisation");
ReadProfile(); // Read device configuration from the ASCOM Profile store
IsConnected = false; // Initialise connected to false
tl.LogMessage("Focuser", "Completed initialisation");
}