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
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Events {
    public Double Longitude { get; private set; }
    public Double LastLatitude { get; private set; }
    public Double LastLongitude { get; private set; }
    public DateTime LastGPSPos { get; private set; }
    public DateTime Time { get; private set; }

    public GpsUpdateEvent(GpsInfo gps) {
@@ -21,6 +22,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Events {
      this.Time = gps.Time;
      this.LastLatitude = gps.LastLatitude;
      this.LastLongitude = gps.LastLongitude;
      this.LastGPSPos = gps.LastGPSPos;
    }

    public override String ToString() {
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Events {
      this.Spreadingfactor = this.ParseSpreadingFactor(p.spreadingfactor);
      this.Text = p.payload;
      this.Time = p.count_us;
      this.UpdateTime = DateTime.Now;
      this.UpdateTime = DateTime.UtcNow;
    }

    private Byte ParseSpreadingFactor(SF spreadingfactor) {
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Events {
      this.Snr = Snr;
      this.Packetrssi = PacketRssi;
      this.Rssi = Rssi;
      this.UpdateTime = DateTime.Now;
      this.UpdateTime = DateTime.UtcNow;
    }
    public LoraClientEvent() {

+4 −4
Original line number Diff line number Diff line
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Allgemeine Informationen über eine Assembly werden über die folgenden
@@ -10,7 +9,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Lora")]
[assembly: AssemblyCopyright("Copyright ©  2018 - 03.03.2019")]
[assembly: AssemblyCopyright("Copyright ©  2018 - 29.03.2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

@@ -32,8 +31,8 @@ using System.Runtime.InteropServices;
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.0")]
[assembly: AssemblyFileVersion("1.7.0")]
[assembly: AssemblyVersion("1.8.0")]
[assembly: AssemblyFileVersion("1.8.0")]

/*
 * 1.1.0 Now awaiing Battery as Double and fix the sending twise issue
@@ -46,4 +45,5 @@ using System.Runtime.InteropServices;
 * 1.6.0 Fixing binary data transmission
 * 1.6.1 Update to local librarys
 * 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
 */
+5 −2
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers {
    public Double LastLatitude { get; private set; }
    public Double Longitude { get; private set; }
    public Double LastLongitude { get; private set; }
	  public DateTime LastGPSPos { get; private set; }
    public DateTime Time { get; private set; }
    public Double Hdop { get; private set; }
    public Boolean Fix { get; private set; }
@@ -31,7 +32,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers {
      if (Double.TryParse(infos[1], out Double 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)) {
        this.Time = dv;
      }
@@ -45,6 +46,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers {
      if(this.Fix) {
        this.LastLongitude = this.Longitude;
        this.LastLatitude = this.Latitude;
        this.LastGPSPos = DateTime.UtcNow;
      }
    }

@@ -52,7 +54,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers {
      this.Latitude = lat;
      this.Longitude = lon;
      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)) {
        this.Time = dv;
      }
@@ -61,6 +63,7 @@ namespace Fraunhofer.Fit.Iot.Lora.Trackers {
      if (this.Fix) {
        this.LastLongitude = this.Longitude;
        this.LastLatitude = this.Latitude;
        this.LastGPSPos = DateTime.UtcNow;
      }
    }
  }