Skip to content
Snippets Groups Projects
Commit 827d369c authored by philip.schell's avatar philip.schell
Browse files

[1.8.0] Add field that indicates when the last gps position was recieved, change all times to UTC

parent d1aa806c
No related branches found
Tags v1.8.0
No related merge requests found
...@@ -10,6 +10,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Events { ...@@ -10,6 +10,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Events {
public Double Longitude { get; private set; } public Double Longitude { get; private set; }
public Double LastLatitude { get; private set; } public Double LastLatitude { get; private set; }
public Double LastLongitude { get; private set; } public Double LastLongitude { get; private set; }
public DateTime LastGPSPos { get; private set; }
public DateTime Time { get; private set; } public DateTime Time { get; private set; }
public GpsUpdateEvent(GpsInfo gps) { public GpsUpdateEvent(GpsInfo gps) {
...@@ -21,6 +22,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Events { ...@@ -21,6 +22,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Events {
this.Time = gps.Time; this.Time = gps.Time;
this.LastLatitude = gps.LastLatitude; this.LastLatitude = gps.LastLatitude;
this.LastLongitude = gps.LastLongitude; this.LastLongitude = gps.LastLongitude;
this.LastGPSPos = gps.LastGPSPos;
} }
public override String ToString() { public override String ToString() {
......
...@@ -69,7 +69,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Events { ...@@ -69,7 +69,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Events {
this.Spreadingfactor = this.ParseSpreadingFactor(p.spreadingfactor); this.Spreadingfactor = this.ParseSpreadingFactor(p.spreadingfactor);
this.Text = p.payload; this.Text = p.payload;
this.Time = p.count_us; this.Time = p.count_us;
this.UpdateTime = DateTime.Now; this.UpdateTime = DateTime.UtcNow;
} }
private Byte ParseSpreadingFactor(SF spreadingfactor) { private Byte ParseSpreadingFactor(SF spreadingfactor) {
......
...@@ -15,7 +15,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Events { ...@@ -15,7 +15,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Events {
this.Snr = Snr; this.Snr = Snr;
this.Packetrssi = PacketRssi; this.Packetrssi = PacketRssi;
this.Rssi = Rssi; this.Rssi = Rssi;
this.UpdateTime = DateTime.Now; this.UpdateTime = DateTime.UtcNow;
} }
public LoraClientEvent() { public LoraClientEvent() {
......
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden // Allgemeine Informationen über eine Assembly werden über die folgenden
...@@ -10,7 +9,7 @@ using System.Runtime.InteropServices; ...@@ -10,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")] [assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Lora")] [assembly: AssemblyProduct("Lora")]
[assembly: AssemblyCopyright("Copyright © 2018 - 03.03.2019")] [assembly: AssemblyCopyright("Copyright © 2018 - 29.03.2019")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
...@@ -32,8 +31,8 @@ using System.Runtime.InteropServices; ...@@ -32,8 +31,8 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben: // indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.0")] [assembly: AssemblyVersion("1.8.0")]
[assembly: AssemblyFileVersion("1.7.0")] [assembly: AssemblyFileVersion("1.8.0")]
/* /*
* 1.1.0 Now awaiing Battery as Double and fix the sending twise issue * 1.1.0 Now awaiing Battery as Double and fix the sending twise issue
...@@ -46,4 +45,5 @@ using System.Runtime.InteropServices; ...@@ -46,4 +45,5 @@ using System.Runtime.InteropServices;
* 1.6.0 Fixing binary data transmission * 1.6.0 Fixing binary data transmission
* 1.6.1 Update to local librarys * 1.6.1 Update to local librarys
* 1.7.0 Add Parsing for new Statusformat and Panic Packet * 1.7.0 Add Parsing for new Statusformat and Panic Packet
* 1.8.0 Add field that indicates when the last gps position was recieved, change all times to UTC
*/ */
...@@ -6,6 +6,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers { ...@@ -6,6 +6,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers {
public Double LastLatitude { get; private set; } public Double LastLatitude { get; private set; }
public Double Longitude { get; private set; } public Double Longitude { get; private set; }
public Double LastLongitude { get; private set; } public Double LastLongitude { get; private set; }
public DateTime LastGPSPos { get; private set; }
public DateTime Time { get; private set; } public DateTime Time { get; private set; }
public Double Hdop { get; private set; } public Double Hdop { get; private set; }
public Boolean Fix { get; private set; } public Boolean Fix { get; private set; }
...@@ -31,7 +32,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers { ...@@ -31,7 +32,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers {
if (Double.TryParse(infos[1], out Double laengengrad)) { if (Double.TryParse(infos[1], out Double laengengrad)) {
this.Longitude = laengengrad; this.Longitude = laengengrad;
} }
String d = DateTime.Now.Day + "." + DateTime.Now.Month + "." + DateTime.Now.Year + " " + infos[2][0] + infos[2][1] + ":" + infos[2][2] + infos[2][3] + ":" + infos[2][4] + infos[2][5]; String d = DateTime.UtcNow.Day + "." + DateTime.UtcNow.Month + "." + DateTime.UtcNow.Year + " " + infos[2][0] + infos[2][1] + ":" + infos[2][2] + infos[2][3] + ":" + infos[2][4] + infos[2][5];
if (DateTime.TryParse(d, out DateTime dv)) { if (DateTime.TryParse(d, out DateTime dv)) {
this.Time = dv; this.Time = dv;
} }
...@@ -45,6 +46,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers { ...@@ -45,6 +46,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers {
if(this.Fix) { if(this.Fix) {
this.LastLongitude = this.Longitude; this.LastLongitude = this.Longitude;
this.LastLatitude = this.Latitude; this.LastLatitude = this.Latitude;
this.LastGPSPos = DateTime.UtcNow;
} }
} }
...@@ -52,7 +54,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers { ...@@ -52,7 +54,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers {
this.Latitude = lat; this.Latitude = lat;
this.Longitude = lon; this.Longitude = lon;
this.Height = height; this.Height = height;
String d = day.ToString().PadLeft(2,'0')+"."+month.ToString().PadLeft(2, '0') + "."+year.ToString().PadLeft(2, '4') + " " + hour.ToString().PadLeft(2, '0') + ":" + minute.ToString().PadLeft(2, '0') + ":" + second.ToString().PadLeft(2, '0'); String d = day.ToString().PadLeft(2,'0')+"."+month.ToString().PadLeft(2, '0') + "."+year.ToString().PadLeft(4, '0') + " " + hour.ToString().PadLeft(2, '0') + ":" + minute.ToString().PadLeft(2, '0') + ":" + second.ToString().PadLeft(2, '0');
if (DateTime.TryParse(d, out DateTime dv)) { if (DateTime.TryParse(d, out DateTime dv)) {
this.Time = dv; this.Time = dv;
} }
...@@ -61,6 +63,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers { ...@@ -61,6 +63,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers {
if (this.Fix) { if (this.Fix) {
this.LastLongitude = this.Longitude; this.LastLongitude = this.Longitude;
this.LastLatitude = this.Latitude; this.LastLatitude = this.Latitude;
this.LastGPSPos = DateTime.UtcNow;
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment