Add project files.

This commit is contained in:
2023-07-11 10:54:27 -05:00
parent bffa409ea4
commit 8b111f95d0
24 changed files with 1130 additions and 0 deletions

13
Model/BaseGpsInfo.cs Normal file
View 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
View 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
View 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}";
}
}
}

View 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;
}
}
}