Start of WeatherWarnings

This commit is contained in:
BlubbFish 2019-08-01 17:29:16 +02:00
parent b1832da477
commit 36a6b86a5b
2 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Fraunhofer.Fit.IoT.LoraMap.Model {
public class WeatherWarnings {
private readonly Settings settings;
public WeatherWarnings(Settings settings) { this.settings = settings;
this.StartBackgroundThread();
}
private void StartBackgroundThread() {
}
}
}

View File

@ -18,7 +18,8 @@ namespace Fraunhofer.Fit.IoT.LoraMap {
private readonly SortedDictionary<String, Camera> cameras = new SortedDictionary<String, Camera>(); private readonly SortedDictionary<String, Camera> cameras = new SortedDictionary<String, Camera>();
private readonly SortedDictionary<String, Crowd> crowds = new SortedDictionary<String, Crowd>(); private readonly SortedDictionary<String, Crowd> crowds = new SortedDictionary<String, Crowd>();
private JsonData marker; private JsonData marker;
private Settings settings; private readonly Settings settings;
private readonly WeatherWarnings weather;
private readonly Dictionary<String, Marker> markertable = new Dictionary<String, Marker>(); private readonly Dictionary<String, Marker> markertable = new Dictionary<String, Marker>();
private readonly AdminModel admin; private readonly AdminModel admin;
private readonly Object lockData = new Object(); private readonly Object lockData = new Object();
@ -31,6 +32,7 @@ namespace Fraunhofer.Fit.IoT.LoraMap {
this.marker = JsonMapper.ToObject(File.ReadAllText("json/names.json")); this.marker = JsonMapper.ToObject(File.ReadAllText("json/names.json"));
this.admin.NamesUpdate += this.AdminModelUpdateNames; this.admin.NamesUpdate += this.AdminModelUpdateNames;
this.settings = new Settings(); this.settings = new Settings();
this.weather = new WeatherWarnings(this.settings);
this.admin.SettingsUpdate += this.settings.AdminModelUpdateSettings; this.admin.SettingsUpdate += this.settings.AdminModelUpdateSettings;
this.StartListen(); this.StartListen();
} }
@ -117,7 +119,8 @@ namespace Fraunhofer.Fit.IoT.LoraMap {
{ "loc", this.positions }, { "loc", this.positions },
{ "panic", this.alarms }, { "panic", this.alarms },
{ "cameracount", this.cameras }, { "cameracount", this.cameras },
{ "crowdcount", this.crowds } { "crowdcount", this.crowds },
{ "weatherwarnings", this.weather }
}, cont); }, cont);
} else if (cont.Request.Url.PathAndQuery.StartsWith("/get60000")) { } else if (cont.Request.Url.PathAndQuery.StartsWith("/get60000")) {
return SendJsonResponse(new Dictionary<String, Object>() { return SendJsonResponse(new Dictionary<String, Object>() {