Breaking change: Rewrite nmea creation to parse data into constructor instead to ensure types are always properly initialized.

Code clean-up and simplify syntax.
Update license to Apache.
Simplify packaging and include symbol-linked PDBs
This commit is contained in:
Morten Nielsen 2019-02-19 20:51:51 -08:00
parent 9b8a56792d
commit 121255d327
42 changed files with 827 additions and 683 deletions

View file

@ -31,5 +31,11 @@ namespace NmeaParser.Nmea.Galileo
[NmeaMessageType("GAGSV")]
public sealed class Gagsv : Gsv
{
}
/// <summary>
/// Initializes a new instance of the <see cref="Gagsv"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gagsv(string type, string[] message) : base(type, message) { }
}
}

View file

@ -27,13 +27,14 @@ namespace NmeaParser.Nmea
/// Global Positioning System Fix Data
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gpgga")]
public class Gga : NmeaMessage
public abstract class Gga : NmeaMessage
{
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
/// <summary>
/// Initializes a new instance of the <see cref="Gga"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
protected Gga(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 14)
throw new ArgumentException("Invalid GPGGA", "message");
@ -61,62 +62,62 @@ namespace NmeaParser.Nmea
/// <summary>
/// Time of day fix was taken
/// </summary>
public TimeSpan FixTime { get; private set; }
public TimeSpan FixTime { get; }
/// <summary>
/// Latitude
/// </summary>
public double Latitude { get; private set; }
public double Latitude { get; }
/// <summary>
/// Longitude
/// </summary>
public double Longitude { get; private set; }
public double Longitude { get; }
/// <summary>
/// Fix Quality
/// </summary>
public Gps.Gpgga.FixQuality Quality { get; private set; }
public Gps.Gpgga.FixQuality Quality { get; }
/// <summary>
/// Number of satellites being tracked
/// </summary>
public int NumberOfSatellites { get; private set; }
public int NumberOfSatellites { get; }
/// <summary>
/// Horizontal Dilution of Precision
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Hdop")]
public double Hdop { get; private set; }
public double Hdop { get; }
/// <summary>
/// Altitude
/// </summary>
public double Altitude { get; private set; }
public double Altitude { get; }
/// <summary>
/// Altitude units ('M' for Meters)
/// </summary>
public string AltitudeUnits { get; private set; }
public string AltitudeUnits { get; }
/// <summary>
/// Height of geoid (mean sea level) above WGS84
/// </summary>
public double HeightOfGeoid { get; private set; }
public double HeightOfGeoid { get; }
/// <summary>
/// Altitude units ('M' for Meters)
/// </summary>
public string HeightOfGeoidUnits { get; private set; }
public string HeightOfGeoidUnits { get; }
/// <summary>
/// Time since last DGPS update
/// </summary>
public TimeSpan TimeSinceLastDgpsUpdate { get; private set; }
public TimeSpan TimeSinceLastDgpsUpdate { get; }
/// <summary>
/// DGPS Station ID Number
/// </summary>
public int DgpsStationId { get; private set; }
public int DgpsStationId { get; }
}
}

View file

@ -29,13 +29,14 @@ namespace NmeaParser.Nmea
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gll")]
public abstract class Gll : NmeaMessage
{
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
{
if (message == null || message.Length < 4)
/// <summary>
/// Initializes a new instance of the <see cref="Gll"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
protected Gll(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 4)
throw new ArgumentException("Invalid GPGLL", "message");
Latitude = NmeaMessage.StringToLatitude(message[0], message[1]);
Longitude = NmeaMessage.StringToLongitude(message[2], message[3]);
@ -49,17 +50,17 @@ namespace NmeaParser.Nmea
/// <summary>
/// Latitude
/// </summary>
public double Latitude { get; private set; }
public double Latitude { get; }
/// <summary>
/// Longitude
/// </summary>
public double Longitude { get; private set; }
public double Longitude { get; }
/// <summary>
/// Time since last DGPS update
/// </summary>
public TimeSpan FixTime { get; private set; }
public TimeSpan FixTime { get; }
/// <summary>
/// Gets a value indicating whether data is active.
@ -67,7 +68,7 @@ namespace NmeaParser.Nmea
/// <value>
/// <c>true</c> if data is active; otherwise, <c>false</c>.
/// </value>
public bool DataActive { get; private set; }
public bool DataActive { get; }
}
}

View file

@ -11,5 +11,11 @@ namespace NmeaParser.Nmea.Glonass
[NmeaMessageType("GLGNS")]
public class Glgns : Gns
{
/// <summary>
/// Initializes a new instance of the <see cref="Glgns"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Glgns(string type, string[] message) : base(type, message) { }
}
}

View file

@ -23,13 +23,19 @@ using System.Threading.Tasks;
namespace NmeaParser.Nmea.Glonass
{
/// <summary>
/// GLONASS Satellites in view
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Glgsv")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
[NmeaMessageType("GLGSV")]
public sealed class Glgsv : Gsv
{
}
}
/// <summary>
/// GLONASS Satellites in view
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Glgsv")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
[NmeaMessageType("GLGSV")]
public sealed class Glgsv : Gsv
{
/// <summary>
/// Initializes a new instance of the <see cref="Glgsv"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Glgsv(string type, string[] message) : base(type, message) { }
}
}

View file

@ -4,5 +4,11 @@
[NmeaMessageType("GLZDA")]
public class Glzda : Zda
{
/// <summary>
/// Initializes a new instance of the <see cref="Glzda"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Glzda(string type, string[] message) : base(type, message) { }
}
}
}

View file

@ -120,10 +120,11 @@ namespace NmeaParser.Nmea
}
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
/// Initializes a new instance of the <see cref="Gns"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
protected Gns(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 12)
throw new ArgumentException("Invalid GNS", "message");
@ -168,74 +169,74 @@ namespace NmeaParser.Nmea
/// <summary>
/// Time of day fix was taken
/// </summary>
public TimeSpan FixTime { get; private set; }
public TimeSpan FixTime { get; }
/// <summary>
/// Latitude
/// </summary>
public double Latitude { get; private set; }
public double Latitude { get; }
/// <summary>
/// Longitude
/// </summary>
public double Longitude { get; private set; }
public double Longitude { get; }
/// <summary>
/// Mode indicator for GPS
/// </summary>
/// <seealso cref="GlonassModeIndicator"/>
/// <see cref="FutureModeIndicator"/>
public Mode GpsModeIndicator { get; private set; }
public Mode GpsModeIndicator { get; }
/// <summary>
/// Mode indicator for GLONASS
/// </summary>
/// <seealso cref="GpsModeIndicator"/>
/// <see cref="FutureModeIndicator"/>
public Mode GlonassModeIndicator { get; private set; }
public Mode GlonassModeIndicator { get; }
/// <summary>
/// Mode indicator for future constallations
/// </summary>
/// <seealso cref="GlonassModeIndicator"/>
/// <seealso cref="GpsModeIndicator"/>
public Mode[] FutureModeIndicator { get; private set; }
public Mode[] FutureModeIndicator { get; }
/// <summary>
/// Number of satellites (SVs) in use
/// </summary>
public int NumberOfSatellites { get; private set; }
public int NumberOfSatellites { get; }
/// <summary>
/// Horizontal Dilution of Precision (HDOP), calculated using all the satellites (GPS, GLONASS, and any future satellites) used in computing the solution reported in each GNS sentence.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Hdop")]
public double Hdop { get; private set; }
public double Hdop { get; }
/// <summary>
/// Orthometric height in meters (MSL reference)
/// </summary>
public double OrhometricHeight { get; private set; }
public double OrhometricHeight { get; }
/// <summary>
/// Geoidal separation in meters - the difference between the earth ellipsoid surface and mean-sea-level (geoid) surface defined by the reference datum used in the position solution<br/>
/// '-' = mean-sea-level surface below ellipsoid.
/// </summary>
public double GeoidalSeparation { get; private set; }
public double GeoidalSeparation { get; }
/// <summary>
/// Age of differential data - <see cref="TimeSpan.MaxValue"/> if talker ID is GN, additional GNS messages follow with GP and/or GL Age of differential data
/// </summary>
public TimeSpan TimeSinceLastDgpsUpdate { get; private set; }
public TimeSpan TimeSinceLastDgpsUpdate { get; }
/// <summary>
/// eference station ID1, range 0000-4095 - Null if talker ID is GN, additional GNS messages follow with GP and/or GL Reference station ID
/// </summary>
public string DgpsStationId { get; private set; }
public string DgpsStationId { get; }
/// <summary>
/// Navigational status
/// </summary>
public NavigationalStatus Status { get; private set; }
public NavigationalStatus Status { get; }
}
}

View file

@ -23,12 +23,18 @@ using System.Threading.Tasks;
namespace NmeaParser.Nmea.Gnss
{
/// <summary>
/// Global Positioning System Fix Data
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gngga")]
[NmeaMessageType("GNGGA")]
public class Gngga : Gga
{
}
}
/// <summary>
/// Global Positioning System Fix Data
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gngga")]
[NmeaMessageType("GNGGA")]
public class Gngga : Gga
{
/// <summary>
/// Initializes a new instance of the <see cref="Gngga"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gngga(string type, string[] message) : base(type, message) { }
}
}

View file

@ -23,12 +23,18 @@ using System.Threading.Tasks;
namespace NmeaParser.Nmea.Gnss
{
/// <summary>
/// Geographic position, latitude / longitude
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gngll")]
[NmeaMessageType("GNGLL")]
public class Gngll : Gll
{
}
}
/// <summary>
/// Geographic position, latitude / longitude
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gngll")]
[NmeaMessageType("GNGLL")]
public class Gngll : Gll
{
/// <summary>
/// Initializes a new instance of the <see cref="Gngll"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gngll(string type, string[] message) : base(type, message) { }
}
}

View file

@ -11,5 +11,11 @@ namespace NmeaParser.Nmea.Gps
[NmeaMessageType("GNGNS")]
public class Gngns : Gns
{
/// <summary>
/// Initializes a new instance of the <see cref="Gngns"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gngns(string type, string[] message) : base(type, message) { }
}
}
}

View file

@ -23,12 +23,18 @@ using System.Threading.Tasks;
namespace NmeaParser.Nmea.Gnss
{
/// <summary>
/// Global Positioning System Fix Data
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gngsa")]
[NmeaMessageType("GNGSA")]
public class Gngsa : Gsa
{
}
}
/// <summary>
/// Global Positioning System Fix Data
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gngsa")]
[NmeaMessageType("GNGSA")]
public class Gngsa : Gsa
{
/// <summary>
/// Initializes a new instance of the <see cref="Gngsa"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gngsa(string type, string[] message) : base(type, message) { }
}
}

View file

@ -9,5 +9,11 @@ namespace NmeaParser.Nmea.Gnss
[NmeaMessageType("GNGST")]
public class Gngst : Gst
{
/// <summary>
/// Initializes a new instance of the <see cref="Gngst"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gngst(string type, string[] message) : base(type, message) { }
}
}
}

View file

@ -23,12 +23,18 @@ using System.Threading.Tasks;
namespace NmeaParser.Nmea.Gnss
{
/// <summary>
/// Recommended Minimum
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gnrmc")]
[NmeaMessageType("GNRMC")]
public class Gnrmc : Rmc
{
}
}
/// <summary>
/// Recommended Minimum
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gnrmc")]
[NmeaMessageType("GNRMC")]
public class Gnrmc : Rmc
{
/// <summary>
/// Initializes a new instance of the <see cref="Gnrmc"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gnrmc(string type, string[] message) : base(type, message) { }
}
}

View file

@ -4,5 +4,11 @@
[NmeaMessageType("GNZDA")]
public class Gnzda : Zda
{
/// <summary>
/// Initializes a new instance of the <see cref="Gnzda"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gnzda(string type, string[] message) : base(type, message) { }
}
}

View file

@ -23,52 +23,53 @@ using System.Threading.Tasks;
namespace NmeaParser.Nmea.Gps
{
/// <summary>
/// Bearing Origin to Destination
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gpbod")]
[NmeaMessageType("GPBOD")]
public class Gpbod : NmeaMessage
{
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
{
if (message == null || message.Length < 3)
throw new ArgumentException("Invalid GPBOD", "message");
if (message[0].Length > 0)
TrueBearing = double.Parse(message[0], CultureInfo.InvariantCulture);
else
TrueBearing = double.NaN;
if (message[2].Length > 0)
MagneticBearing = double.Parse(message[2], CultureInfo.InvariantCulture);
else
MagneticBearing = double.NaN;
if (message.Length > 4 && !string.IsNullOrEmpty(message[4]))
DestinationId = message[4];
if (message.Length > 5 && !string.IsNullOrEmpty(message[5]))
OriginId = message[5];
}
/// <summary>
/// True Bearing from start to destination
/// </summary>
public double TrueBearing { get; private set; }
/// <summary>
/// Bearing Origin to Destination
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gpbod")]
[NmeaMessageType("GPBOD")]
public class Gpbod : NmeaMessage
{
/// <summary>
/// Initializes a new instance of the <see cref="Gpbod"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gpbod(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 3)
throw new ArgumentException("Invalid GPBOD", "message");
if (message[0].Length > 0)
TrueBearing = double.Parse(message[0], CultureInfo.InvariantCulture);
else
TrueBearing = double.NaN;
if (message[2].Length > 0)
MagneticBearing = double.Parse(message[2], CultureInfo.InvariantCulture);
else
MagneticBearing = double.NaN;
if (message.Length > 4 && !string.IsNullOrEmpty(message[4]))
DestinationId = message[4];
if (message.Length > 5 && !string.IsNullOrEmpty(message[5]))
OriginId = message[5];
}
/// <summary>
/// True Bearing from start to destination
/// </summary>
public double TrueBearing { get; }
/// <summary>
/// Magnetic Bearing from start to destination
/// </summary>
public double MagneticBearing { get; private set; }
/// <summary>
/// Magnetic Bearing from start to destination
/// </summary>
public double MagneticBearing { get; }
/// <summary>
/// Name of origin
/// </summary>
public string OriginId { get; private set; }
/// <summary>
/// Name of origin
/// </summary>
public string OriginId { get; }
/// <summary>
/// Name of destination
/// </summary>
public string DestinationId { get; private set; }
}
}
/// <summary>
/// Name of destination
/// </summary>
public string DestinationId { get; }
}
}

View file

@ -58,5 +58,12 @@ namespace NmeaParser.Nmea.Gps
/// <summary>Simulation</summary>
Simulation = 8
}
}
/// <summary>
/// Initializes a new instance of the <see cref="Gpgga"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gpgga(string type, string[] message) : base(type, message) { }
}
}

View file

@ -29,6 +29,12 @@ namespace NmeaParser.Nmea.Gps
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gpgll")]
[NmeaMessageType("GPGLL")]
public class Gpgll : Gll
{
}
{
/// <summary>
/// Initializes a new instance of the <see cref="Gpgll"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gpgll(string type, string[] message) : base(type, message) { }
}
}

View file

@ -63,5 +63,12 @@ namespace NmeaParser.Nmea.Gps
/// </summary>
Fix3D = 3
}
}
/// <summary>
/// Initializes a new instance of the <see cref="Gpgsa"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gpgsa(string type, string[] message) : base(type, message) { }
}
}

View file

@ -29,6 +29,12 @@ namespace NmeaParser.Nmea.Gps
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gpgst")]
[NmeaMessageType("GPGST")]
public class Gpgst : Gst
{
}
{
/// <summary>
/// Initializes a new instance of the <see cref="Gpgst"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gpgst(string type, string[] message) : base(type, message) { }
}
}

View file

@ -31,6 +31,12 @@ namespace NmeaParser.Nmea.Gps
[NmeaMessageType("GPGSV")]
public sealed class Gpgsv : Gsv
{
/// <summary>
/// Initializes a new instance of the <see cref="Gpgst"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gpgsv(string type, string[] message) : base(type, message) { }
}
/// <summary>
@ -50,19 +56,19 @@ namespace NmeaParser.Nmea.Gps
/// <summary>
/// SV PRN number
/// </summary>
public int PrnNumber { get; set; }
public int PrnNumber { get; }
/// <summary>
/// Elevation in degrees, 90 maximum
/// </summary>
public double Elevation { get; private set; }
public double Elevation{ get; }
/// <summary>
/// Azimuth, degrees from true north, 000 to 359
/// </summary>
public double Azimuth { get; private set; }
public double Azimuth{ get; }
/// <summary>
/// Signal-to-Noise ratio, 0-99 dB (-1 when not tracking)
/// </summary>
public int SignalToNoiseRatio { get; private set; }
public int SignalToNoiseRatio{ get; }
/// <summary>
/// Satellite system

View file

@ -23,117 +23,119 @@ using System.Threading.Tasks;
namespace NmeaParser.Nmea.Gps
{
/// <summary>
/// Recommended minimum navigation information
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gprmb")]
[NmeaMessageType("GPRMB")]
public class Gprmb : NmeaMessage
{
/// <summary>
/// Data status
/// </summary>
public enum DataStatus
{
/// <summary>
/// Ok
/// </summary>
Ok,
/// <summary>
/// Warning
/// </summary>
Warning
}
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
{
if (message == null || message.Length < 13)
throw new ArgumentException("Invalid GPRMB", "message");
Status = message[0] == "A" ? DataStatus.Ok : Gprmb.DataStatus.Warning;
double tmp;
if (double.TryParse(message[1], NumberStyles.Float, CultureInfo.InvariantCulture, out tmp))
{
CrossTrackError = tmp;
/// <summary>
/// Recommended minimum navigation information
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gprmb")]
[NmeaMessageType("GPRMB")]
public class Gprmb : NmeaMessage
{
/// <summary>
/// Data status
/// </summary>
public enum DataStatus
{
/// <summary>
/// Ok
/// </summary>
Ok,
/// <summary>
/// Warning
/// </summary>
Warning
}
if (message[2] == "L") //Steer left
CrossTrackError *= -1;
}
else
CrossTrackError = double.NaN;
/// <summary>
/// Initializes a new instance of the <see cref="Gprmb"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gprmb(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 13)
throw new ArgumentException("Invalid GPRMB", "message");
if(message[3].Length > 0)
OriginWaypointId = int.Parse(message[3], CultureInfo.InvariantCulture);
if (message[3].Length > 0)
DestinationWaypointId = int.Parse(message[4], CultureInfo.InvariantCulture);
DestinationLatitude = NmeaMessage.StringToLatitude(message[5], message[6]);
DestinationLongitude = NmeaMessage.StringToLongitude(message[7], message[8]);
if (double.TryParse(message[9], NumberStyles.Float, CultureInfo.InvariantCulture, out tmp))
RangeToDestination = tmp;
else
RangeToDestination = double.NaN;
if (double.TryParse(message[10], NumberStyles.Float, CultureInfo.InvariantCulture, out tmp))
TrueBearing = tmp;
else
TrueBearing = double.NaN;
if (double.TryParse(message[11], NumberStyles.Float, CultureInfo.InvariantCulture, out tmp))
Velocity = tmp;
else
Velocity = double.NaN;
Arrived = message[12] == "A";
}
/// <summary>
/// Data Status
/// </summary>
public DataStatus Status { get; private set; }
Status = message[0] == "A" ? DataStatus.Ok : Gprmb.DataStatus.Warning;
double tmp;
if (double.TryParse(message[1], NumberStyles.Float, CultureInfo.InvariantCulture, out tmp))
{
CrossTrackError = tmp;
/// <summary>
/// Cross-track error (steer left when negative, right when positive)
/// </summary>
public double CrossTrackError { get; private set; }
/// <summary>
/// Origin waypoint ID
/// </summary>
public double OriginWaypointId { get; private set; }
if (message[2] == "L") //Steer left
CrossTrackError *= -1;
}
else
CrossTrackError = double.NaN;
/// <summary>
/// Destination waypoint ID
/// </summary>
public double DestinationWaypointId { get; private set; }
if (message[3].Length > 0)
OriginWaypointId = int.Parse(message[3], CultureInfo.InvariantCulture);
if (message[3].Length > 0)
DestinationWaypointId = int.Parse(message[4], CultureInfo.InvariantCulture);
DestinationLatitude = NmeaMessage.StringToLatitude(message[5], message[6]);
DestinationLongitude = NmeaMessage.StringToLongitude(message[7], message[8]);
if (double.TryParse(message[9], NumberStyles.Float, CultureInfo.InvariantCulture, out tmp))
RangeToDestination = tmp;
else
RangeToDestination = double.NaN;
if (double.TryParse(message[10], NumberStyles.Float, CultureInfo.InvariantCulture, out tmp))
TrueBearing = tmp;
else
TrueBearing = double.NaN;
if (double.TryParse(message[11], NumberStyles.Float, CultureInfo.InvariantCulture, out tmp))
Velocity = tmp;
else
Velocity = double.NaN;
Arrived = message[12] == "A";
}
/// <summary>
/// Destination Latitude
/// </summary>
public double DestinationLatitude { get; private set; }
/// <summary>
/// Data Status
/// </summary>
public DataStatus Status { get; }
/// <summary>
/// Destination Longitude
/// </summary>
public double DestinationLongitude { get; private set; }
/// <summary>
/// Cross-track error (steer left when negative, right when positive)
/// </summary>
public double CrossTrackError { get; }
/// <summary>
/// Range to destination in nautical miles
/// </summary>
public double RangeToDestination { get; private set; }
/// <summary>
/// Origin waypoint ID
/// </summary>
public double OriginWaypointId { get; }
/// <summary>
/// True bearing to destination
/// </summary>
public double TrueBearing { get; private set; }
/// <summary>
/// Destination waypoint ID
/// </summary>
public double DestinationWaypointId { get; }
/// <summary>
/// Velocity towards destination in knots
/// </summary>
public double Velocity { get; private set; }
/// <summary>
/// Destination Latitude
/// </summary>
public double DestinationLatitude { get; }
/// <summary>
/// Arrived (<c>true</c> if arrived)
/// </summary>
public bool Arrived { get; private set; }
}
/// <summary>
/// Destination Longitude
/// </summary>
public double DestinationLongitude { get; }
/// <summary>
/// Range to destination in nautical miles
/// </summary>
public double RangeToDestination { get; }
/// <summary>
/// True bearing to destination
/// </summary>
public double TrueBearing { get; }
/// <summary>
/// Velocity towards destination in knots
/// </summary>
public double Velocity { get; }
/// <summary>
/// Arrived (<c>true</c> if arrived)
/// </summary>
public bool Arrived { get; }
}
}

View file

@ -29,6 +29,12 @@ namespace NmeaParser.Nmea.Gps
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gprmc")]
[NmeaMessageType("GPRMC")]
public class Gprmc : Rmc
{
}
{
/// <summary>
/// Initializes a new instance of the <see cref="Gprmc"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gprmc(string type, string[] message) : base(type, message) { }
}
}

View file

@ -23,86 +23,88 @@ using System.Threading.Tasks;
namespace NmeaParser.Nmea.Gps
{
/// <summary>
/// Routes
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gprte")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
[NmeaMessageType("GPRTE")]
public sealed class Gprte : NmeaMessage, IMultiPartMessage<string>
{
/// <summary>
/// Waypoint tpe
/// </summary>
public enum WaypointListType
{
/// <summary>
/// Complete list of waypoints
/// </summary>
CompleteWaypointsList,
/// <summary>
/// List of remaining waypoints
/// </summary>
RemainingWaypointsList
}
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
{
if (message == null || message.Length < 4)
throw new ArgumentException("Invalid GPRTE", "message");
/// <summary>
/// Routes
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gprte")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
[NmeaMessageType("GPRTE")]
public sealed class Gprte : NmeaMessage, IMultiPartMessage<string>
{
/// <summary>
/// Waypoint tpe
/// </summary>
public enum WaypointListType
{
/// <summary>
/// Complete list of waypoints
/// </summary>
CompleteWaypointsList,
/// <summary>
/// List of remaining waypoints
/// </summary>
RemainingWaypointsList
}
TotalMessages = int.Parse(message[0], CultureInfo.InvariantCulture);
MessageNumber = int.Parse(message[1], CultureInfo.InvariantCulture);
ListType = message[2] == "c" ? WaypointListType.CompleteWaypointsList : WaypointListType.RemainingWaypointsList;
RouteId = message[3];
Waypoints = message.Skip(4).ToArray();
}
/// <summary>
/// Initializes a new instance of the <see cref="Gprte"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gprte(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 4)
throw new ArgumentException("Invalid GPRTE", "message");
/// <summary>
/// Total number of messages of this type in this cycle
/// </summary>
public int TotalMessages { get; private set; }
TotalMessages = int.Parse(message[0], CultureInfo.InvariantCulture);
MessageNumber = int.Parse(message[1], CultureInfo.InvariantCulture);
ListType = message[2] == "c" ? WaypointListType.CompleteWaypointsList : WaypointListType.RemainingWaypointsList;
RouteId = message[3];
Waypoints = message.Skip(4).ToArray();
}
/// <summary>
/// Message number
/// </summary>
public int MessageNumber { get; private set; }
/// <summary>
/// Total number of messages of this type in this cycle
/// </summary>
public int TotalMessages { get; }
/// <summary>
/// Gets the type of the list.
/// </summary>
public WaypointListType ListType { get; private set; }
/// <summary>
/// Message number
/// </summary>
public int MessageNumber { get; }
/// <summary>
/// Gets the route identifier.
/// </summary>
public string RouteId { get; private set; }
/// <summary>
/// Waypoints
/// </summary>
public IReadOnlyList<string> Waypoints { get; private set; }
/// <summary>
/// Gets the type of the list.
/// </summary>
public WaypointListType ListType { get; }
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns> A System.Collections.Generic.IEnumerator{T} that can be used to iterate through the collection.</returns>
IEnumerator<string> IEnumerable<string>.GetEnumerator()
{
foreach (string waypoint in Waypoints)
yield return waypoint;
}
/// <summary>
/// Gets the route identifier.
/// </summary>
public string RouteId { get; }
/// <summary>
/// Returns an enumerator that iterates through a collection.
/// </summary>
/// <returns> An System.Collections.IEnumerator object that can be used to iterate through the collection.</returns>
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return ((IEnumerable<string>)this).GetEnumerator();
}
}
/// <summary>
/// Waypoints
/// </summary>
public IReadOnlyList<string> Waypoints { get; }
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns> A System.Collections.Generic.IEnumerator{T} that can be used to iterate through the collection.</returns>
IEnumerator<string> IEnumerable<string>.GetEnumerator()
{
foreach (string waypoint in Waypoints)
yield return waypoint;
}
/// <summary>
/// Returns an enumerator that iterates through a collection.
/// </summary>
/// <returns> An System.Collections.IEnumerator object that can be used to iterate through the collection.</returns>
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return ((IEnumerable<string>)this).GetEnumerator();
}
}
}

View file

@ -28,10 +28,11 @@ namespace NmeaParser.Nmea.Gps
public class Gpvtg : NmeaMessage
{
/// <summary>
/// Called when the message is being loaded.
/// Initializes a new instance of the <see cref="Gpvtg"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
public Gpvtg(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 7)
throw new ArgumentException("Invalid Gpvtg", "message");
@ -44,21 +45,21 @@ namespace NmeaParser.Nmea.Gps
/// <summary>
/// Course over ground relative to true north
/// </summary>
public double TrueCourseOverGround { get; private set; } = double.NaN;
public double TrueCourseOverGround { get; }
/// <summary>
/// Course over ground relative to magnetic north
/// </summary>
public double MagneticCourseOverGround { get; private set; } = double.NaN;
public double MagneticCourseOverGround { get; }
/// <summary>
/// Speed over ground in knots
/// </summary>
public double SpeedInKnots { get; private set; } = double.NaN;
public double SpeedInKnots { get; }
/// <summary>
/// Speed over ground in kilometers/hour
/// </summary>
public double SpeedInKph { get; private set; } = double.NaN;
public double SpeedInKph { get; }
}
}

View file

@ -4,5 +4,11 @@
[NmeaMessageType("GPZDA")]
public class Gpzda : Zda
{
/// <summary>
/// Initializes a new instance of the <see cref="Gpzda"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gpzda(string type, string[] message) : base(type, message) { }
}
}

View file

