Add project files.
This commit is contained in:
13
Model/BaseGpsInfo.cs
Normal file
13
Model/BaseGpsInfo.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GpsClient2.Model {
|
||||
public abstract class BaseGpsInfo {
|
||||
public GpsCoordinateSystem CoordinateSystem { get; set; } = GpsCoordinateSystem.GeoEtrs89;
|
||||
|
||||
public int ReadFrequenty { get; set; }
|
||||
}
|
||||
}
|
||||
20
Model/ComPortInfo.cs
Normal file
20
Model/ComPortInfo.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GpsClient2.Model {
|
||||
public class ComPortInfo : BaseGpsInfo {
|
||||
public string ComPort { get; set; } = "ComPort1";
|
||||
|
||||
public ComPortInfo() {
|
||||
ReadFrequenty = 1000;
|
||||
}
|
||||
|
||||
public ComPortInfo(string comPort, int readFrequenty = 1000) {
|
||||
ComPort = comPort;
|
||||
ReadFrequenty = readFrequenty;
|
||||
}
|
||||
}
|
||||
}
|
||||
45
Model/GpsLocation.cs
Normal file
45
Model/GpsLocation.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace GpsClient2.Model {
|
||||
[DataContract]
|
||||
public class GpsLocation {
|
||||
[DataMember(Name = "tag")]
|
||||
public string Tag { get; set; }
|
||||
|
||||
[DataMember(Name = "device")]
|
||||
public string Device { get; set; }
|
||||
|
||||
[DataMember(Name = "mode")]
|
||||
public int Mode { get; set; }
|
||||
|
||||
[DataMember(Name = "time")]
|
||||
public DateTime Time { get; set; }
|
||||
|
||||
[DataMember(Name = "ept")]
|
||||
public float Ept { get; set; }
|
||||
|
||||
[DataMember(Name = "lat")]
|
||||
public double Latitude { get; set; }
|
||||
|
||||
[DataMember(Name = "lon")]
|
||||
public double Longitude { get; set; }
|
||||
|
||||
[DataMember(Name = "track")]
|
||||
public float Track { get; set; }
|
||||
|
||||
[DataMember(Name = "speed")]
|
||||
public float SpeedKnots { get; set; }
|
||||
|
||||
public double Speed => SpeedKnots * 1.852;
|
||||
|
||||
public override string ToString() {
|
||||
return $"Tag: {Tag} - Device: {Device} - Mode: {Mode} - Time: {Time} - Latitude: {Latitude} - Longitude: {Longitude} - Track: {Track} - Speed: {Speed}";
|
||||
}
|
||||
}
|
||||
}
|
||||
15
Model/WindowsLocationApiInfo.cs
Normal file
15
Model/WindowsLocationApiInfo.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GpsClient2.Model {
|
||||
public class WindowsLocationApiInfo : BaseGpsInfo {
|
||||
public int Timeout { get; set; } = 1000;
|
||||
|
||||
public WindowsLocationApiInfo() {
|
||||
ReadFrequenty = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user