added course to GpsDataEventArgs

This commit is contained in:
2023-07-11 11:27:53 -05:00
parent 8b111f95d0
commit 13a3044bbf
22 changed files with 36 additions and 100 deletions

View File

@@ -0,0 +1,45 @@
using GpsClient2.Model;
using GpsClient2.NmeaMessages;
using System;
using System.Device.Location;
namespace GpsClient2.EventArguments {
public class GpsDataEventArgs : EventArgs {
public GpsCoordinateSystem CoordinateSystem { get; set; } = GpsCoordinateSystem.GeoEtrs89;
public double Latitude { get; set; }
public double Longitude { get; set; }
public double Speed { get; set; }
public double Course { get; set; }
public GpsDataEventArgs(GpsLocation gpsLocation) {
Latitude = gpsLocation.Latitude;
Longitude = gpsLocation.Longitude;
Speed = gpsLocation.Speed;
}
public GpsDataEventArgs(GprmcMessage gpsLocation) {
Latitude = gpsLocation.Latitude;
Longitude = gpsLocation.Longitude;
Speed = gpsLocation.Speed;
Course = gpsLocation.Course;
}
public GpsDataEventArgs(GeoCoordinate gpsLocation) {
Latitude = gpsLocation.Latitude;
Longitude = gpsLocation.Longitude;
Speed = gpsLocation.Speed;
}
public GpsDataEventArgs(double latitude, double longitude, double speed = 0.0d) {
Latitude = latitude;
Longitude = longitude;
Speed = speed;
}
public override string ToString() {
return $"Latitude: {Latitude} - Longitude: {Longitude} - Speed: {Speed}";
}
}
}

View File

@@ -0,0 +1,15 @@
using System;
namespace GpsClient2.EventArguments {
public class GpsStatusEventArgs : EventArgs {
public GpsStatus Status { get; set; }
public GpsStatusEventArgs() {
}
public GpsStatusEventArgs(GpsStatus status) {
Status = status;
}
}
}