From d5c84b6aadfa39e9ec999d43be547141d0668468 Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Thu, 6 Sep 2018 20:24:02 +0000 Subject: [PATCH] Mqttmap to new Version of Lora-Bot --- mqtt-map/Googlelocation.cs | 16 ++++++++-------- mqtt-map/Properties/AssemblyInfo.cs | 4 ++-- mqtt-map/resources/google.html | 6 ++++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/mqtt-map/Googlelocation.cs b/mqtt-map/Googlelocation.cs index bb794be..926d372 100644 --- a/mqtt-map/Googlelocation.cs +++ b/mqtt-map/Googlelocation.cs @@ -14,7 +14,7 @@ using LitJson; namespace Fraunhofer.Fit.IoT.Bots.LoraBot.Moduls_broken { class Botclient { - public Botclient(Int32 paketrssi, Int32 rssi, Double snr, String updatetime, Double lat, Double lon, Double hdop, Int32 sat, Boolean fix) { + public Botclient(Int32 paketrssi, Int32 rssi, Double snr, String updatetime, Double lat, Double lon, Double hdop, Int32 battery, Boolean fix) { this.PacketRssi = paketrssi; this.Rssi = rssi; this.Snr = snr; @@ -22,7 +22,7 @@ namespace Fraunhofer.Fit.IoT.Bots.LoraBot.Moduls_broken { this.Latitude = lat; this.Longitude = lon; this.Hdop = hdop; - this.Satelites = sat; + this.Battery = battery; this.Fix = fix; } @@ -33,7 +33,7 @@ namespace Fraunhofer.Fit.IoT.Bots.LoraBot.Moduls_broken { public Double Latitude { get; private set; } public Double Longitude { get; private set; } public Double Hdop { get; private set; } - public Int32 Satelites { get; private set; } + public Int32 Battery { get; private set; } public Boolean Fix { get; private set; } public virtual Dictionary ToDictionary() { @@ -80,16 +80,16 @@ namespace Fraunhofer.Fit.IoT.Bots.LoraBot.Moduls_broken { if (d.ContainsKey("PacketRssi") && d["PacketRssi"].IsInt && d.ContainsKey("Rssi") && d["Rssi"].IsInt && d.ContainsKey("Snr") && d["Snr"].IsDouble - && d.ContainsKey("Upatedtime") && d["Upatedtime"].IsString + && d.ContainsKey("Receivedtime") && d["Receivedtime"].IsString + && d.ContainsKey("BatteryLevel") && d["BatteryLevel"].IsInt && d.ContainsKey("Gps") && d["Gps"].IsObject - && d["Gps"].ContainsKey("Breitengrad") && d["Gps"]["Breitengrad"].IsDouble - && d["Gps"].ContainsKey("Laengengrad") && d["Gps"]["Laengengrad"].IsDouble + && d["Gps"].ContainsKey("Latitude") && d["Gps"]["Latitude"].IsDouble + && d["Gps"].ContainsKey("Longitude") && d["Gps"]["Longitude"].IsDouble && d["Gps"].ContainsKey("Hdop") && d["Gps"]["Hdop"].IsDouble - && d["Gps"].ContainsKey("Satelites") && d["Gps"]["Satelites"].IsInt && d["Gps"].ContainsKey("Fix") && d["Gps"]["Fix"].IsBoolean && d.ContainsKey("Name") && d["Name"].IsString) { String name = (String)d["Name"]; - Botclient b = new Botclient((Int32)d["PacketRssi"], (Int32)d["Rssi"], (Double)d["Snr"], (String)d["Upatedtime"], (Double)d["Gps"]["Breitengrad"], (Double)d["Gps"]["Laengengrad"], (Double)d["Gps"]["Hdop"], (Int32)d["Gps"]["Satelites"], (Boolean)d["Gps"]["Fix"]); + Botclient b = new Botclient((Int32)d["PacketRssi"], (Int32)d["Rssi"], (Double)d["Snr"], (String)d["Receivedtime"], (Double)d["Gps"]["Latitude"], (Double)d["Gps"]["Longitude"], (Double)d["Gps"]["Hdop"], (Int32)d["BatteryLevel"], (Boolean)d["Gps"]["Fix"]); if (b.Fix) { if (this.locations.ContainsKey(name)) { this.locations[name].Add(b); diff --git a/mqtt-map/Properties/AssemblyInfo.cs b/mqtt-map/Properties/AssemblyInfo.cs index 4eb317c..6916952 100644 --- a/mqtt-map/Properties/AssemblyInfo.cs +++ b/mqtt-map/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.1.0.0")] +[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/mqtt-map/resources/google.html b/mqtt-map/resources/google.html index e94c323..18c8907 100644 --- a/mqtt-map/resources/google.html +++ b/mqtt-map/resources/google.html @@ -70,12 +70,13 @@ }); var infowindow = new google.maps.InfoWindow({ content: "
" + + "Name: " + names + "
" + "PacketRssi: " + list[pos]["PacketRssi"] + "
" + "Rssi: " + list[pos]["Rssi"] + "
" + "Snr: " + list[pos]["Snr"] + "
" + "Upatedtime: " + list[pos]["Upatedtime"] + "
" + "Hdop: " + list[pos]["Hdop"] + "
" + - "Satelites: " + list[pos]["Satelites"] + "
" + + "Battery: " + list[pos]["Battery"] + "
" + "Fix: " + list[pos]["Fix"] + "
" }); @@ -102,8 +103,9 @@ if (devices.hasOwnProperty(item)) { qstring += item + ":" + devices[item]; } + qstring += ";"; } - xhttp.open("GET", "http://{%REQUEST-PAGE%}:8080/loc?i="+qstring, true); + xhttp.open("GET", "http://{%REQUEST-PAGE%}:8080/loc?i="+qstring.substr(0,qstring.length-1), true); xhttp.send(); } setInterval(get_elm, 5000);