@ -30,13 +30,14 @@ namespace NmeaParser.Nmea.Gps.Garmin
[NmeaMessageType("PGRME")]
public class Pgrme : NmeaMessage
{
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
{
if (message == null || message.Length < 6)
/// <summary>
/// Initializes a new instance of the <see cref="Pgrme"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Pgrme(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 6)
throw new ArgumentException("Invalid PGRME", "message");
HorizontalError = NmeaMessage.StringToDouble(message[0]);
@ -51,33 +52,33 @@ namespace NmeaParser.Nmea.Gps.Garmin
/// Estimated horizontal position error in meters (HPE)
/// </summary>
/// <remarks>Range: 0.0 to 999.9 meters</remarks>
public double HorizontalError { get; private set; }
public double HorizontalError{ get; }
/// <summary>
/// Horizontal Error unit ('M' for Meters)
/// </summary>
public string HorizontalErrorUnits { get; private set; }
public string HorizontalErrorUnits{ get; }
/// <summary>
/// Estimated vertical position error in meters (VPE)
/// </summary>
/// <remarks>Range: 0.0 to 999.9 meters</remarks>
public double VerticalError { get; private set; }
public double VerticalError{ get; }
/// <summary>
/// Vertical Error unit ('M' for Meters)
/// </summary>
public string VerticalErrorUnits { get; private set; }
public string VerticalErrorUnits{ get; }
/// <summary>
/// Overall spherical equivalent position error (EPE)
/// </summary>
/// <remarks>Range: 0.0 to 999.9 meters</remarks>
public double SphericalError { get; private set; }
public double SphericalError{ get; }
/// <summary>
/// Spherical Error unit ('M' for Meters)
/// </summary>
public string SphericalErrorUnits { get; private set; }
public string SphericalErrorUnits{ get; }
}
}

View file

@ -23,84 +23,86 @@ using System.Threading.Tasks;
namespace NmeaParser.Nmea.Gps.Garmin
{
/// <summary>
/// Altitude Information
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Pgrmz")]
[NmeaMessageType("PGRMZ")]
public class Pgrmz : NmeaMessage
{
/// <summary>
/// Altitude unit
/// </summary>
public enum AltitudeUnit
{
/// <summary>
/// Unknown
/// </summary>
Unknown,
/// <summary>
/// Feet
/// </summary>
Feet
}
/// <summary>
/// Position Fix Dimension
/// </summary>
public enum PositionFixType : int
{
/// <summary>
/// Unknown
/// </summary>
Unknown = 0,
/// <summary>
/// No fix
/// </summary>
NoFix = 1,
/// <summary>
/// 2D Fix
/// </summary>
Fix2D = 2,
/// <summary>
/// 3D Fix
/// </summary>
Fix3D = 3
}
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
{
if (message == null || message.Length < 3)
throw new ArgumentException("Invalid PGRMZ", "message");
if (message[0].Length > 0)
Altitude = double.Parse(message[0], CultureInfo.InvariantCulture);
else
Altitude = double.NaN;
Unit = message[1] == "f" ? AltitudeUnit.Feet : AltitudeUnit.Unknown;
int dim = -1;
if (message[2].Length == 1 && int.TryParse(message[2], out dim))
{
if (dim >= (int)PositionFixType.NoFix && dim <= (int)PositionFixType.Fix3D)
FixType = (PositionFixType)dim;
}
}
/// <summary>
/// Altitude Information
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Pgrmz")]
[NmeaMessageType("PGRMZ")]
public class Pgrmz : NmeaMessage
{
/// <summary>
/// Altitude unit
/// </summary>
public enum AltitudeUnit
{
/// <summary>
/// Unknown
/// </summary>
Unknown,
/// <summary>
/// Feet
/// </summary>
Feet
}
/// <summary>
/// Position Fix Dimension
/// </summary>
public enum PositionFixType : int
{
/// <summary>
/// Unknown
/// </summary>
Unknown = 0,
/// <summary>
/// No fix
/// </summary>
NoFix = 1,
/// <summary>
/// 2D Fix
/// </summary>
Fix2D = 2,
/// <summary>
/// 3D Fix
/// </summary>
Fix3D = 3
}
/// <summary>
/// Current altitude
/// </summary>
public double Altitude { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="Pgrmz"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Pgrmz(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 3)
throw new ArgumentException("Invalid PGRMZ", "message");
/// <summary>
/// Horizontal Error unit ('f' for Meters)
/// </summary>
public AltitudeUnit Unit { get; private set; }
if (message[0].Length > 0)
Altitude = double.Parse(message[0], CultureInfo.InvariantCulture);
else
Altitude = double.NaN;
Unit = message[1] == "f" ? AltitudeUnit.Feet : AltitudeUnit.Unknown;
int dim = -1;
if (message[2].Length == 1 && int.TryParse(message[2], out dim))
{
if (dim >= (int)PositionFixType.NoFix && dim <= (int)PositionFixType.Fix3D)
FixType = (PositionFixType)dim;
}
}
/// <summary>
/// Fix type
/// </summary>
public PositionFixType FixType { get; private set; }
}
}
/// <summary>
/// Current altitude
/// </summary>
public double Altitude { get; }
/// <summary>
/// Horizontal Error unit ('f' for Meters)
/// </summary>
public AltitudeUnit Unit { get; }
/// <summary>
/// Fix type
/// </summary>
public PositionFixType FixType { get; }
}
}

View file

@ -11,5 +11,11 @@ namespace NmeaParser.Nmea.Gps
[NmeaMessageType("GPGNS")]
public class Gpgns : Gns
{
/// <summary>
/// Initializes a new instance of the <see cref="Gpgns"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Gpgns(string type, string[] message) : base(type, message) { }
}
}

View file

@ -29,13 +29,14 @@ namespace NmeaParser.Nmea
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gsa")]
public abstract class Gsa : NmeaMessage
{
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
{
if (message == null || message.Length < 17)
/// <summary>
/// Initializes a new instance of the <see cref="Gsa"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
protected Gsa(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 17)
throw new ArgumentException("Invalid GPGSA", "message");
GpsMode = message[0] == "A" ? Gps.Gpgsa.ModeSelection.Auto : Gps.Gpgsa.ModeSelection.Manual;
@ -70,34 +71,34 @@ namespace NmeaParser.Nmea
/// <summary>
/// Mode
/// </summary>
public Gps.Gpgsa.ModeSelection GpsMode { get; private set; }
public Gps.Gpgsa.ModeSelection GpsMode { get; }
/// <summary>
/// Mode
/// </summary>
public Gps.Gpgsa.Mode FixMode { get; private set; }
public Gps.Gpgsa.Mode FixMode { get; }
/// <summary>
/// IDs of SVs used in position fix
/// </summary>
public IReadOnlyList<int> SVs { get; private set; }
public IReadOnlyList<int> SVs { get; }
/// <summary>
/// Dilution of precision
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Pdop")]
public double Pdop { get; private set; }
public double Pdop { get; }
/// <summary>
/// Horizontal dilution of precision
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Hdop")]
public double Hdop { get; private set; }
public double Hdop { get; }
/// <summary>
/// Vertical dilution of precision
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Vdop")]
public double Vdop { get; private set; }
public double Vdop { get; }
}
}

View file

