public Server(ADataBackend backend, Dictionary <String, String> settings) : base(backend, settings, null) { this.logger.SetPath(settings["loggingpath"]); this.admin = new AdminModel(settings); this.admin.SettingsUpdate += Settings.Instance.ReloadSettings; this.admin.GeoUpdate += Settings.Instance.ReloadGeo; this.admin.NamesUpdate += PositionModel.Instance.ReloadNames; this.StartListen(); this.WaitForShutdown(); this.Dispose(); }
private void Connect() { if (this.settings.GetSections(false).Contains("tracker")) { this.ttnt = (ADataBackend)ABackend.GetInstance(this.settings.GetSection("tracker"), ABackend.BackendType.Data); } if (this.settings.GetSections(false).Contains("sensors")) { this.ttns = (ADataBackend)ABackend.GetInstance(this.settings.GetSection("sensors"), ABackend.BackendType.Data); } this.mqtt = (ADataBackend)ABackend.GetInstance(this.settings.GetSection("to"), ABackend.BackendType.Data); }
static void Main(String[] _1) { InIReader.SetSearchPath(new List <String>() { "/etc/loramap", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\loramap" }); if (!InIReader.ConfigExist("settings")) { Helper.WriteError("settings.ini not found!"); _ = Console.ReadLine(); return; } InIReader ini = InIReader.GetInstance("settings"); Dictionary <String, String> backenddata = ini.GetSection("mqtt"); backenddata.Add("topic", "lora/#;camera/#;sfn/#"); ADataBackend b = (ADataBackend)ABackend.GetInstance(backenddata, ABackend.BackendType.Data); _ = new Server(b, ini.GetSection("webserver")); }
private void Connect(InIReader settings) { this.mqtt = (ADataBackend)ABackend.GetInstance(settings.GetSection("mqtt"), ABackend.BackendType.Data); this.scral = new ScralPusher(settings.GetSection("scral")); }