added course to GpsDataEventArgs
This commit is contained in:
45
EventArguments/GpsDataEventArgs.cs
Normal file
45
EventArguments/GpsDataEventArgs.cs
Normal 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}";
|
||||
}
|
||||
}
|
||||
}
|
||||
15
EventArguments/GpsStatusEventArgs.cs
Normal file
15
EventArguments/GpsStatusEventArgs.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user