@ -30,10 +30,11 @@ namespace NmeaParser.Nmea
public abstract class Gst : NmeaMessage
{
/// <summary>
/// Called when the message is being loaded.
/// Initializes a new instance of the <see cref="Gst"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
protected Gst(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 8)
throw new ArgumentException("Invalid GPGST", "message");
@ -50,28 +51,28 @@ namespace NmeaParser.Nmea
/// <summary>
/// UTC of position fix
/// </summary>
public TimeSpan FixTime { get; private set; }
public TimeSpan FixTime { get; }
/// <summary>
/// RMS value of the pseudorange residuals; includes carrier phase residuals during periods of RTK (float) and RTK (fixed) processing
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Rms")]
public double Rms { get; private set; }
public double Rms { get; }
/// <summary>
/// Error ellipse semi-major axis 1 sigma error, in meters
/// </summary>
public double SemiMajorError { get; private set; }
public double SemiMajorError { get; }
/// <summary>
/// Error ellipse semi-minor axis 1 sigma error, in meters
/// </summary>
public double SemiMinorError { get; private set; }
public double SemiMinorError { get; }
/// <summary>
/// Error ellipse orientation, degrees from true north
/// </summary>
public double ErrorOrientation { get; private set; }
public double ErrorOrientation { get; }
/// <summary>
/// Latitude 1 sigma error, in meters
@ -79,7 +80,7 @@ namespace NmeaParser.Nmea
/// <remarks>
/// The error expressed as one standard deviation.
/// </remarks>
public double SigmaLatitudeError { get; private set; }
public double SigmaLatitudeError { get; }
/// <summary >
/// Longitude 1 sigma error, in meters
@ -87,7 +88,7 @@ namespace NmeaParser.Nmea
/// <remarks>
/// The error expressed as one standard deviation.
/// </remarks>
public double SigmaLongitudeError { get; private set; }
public double SigmaLongitudeError { get; }
/// <summary >
/// Height 1 sigma error, in meters
@ -95,6 +96,6 @@ namespace NmeaParser.Nmea
/// <remarks>
/// The error expressed as one standard deviation.
/// </remarks>
public double SigmaHeightError { get; private set; }
public double SigmaHeightError { get; }
}
}

View file

