/// <summary> /// See interface docs. /// </summary> public void Start() { if (!_Started) { _Started = true; _Clock = Factory.Singleton.Resolve <IClock>(); Downloader = Factory.Singleton.Resolve <IAirPressureDownloader>(); Lookup = Factory.Singleton.Resolve <IAirPressureLookup>(); _SharedConfiguration = Factory.Singleton.ResolveSingleton <ISharedConfiguration>(); Enabled = _SharedConfiguration.Get().BaseStationSettings.DownloadGlobalAirPressureReadings; _SharedConfiguration.ConfigurationChanged += SharedConfiguration_ConfigurationChanged; if (_BackgroundWorker == null) { _BackgroundWorker = Factory.Singleton.Resolve <IBackgroundWorker>(); _BackgroundWorker.DoWork += BackgroundWorker_DoWork; } _HeartbeatService = Factory.Singleton.ResolveSingleton <IHeartbeatService>(); _HeartbeatService.SlowTick += HeartbeatService_SlowTick; } }
public void TestInitialise() { _Lookup = Factory.Singleton.ResolveNewInstance <IAirPressureLookup>(); _AirPressures = new List <AirPressure>(); _Now = DateTime.UtcNow; }