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

@@ -1,5 +1,6 @@
using System; using GpsClient2.EventArguments;
using GpsClient2.Model; using GpsClient2.Model;
using System;
namespace GpsClient2 { namespace GpsClient2 {
public abstract class BaseGpsClient { public abstract class BaseGpsClient {

View File

@@ -1,14 +1,10 @@
using GpsClient2.Model; using GpsClient2.EventArguments;
using GpsClient2.NmeaMessages;
using GpsClient2.Exceptions; using GpsClient2.Exceptions;
using GpsClient2.Model;
using GpsClient2.NmeaMessages;
using System; using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO.Ports; using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading; using System.Threading;
using System.Threading.Tasks;
namespace GpsClient2 { namespace GpsClient2 {
public class ComPortGpsClient : BaseGpsClient { public class ComPortGpsClient : BaseGpsClient {

View File

@@ -1,9 +1,4 @@
using System; using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2 { namespace GpsClient2 {
internal class CoordinateConverterUtilities { internal class CoordinateConverterUtilities {

View File

@@ -1,10 +1,4 @@
using System; namespace GpsClient2 {
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2 {
public enum CoordinateType { public enum CoordinateType {
Latitude, Latitude,
Longitude Longitude

View File

@@ -1,13 +1,9 @@
using System; using GpsClient2.Model;
using GpsClient2.Model;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Device.Location;
using GpsClient2.NmeaMessages; using GpsClient2.NmeaMessages;
using System;
using System.Device.Location;
namespace GpsClient2 { namespace GpsClient2.EventArguments {
public class GpsDataEventArgs : EventArgs { public class GpsDataEventArgs : EventArgs {
public GpsCoordinateSystem CoordinateSystem { get; set; } = GpsCoordinateSystem.GeoEtrs89; public GpsCoordinateSystem CoordinateSystem { get; set; } = GpsCoordinateSystem.GeoEtrs89;
@@ -15,6 +11,7 @@ namespace GpsClient2 {
public double Longitude { get; set; } public double Longitude { get; set; }
public double Speed { get; set; } public double Speed { get; set; }
public double Course { get; set; }
public GpsDataEventArgs(GpsLocation gpsLocation) { public GpsDataEventArgs(GpsLocation gpsLocation) {
Latitude = gpsLocation.Latitude; Latitude = gpsLocation.Latitude;
@@ -26,6 +23,7 @@ namespace GpsClient2 {
Latitude = gpsLocation.Latitude; Latitude = gpsLocation.Latitude;
Longitude = gpsLocation.Longitude; Longitude = gpsLocation.Longitude;
Speed = gpsLocation.Speed; Speed = gpsLocation.Speed;
Course = gpsLocation.Course;
} }
public GpsDataEventArgs(GeoCoordinate gpsLocation) { public GpsDataEventArgs(GeoCoordinate gpsLocation) {

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

View File

@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2.Exceptions { namespace GpsClient2.Exceptions {
public class UnknownTypeException : Exception { public class UnknownTypeException : Exception {

View File

@@ -46,6 +46,7 @@
<Compile Include="BaseGpsClient.cs" /> <Compile Include="BaseGpsClient.cs" />
<Compile Include="CoordinateConverterUtilities.cs" /> <Compile Include="CoordinateConverterUtilities.cs" />
<Compile Include="Enums.cs" /> <Compile Include="Enums.cs" />
<Compile Include="EventArguments\GpsStatusEventArgs.cs" />
<Compile Include="Exceptions\UnknownTypeException.cs" /> <Compile Include="Exceptions\UnknownTypeException.cs" />
<Compile Include="Model\BaseGpsInfo.cs" /> <Compile Include="Model\BaseGpsInfo.cs" />
<Compile Include="Model\ComPortInfo.cs" /> <Compile Include="Model\ComPortInfo.cs" />
@@ -58,7 +59,7 @@
<Compile Include="NmeaParser.cs" /> <Compile Include="NmeaParser.cs" />
<Compile Include="StringExtensions.cs" /> <Compile Include="StringExtensions.cs" />
<Compile Include="ComPortGpsClient.cs" /> <Compile Include="ComPortGpsClient.cs" />
<Compile Include="GpsDataEventArgs.cs" /> <Compile Include="EventArguments\GpsDataEventArgs.cs" />
<Compile Include="Model\GpsLocation.cs" /> <Compile Include="Model\GpsLocation.cs" />
<Compile Include="NmeaMessages\GprmcMessage.cs" /> <Compile Include="NmeaMessages\GprmcMessage.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

View File

@@ -1,10 +1,4 @@
using System; namespace GpsClient2.Model {
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2.Model {
public abstract class BaseGpsInfo { public abstract class BaseGpsInfo {
public GpsCoordinateSystem CoordinateSystem { get; set; } = GpsCoordinateSystem.GeoEtrs89; public GpsCoordinateSystem CoordinateSystem { get; set; } = GpsCoordinateSystem.GeoEtrs89;

View File

@@ -1,10 +1,4 @@
using System; namespace GpsClient2.Model {
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2.Model {
public class ComPortInfo : BaseGpsInfo { public class ComPortInfo : BaseGpsInfo {
public string ComPort { get; set; } = "ComPort1"; public string ComPort { get; set; } = "ComPort1";

View File

@@ -1,10 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace GpsClient2.Model { namespace GpsClient2.Model {
[DataContract] [DataContract]

View File

@@ -1,10 +1,4 @@
using System; namespace GpsClient2.Model {
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2.Model {
public class WindowsLocationApiInfo : BaseGpsInfo { public class WindowsLocationApiInfo : BaseGpsInfo {
public int Timeout { get; set; } = 1000; public int Timeout { get; set; } = 1000;

View File

@@ -2,9 +2,6 @@
using GpsClient2.NmeaMessages; using GpsClient2.NmeaMessages;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2 { namespace GpsClient2 {
public static class NmeaConstants { public static class NmeaConstants {

View File

@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2.NmeaMessages { namespace GpsClient2.NmeaMessages {
public class GpggaMessage : NmeaMessage { public class GpggaMessage : NmeaMessage {

View File

@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2.NmeaMessages { namespace GpsClient2.NmeaMessages {
public class GpgsaMessage : NmeaMessage { public class GpgsaMessage : NmeaMessage {

View File

@@ -1,9 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2.NmeaMessages { namespace GpsClient2.NmeaMessages {
public class GprmcMessage : NmeaMessage { public class GprmcMessage : NmeaMessage {

View File

@@ -1,8 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2.NmeaMessages { namespace GpsClient2.NmeaMessages {
public class GpvtgMessage : NmeaMessage { public class GpvtgMessage : NmeaMessage {

View File

@@ -1,10 +1,4 @@
using System; namespace GpsClient2.NmeaMessages {
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2.NmeaMessages {
public abstract class NmeaMessage { public abstract class NmeaMessage {
public abstract void Parse(string[] messageParts); public abstract void Parse(string[] messageParts);
} }

View File

@@ -1,9 +1,5 @@
using GpsClient2.NmeaMessages; using GpsClient2.NmeaMessages;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2 { namespace GpsClient2 {
public class NmeaParser { public class NmeaParser {

View File

@@ -1,5 +1,4 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following

View File

@@ -1,10 +1,6 @@
using System; using System;
using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace GpsClient2 { namespace GpsClient2 {
public static class StringExtensions { public static class StringExtensions {

View File

@@ -1,10 +1,7 @@
using GpsClient2.Model; using GpsClient2.EventArguments;
using GpsClient2.Model;
using System; using System;
using System.Collections.Generic;
using System.Device.Location; using System.Device.Location;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GpsClient2 { namespace GpsClient2 {
public class WindowsLocationApiGpsClient : BaseGpsClient { public class WindowsLocationApiGpsClient : BaseGpsClient {