@ -30,14 +30,15 @@ namespace NmeaParser.Nmea
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gsv")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
public abstract class Gsv : NmeaMessage, IMultiPartMessage<SatelliteVehicle>
{
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
{
if (message == null || message.Length < 3)
{
/// <summary>
/// Initializes a new instance of the <see cref="Gsv"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
protected Gsv(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 3)
throw new ArgumentException("Invalid GSV", "message");
TotalMessages = int.Parse(message[0], CultureInfo.InvariantCulture);
@ -58,22 +59,22 @@ namespace NmeaParser.Nmea
/// <summary>
/// Total number of messages of this type in this cycle
/// </summary>
public int TotalMessages { get; private set; }
public int TotalMessages { get; }
/// <summary>
/// Message number
/// </summary>
public int MessageNumber { get; private set; }
public int MessageNumber { get; }
/// <summary>
/// Total number of SVs in view
/// </summary>
public int SVsInView { get; private set; }
public int SVsInView { get; }
/// <summary>
/// Satellite vehicles in this message part.
/// </summary>
public IReadOnlyList<SatelliteVehicle> SVs { get; private set; }
public IReadOnlyList<SatelliteVehicle> SVs { get; }
/// <summary>
/// Returns an enumerator that iterates through the collection.

View file

@ -28,14 +28,15 @@ namespace NmeaParser.Nmea.LaserRange
/// Laser Range Measurement
/// </summary>
public abstract class LaserRangeMessage : NmeaMessage
{
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
{
if (message == null || message.Length < 9)
{
/// <summary>
/// Initializes a new instance of the <see cref="LaserRangeMessage"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
protected LaserRangeMessage(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 9)
throw new ArgumentException("Invalid Laser Range Message", "message");
HorizontalVector = message[0];
@ -52,46 +53,46 @@ namespace NmeaParser.Nmea.LaserRange
/// <summary>
/// Gets the horizontal vector.
/// </summary>
public string HorizontalVector { get; private set; }
public string HorizontalVector { get; }
/// <summary>
/// Gets the horizontal distance.
/// </summary>
public double HorizontalDistance { get; private set; }
public double HorizontalDistance { get; }
/// <summary>
/// Gets the units of the <see cref="HorizontalDistance"/> value.
/// </summary>
public char HorizontalDistanceUnits { get; private set; }
public char HorizontalDistanceUnits { get; }
/// <summary>
/// Gets the horizontal angle.
/// </summary>
public double HorizontalAngle { get; private set; }
public double HorizontalAngle { get; }
/// <summary>
/// Gets the units of the <see cref="HorizontalAngle"/> value.
/// </summary>
public char HorizontalAngleUnits { get; private set; }
public char HorizontalAngleUnits { get; }
/// <summary>
/// Gets the vertical angle.
/// </summary>
public double VerticalAngle { get; private set; }
public double VerticalAngle { get; }
/// <summary>
/// Gets the units of the <see cref="VerticalAngle"/> value.
/// </summary>
public char VerticalAngleUnits { get; private set; }
public char VerticalAngleUnits { get; }
/// <summary>
/// Gets the slope distance.
/// </summary>
public double SlopeDistance { get; private set; }
public double SlopeDistance { get; }
/// <summary>
/// Gets the units of the <see cref="SlopeDistance"/> value.
/// </summary>
public char SlopeDistanceUnits { get; private set; }
public char SlopeDistanceUnits { get; }
}
}

View file

@ -29,6 +29,12 @@ namespace NmeaParser.Nmea.LaserRange.LaserTech
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Pltit")]
[NmeaMessageType("PLTIT")]
public class Pltit : LaserRangeMessage
{
}
{
/// <summary>
/// Initializes a new instance of the <see cref="Pltit"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Pltit(string type, string[] message) : base(type, message) { }
}
}

View file

@ -29,6 +29,12 @@ namespace NmeaParser.Nmea.LaserRange.Trimble
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ptnla")]
[NmeaMessageType("PTNLA")]
public class Ptnla : LaserRangeMessage
{
}
{
/// <summary>
/// Initializes a new instance of the <see cref="Ptnla"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Ptnla(string type, string[] message) : base(type, message) { }
}
}

View file

@ -23,61 +23,63 @@ using System.Threading.Tasks;
namespace NmeaParser.Nmea.LaserRange.Trimble
{
/// <summary>
/// Tree Measurement
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ptnlb")]
[NmeaMessageType("PTNLB")]
public class Ptnlb : NmeaMessage
{
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
{
if (message == null || message.Length < 6)
throw new ArgumentException("Invalid PTNLB", "message");
TreeHeight = message[0];
MeasuredTreeHeight = double.Parse(message[1], CultureInfo.InvariantCulture);
MeasuredTreeHeightUnits = message[2][0];
TreeDiameter = message[3];
MeasuredTreeDiameter = double.Parse(message[4], CultureInfo.InvariantCulture);
MeasuredTreeDiameterUnits = message[5][0];
}
/// <summary>
/// Tree Measurement
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ptnlb")]
[NmeaMessageType("PTNLB")]
public class Ptnlb : NmeaMessage
{
/// <summary>
/// Gets the height of the tree.
/// </summary>
public string TreeHeight { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="Ptnlb"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
public Ptnlb(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 6)
throw new ArgumentException("Invalid PTNLB", "message");
/// <summary>
/// Gets the message height of the tree.
/// </summary>
public double MeasuredTreeHeight { get; private set; }
TreeHeight = message[0];
MeasuredTreeHeight = double.Parse(message[1], CultureInfo.InvariantCulture);
MeasuredTreeHeightUnits = message[2][0];
TreeDiameter = message[3];
MeasuredTreeDiameter = double.Parse(message[4], CultureInfo.InvariantCulture);
MeasuredTreeDiameterUnits = message[5][0];
}
/// <summary>
/// Gets the units of the <see cref="MeasuredTreeHeight"/> value.
/// </summary>
public char MeasuredTreeHeightUnits { get; private set; }
/// <summary>
/// Gets the height of the tree.
/// </summary>
public string TreeHeight { get; }
/// <summary>
/// Gets the tree diameter.
/// </summary>
public string TreeDiameter { get; private set; }
/// <summary>
/// Gets the message height of the tree.
/// </summary>
public double MeasuredTreeHeight { get; }
/// <summary>
/// Gets the measured tree diameter.
/// </summary>
public double MeasuredTreeDiameter { get; private set; }
/// <summary>
/// Gets the units of the <see cref="MeasuredTreeHeight"/> value.
/// </summary>
public char MeasuredTreeHeightUnits { get; }
/// <summary>
/// Gets the units of the <see cref="MeasuredTreeDiameter"/> value.
/// </summary>
public char MeasuredTreeDiameterUnits { get; private set; }
/// <summary>
/// Gets the tree diameter.
/// </summary>
public string TreeDiameter { get; }
//more to do...
}
/// <summary>
/// Gets the measured tree diameter.
/// </summary>
public double MeasuredTreeDiameter { get; }
/// <summary>
/// Gets the units of the <see cref="MeasuredTreeDiameter"/> value.
/// </summary>
public char MeasuredTreeDiameterUnits { get; }
//more to do...
}
}

View file

@ -1,4 +1,4 @@
//
//
// Copyright (c) 2014 Morten Nielsen
//
// Licensed under the Microsoft Public License (Ms-PL) (the "License");
@ -49,6 +49,44 @@ namespace NmeaParser.Nmea
/// </summary>
public abstract class NmeaMessage
{
private static Dictionary<string, ConstructorInfo> messageTypes;
/// <summary>
/// Initializes an instance of the NMEA message
/// </summary>
/// <param name="messageType">Type</param>
/// <param name="messageParts">Message values</param>
protected NmeaMessage(string messageType, string[] messageParts)
{
MessageType = messageType;
MessageParts = messageParts;
}
static NmeaMessage()
{
messageTypes = new Dictionary<string, ConstructorInfo>();
var typeinfo = typeof(NmeaMessage).GetTypeInfo();
foreach (var subclass in typeinfo.Assembly.DefinedTypes.Where(t => t.IsSubclassOf(typeof(NmeaMessage))))
{
var attr = subclass.GetCustomAttribute<NmeaMessageTypeAttribute>(false);
if (attr != null)
{
if (!subclass.IsAbstract)
{
foreach (var c in subclass.DeclaredConstructors)
{
var pinfo = c.GetParameters();
if (pinfo.Length == 2 && pinfo[0].ParameterType == typeof(string) && pinfo[1].ParameterType == typeof(string[]))
{
messageTypes.Add(attr.NmeaType, c);
break;
}
}
}
}
}
}
/// <summary>
/// Parses the specified NMEA message.
/// </summary>
@ -86,70 +124,25 @@ namespace NmeaParser.Nmea
string[] parts = message.Split(new char[] { ',' });
string MessageType = parts[0].Substring(1);
string[] MessageParts = parts.Skip(1).ToArray();
if(messageTypes == null)
{
LoadResponseTypes();
}
NmeaMessage msg = null;
if (messageTypes.ContainsKey(MessageType))
{
msg = (NmeaMessage)messageTypes[MessageType].Invoke(new object[] { });
return (NmeaMessage)messageTypes[MessageType].Invoke(new object[] { MessageType, MessageParts });
}
else
{
msg = new UnknownMessage();
}
msg.MessageType = MessageType;
msg.MessageParts = MessageParts;
msg.OnLoadMessage(MessageParts);
return msg;
}
private static void LoadResponseTypes()
{
messageTypes = new Dictionary<string, ConstructorInfo>();
var typeinfo = typeof(NmeaMessage).GetTypeInfo();
foreach (var subclass in typeinfo.Assembly.DefinedTypes.Where(t => t.IsSubclassOf(typeof(NmeaMessage))))
{
var attr = subclass.GetCustomAttribute<NmeaMessageTypeAttribute>(false);
if (attr != null)
{
if (!subclass.IsAbstract)
{
foreach (var c in subclass.DeclaredConstructors)
{
var pinfo = c.GetParameters();
if (pinfo.Length == 0)
{
messageTypes.Add(attr.NmeaType, c);
break;
}
}
}
}
return new UnknownMessage(MessageType, MessageParts);
}
}
private static Dictionary<string, ConstructorInfo> messageTypes;
/// <summary>
/// Gets the NMEA message parts.
/// </summary>
protected IReadOnlyList<string> MessageParts { get; private set; }
protected IReadOnlyList<string> MessageParts { get; }
/// <summary>
/// Gets the NMEA type id for the message.
/// </summary>
public string MessageType { get; private set; }
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
/// <remarks>
/// Implement this method to create a custom NMEA message.
/// </remarks>
protected virtual void OnLoadMessage(string[] message) { MessageParts = message; }
public string MessageType { get; }
/// <summary>
/// Returns a <see cref="System.String" /> that represents this instance.

View file

@ -29,13 +29,14 @@ namespace NmeaParser.Nmea
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Gprmc")]
public abstract class Rmc : NmeaMessage
{
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
{
if (message == null || message.Length < 11)
/// <summary>
/// Initializes a new instance of the <see cref="Rmc"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
protected Rmc(string type, string[] message) : base(type, message)
{
if (message == null || message.Length < 11)
throw new ArgumentException("Invalid GPRMC", "message");
if (message[8].Length == 6 && message[0].Length >= 6)
@ -60,36 +61,36 @@ namespace NmeaParser.Nmea
/// <summary>
/// Fix Time
/// </summary>
public DateTime FixTime { get; private set; }
public DateTime FixTime { get; }
/// <summary>
/// Gets a value whether the device is active
/// </summary>
public bool Active { get; private set; }
public bool Active { get; }
/// <summary>
/// Latitude
/// </summary>
public double Latitude { get; private set; }
public double Latitude { get; }
/// <summary>
/// Longitude
/// </summary>
public double Longitude { get; private set; }
public double Longitude { get; }
/// <summary>
/// Speed over the ground in knots
/// </summary>
public double Speed { get; private set; }
public double Speed { get; }
/// <summary>
/// Track angle in degrees True
/// </summary>
public double Course { get; private set; }
public double Course { get; }
/// <summary>
/// Magnetic Variation
/// </summary>
public double MagneticVariation { get; private set; }
public double MagneticVariation { get; }
}
}

View file

@ -27,16 +27,11 @@ namespace NmeaParser.Nmea
/// </summary>
public class UnknownMessage : NmeaMessage
{
internal UnknownMessage(string type, string[] messageParts) : base(type, messageParts) { }
/// <summary>
/// Gets the nmea value array.
/// </summary>
public IReadOnlyList<string> Values { get { return base.MessageParts; } }
/// <summary>
/// Called when the message is being loaded.
/// </summary>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
{
}
}
}

View file

@ -10,14 +10,15 @@ namespace NmeaParser.Nmea
public abstract class Zda : NmeaMessage
{
/// <summary>
/// Called when the message is being loaded.
/// Initializes a new instance of the <see cref="Zda"/> class.
/// </summary>
/// <param name="type">The message type</param>
/// <param name="message">The NMEA message values.</param>
protected override void OnLoadMessage(string[] message)
protected Zda(string type, string[] message) : base(type, message)
{
if (message?.Length != 6)
{
throw new ArgumentException("Invalid GNGST", nameof(message));
throw new ArgumentException("Invalid ZDA", nameof(message));
}
var time = StringToTimeSpan(message[0]);
@ -33,6 +34,9 @@ namespace NmeaParser.Nmea
// specify this, so we're just ignoring it.
}
public DateTime FixDateTime { get; private set; }
/// <summary>
/// Gets the time of fix
/// </summary>
public DateTime FixDateTime { get; }
}
}

View file

@ -298,13 +298,15 @@ namespace NmeaParser
internal NmeaMessageReceivedEventArgs(Nmea.NmeaMessage message) {
Message = message;
}
/// <summary>
/// Gets the nmea message.
/// </summary>
/// <value>
/// The nmea message.
/// </value>
public Nmea.NmeaMessage Message { get; private set; }
public Nmea.NmeaMessage Message { get; }
/// <summary>
/// Gets a value indicating whether this instance is a multi part message.
/// </summary>
@ -312,6 +314,7 @@ namespace NmeaParser
/// <c>true</c> if this instance is multi part; otherwise, <c>false</c>.
/// </value>
public bool IsMultipart { get; internal set; }
/// <summary>
/// Gets the message parts if this is a multi-part message and all message parts has been received.
/// </summary>

View file

@ -1,70 +1,72 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.4;net451;monoandroid50;monoandroid70;xamarinios10;uap10.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
<Authors>Morten Nielsen</Authors>
<Company>Morten Nielsen</Company>
<Description>An NMEA stream parser for serial port, bluetooth and file-based nmea simulation.</Description>
<PackageTags>nmea winrt wpf uwp xamarin gps serialport bluetooth</PackageTags>
<PackageId>SharpGIS.NmeaParser</PackageId>
<Version>1.11</Version>
<PackageLicenseUrl>http://opensource.org/licenses/ms-pl.html</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/dotMorten/NmeaParser</PackageProjectUrl>
<RepositoryUrl>https://github.com/dotMorten/NmeaParser</RepositoryUrl>
<NeutralLanguage>en-US</NeutralLanguage>
<Copyright>Copyright © Morten Nielsen 2015-2018</Copyright>
<OutputPath>$(MSBuildThisFileDirectory)..\Bin\$(Configuration)</OutputPath>
<PackageOutputPath>$(OutDir)</PackageOutputPath>
<AssemblyVersion>1.10.1.0</AssemblyVersion>
<FileVersion>1.10.1.0</FileVersion>
<PackageReleaseNotes>Fixed missing shutdown of Android location device.
Exposed non-NMEA based Accuracy estimate on Android location device.</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.4'">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
<Product>NMEA Parser - .NET Standard 1.4</Product>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net451'">
<DefineConstants>$(DefineConstants);NETFX</DefineConstants>
<Product>NMEA Parser - .NET Framework 4.5.1</Product>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'monoandroid50'">
<DefineConstants>$(DefineConstants);XAMARIN;API_LEVEL_21</DefineConstants>
<Product>NMEA Parser - Android</Product>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'monoandroid70'">
<DefineConstants>$(DefineConstants);XAMARIN;API_LEVEL_24</DefineConstants>
<Product>NMEA Parser - Android</Product>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'xamarinios10'">
<DefineConstants>$(DefineConstants);XAMARIN</DefineConstants>
<Product>NMEA Parser - iOS</Product>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.14393.0</TargetPlatformMinVersion>
<Product>NMEA Parser - UWP</Product>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="5.1.0" />
<PackageReference Include="System.Numerics.Vectors" Version="4.1.0" />
<EmbeddedResource Include="**\*.rd.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.1.0" PrivateAssets="all" />
</ItemGroup>
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.4;net451;monoandroid50;monoandroid70;xamarinios10;uap10.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
<Authors>Morten Nielsen</Authors>
<Company>Morten Nielsen</Company>
<Description>An NMEA stream parser for serial port, bluetooth and file-based nmea simulation.</Description>
<PackageTags>nmea winrt wpf uwp xamarin gps serialport bluetooth</PackageTags>
<PackageId>SharpGIS.NmeaParser</PackageId>
<Version>1.11</Version>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/dotMorten/NmeaParser</PackageProjectUrl>
<RepositoryUrl>https://github.com/dotMorten/NmeaParser</RepositoryUrl>
<NeutralLanguage>en-US</NeutralLanguage>
<Copyright>Copyright © Morten Nielsen 2015-2019</Copyright>
<OutputPath>$(MSBuildThisFileDirectory)..\Bin\$(Configuration)</OutputPath>
<PackageOutputPath>$(OutDir)</PackageOutputPath>
<PackageReleaseNotes>Lots of API cleanup to avoid null-references. Simplify object model for creation (semi-breaking). Updated license to Apache 2.0</PackageReleaseNotes>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.4'">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
<Product>NMEA Parser - .NET Standard 1.4</Product>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net451'">
<DefineConstants>$(DefineConstants);NETFX</DefineConstants>
<Product>NMEA Parser - .NET Framework 4.5.1</Product>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'monoandroid50'">
<DefineConstants>$(DefineConstants);XAMARIN;API_LEVEL_21</DefineConstants>
<Product>NMEA Parser - Android</Product>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'monoandroid70'">
<DefineConstants>$(DefineConstants);XAMARIN;API_LEVEL_24</DefineConstants>
<Product>NMEA Parser - Android</Product>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'xamarinios10'">
<DefineConstants>$(DefineConstants);XAMARIN</DefineConstants>
<Product>NMEA Parser - iOS</Product>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.14393.0</TargetPlatformMinVersion>
<Product>NMEA Parser - UWP</Product>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="5.1.0" />
<PackageReference Include="System.Numerics.Vectors" Version="4.1.0" />
<EmbeddedResource Include="**\*.rd.xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.1.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All" />
</ItemGroup>
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
</Project>

View file

@ -42,10 +42,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MSTest.TestFramework">
<Version>1.2.0</Version>
<Version>1.4.0</Version>
</PackageReference>
<PackageReference Include="MSTest.TestAdapter">
<Version>1.2.0</Version>
<Version>1.4.0</Version>
</PackageReference>
<Reference Include="System" />
<Reference Include="System.Core" />