From 403011655cebcdca85fba8e692fb200e6bd53b5a Mon Sep 17 00:00:00 2001 From: Howard van Rooijen Date: Wed, 9 Oct 2024 09:00:51 +0100 Subject: [PATCH 1/6] Update copyright notice --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 261eeb9..2879e16 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2024 Endjin Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From bb692cfbfc7f5d8b52aa052499208b9f64f8be6b Mon Sep 17 00:00:00 2001 From: Howard van Rooijen Date: Wed, 9 Oct 2024 12:39:20 +0100 Subject: [PATCH 2/6] Add support for Message Type 27 Refactor existing interfaces and types to support Message Type 27 fields --- README.md | 126 +++++++++--------- Solutions/Ais.Net.Models.sln | 1 + .../Abstractions/IAisMessageType1to3.cs | 2 - .../Models/Abstractions/IAisMessageType27.cs | 12 ++ .../Abstractions/IVesselCourseOverGround.cs | 10 ++ .../Models/Abstractions/IVesselNavigation.cs | 8 +- .../Abstractions/IVesselNavigationStatus.cs | 10 ++ .../Abstractions/IVesselPositionAccuracy.cs | 10 ++ .../Abstractions/IVesselSpeedOverGround.cs | 10 ++ .../Ais/Net/Models/Abstractions/Position.cs | 23 ++-- .../Net/Models/Abstractions/ShipTypeGroup.cs | 2 +- .../Ais/Net/Models/AisMessageExtensions.cs | 9 +- .../Ais/Net/Models/AisMessageType18.cs | 2 +- .../Ais/Net/Models/AisMessageType19.cs | 2 +- .../Ais/Net/Models/AisMessageType1Through3.cs | 5 +- .../Ais/Net/Models/AisMessageType27.cs | 25 ++++ 16 files changed, 169 insertions(+), 88 deletions(-) create mode 100644 Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IAisMessageType27.cs create mode 100644 Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselCourseOverGround.cs create mode 100644 Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselNavigationStatus.cs create mode 100644 Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselPositionAccuracy.cs create mode 100644 Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselSpeedOverGround.cs create mode 100644 Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType27.cs diff --git a/README.md b/README.md index 6341139..314e0e8 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ Ais.Net.Models provides a series of [C# 9.0 records](https://devblogs.microsoft.com/dotnet/c-9-0-on-the-record/) which define the the message types, a series of interfaces that define common behaviours, and extension methods to help with type conversions & calculations. -| Package | Status | -| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| [Ais.Net.Models](https://github.com/ais-dotnet/Ais.Net.Models/) | [![#](https://img.shields.io/nuget/v/Ais.Net.Models.svg)](https://www.nuget.org/packages/Ais.Net.Models/) | | +| Package | Status | +|-----------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------| +| [Ais.Net.Models](https://github.com/ais-dotnet/Ais.Net.Models/) | [![#](https://img.shields.io/nuget/v/Ais.Net.Models.svg)](https://www.nuget.org/packages/Ais.Net.Models/) | The [AIS.NET](https://github.com/ais-dotnet/) project contains a series of layers, from a [low-level high performance NMEA AIS sentence decoder](https://github.com/ais-dotnet/Ais.Net/), to a [rich high-level C# 9.0 models](https://github.com/ais-dotnet/Ais.Net.Models/) of AIS message types, a [receiver component](https://github.com/ais-dotnet/Ais.Net.Receiver/) that can listen to TCP streams of NMEA sentences and expose them as an `IObservable` of raw sentences or an decoded `IObservable`, and finally a Storage Client implementation to persisting the raw NMEA sentence stream to Azure Blob storage for future processing. @@ -14,65 +14,67 @@ The table below shows the messages, their properties and how they are mapped to
Show AIS Message Types and .NET Interfaces -| | Message Type 1 to 3 | Message Type 5 | Message Type 18 | Message Type 19 | Message Type 24 Part 0 | Message Type 24 Part 1 | -| ---------------------- | --------------------------- | -------------------- | ----------------------------------- | --------------------------- | ---------------------- | ---------------------- | -| IAisMessageType5 | | AisVersion | | | | | -| ICallSign | | CallSign | | | | CallSign | -| IAisMessageType18 | | | CanAcceptMessage22ChannelAssignment | | | | -| IAisMessageType18 | | | CanSwitchBands | | | | -| IVesselNavigation | CourseOverGround10thDegrees | | CourseOverGround10thDegrees | CourseOverGround10thDegrees | | | -| IAisMessageType5 | | Destination | | | | | -| IAisMessageType18 | | | CsUnit | | | | -| IVesselDimensions | | DimensionToBow | | DimensionToBow | | DimensionToBow | -| IVesselDimensions | | DimensionToPort | | DimensionToPort | | DimensionToPort | -| IVesselDimensions | | DimensionToStarboard | | DimensionToStarboard | | DimensionToStarboard | -| IVesselDimensions | | DimensionToStern | | DimensionToStern | | DimensionToStern | -| IAisMessageType5 | | Draught10thMetres | | | | | -| IAisMessageType5 | | EtaMonth | | | | | -| IAisMessageType5 | | EtaDay | | | | | -| IAisMessageType5 | | EtaHour | | | | | -| IAisMessageType5 | | EtaMinute | | | | | -| IAisMessageType18 | | | HasDisplay | | | | -| IIsAssigned | | | IsAssigned | IsAssigned | | | -| IAisMessageType18 | | | IsDscAttached | | | | -| IAisMessageType5 | | ImoNumber | | | | | -| IAisIsDteNotReady | | IsDteNotReady | | IsDteNotReady | | | -| IVesselNavigation | Latitude10000thMins | | Latitude10000thMins | Latitude10000thMins | | | -| IVesselNavigation | Longitude10000thMins | | Longitude10000thMins | Longitude10000thMins | | | -| IAisMessageType1to3 | ManoeuvreIndicator | | | | | | -| IAisMessageType24Part1 | | | | | | MothershipMmsi | -| IAisMessageType | MessageType | MessageType | MessageType | MessageType | MessageType | MessageType | -| IVesselIdentity | Mmsi | Mmsi | Mmsi | Mmsi | Mmsi | Mmsi | -| IAisMessageType1to3 | NavigationStatus | | | | | | -| IAisMultipartMessage | | | | | PartNumber | PartNumber | -| IVesselNavigation | PositionAccuracy | | PositionAccuracy | PositionAccuracy | | | -| IAisPositionFixType | | PositionFixType | | PositionFixType | | | -| IAisMessageType18 | | | RadioStatusType | | | | -| IAisMessageType1to3 | RadioSlotTimeout | | | | | | -| IAisMessageType1to3 | RadioSubMessage | | | | | | -| IAisMessageType1to3 | RadioSyncState | | | | | | -| IAisMessageType19 | | | | RegionalReserved139 | | | -| IAisMessageType19 | | | | RegionalReserved38 | | | -| IRaimFlag | RaimFlag | | RaimFlag | RaimFlag | | | -| IAisMessageType18 | | | RegionalReserved139 | | | | -| IAisMessageType18 | | | RegionalReserved38 | | | | -| IAisMessageType1to3 | RateOfTurn | | | | | | -| IRepeatIndicator | RepeatIndicator | RepeatIndicator | RepeatIndicator | RepeatIndicator | RepeatIndicator | RepeatIndicator | -| IAisMessageType24Part1 | | | | | | SerialNumber | -| IAisMessageType19 | | | | ShipName | | | -| IShipType | | ShipType | | ShipType | | ShipType | -| IAisMessageType1to3 | SpareBits145 | | | | | | -| IAisMessageType24Part0 | | | | | Spare160 | | -| IAisMessageType24Part1 | | | | | | Spare162 | -| IAisMessageType5 | | Spare423 | | | | | -| IAisMessageType19 | | | | Spare308 | | | -| IVesselNavigation | SpeedOverGroundTenths | | SpeedOverGroundTenths | SpeedOverGroundTenths | | | -| IVesselNavigation | TimeStampSecond | | TimeStampSecond | TimeStampSecond | | | -| IVesselNavigation | TrueHeadingDegrees | | TrueHeadingDegrees | TrueHeadingDegrees | | | -| IAisMessageType24Part1 | | | | | | UnitModelCode | -| IAisMessageType24Part1 | | | | | | VendorIdRev3 | -| IAisMessageType24Part1 | | | | | | VendorIdRev4 | -| IVesselName | | VesselName | | | | | +| | Message Type 1 to 3 | Message Type 5 | Message Type 18 | Message Type 19 | Message Type 24 Part 0 | Message Type 24 Part 1 | Message Type 27 | +|-------------------------|----------------------|----------------------|-------------------------------------|----------------------|------------------------|------------------------|-------------------------| +| IAisMessageType5 | | AisVersion | | | | | | +| ICallSign | | CallSign | | | | CallSign | | +| IAisMessageType18 | | | CanAcceptMessage22ChannelAssignment | | | | | +| IAisMessageType18 | | | CanSwitchBands | | | | | +| IVesselCourseOverGround | CourseOverGround | | CourseOverGround | CourseOverGround | | | CourseOverGround | +| IAisMessageType18 | | | CsUnit | | | | | +| IAisMessageType5 | | Destination | | | | | | +| IVesselDimensions | | DimensionToBow | | DimensionToBow | | DimensionToBow | | +| IVesselDimensions | | DimensionToPort | | DimensionToPort | | DimensionToPort | | +| IVesselDimensions | | DimensionToStarboard | | DimensionToStarboard | | DimensionToStarboard | | +| IVesselDimensions | | DimensionToStern | | DimensionToStern | | DimensionToStern | | +| IAisMessageType5 | | Draught10thMetres | | | | | | +| IAisMessageType5 | | EtaMonth | | | | | | +| IAisMessageType5 | | EtaDay | | | | | | +| IAisMessageType5 | | EtaHour | | | | | | +| IAisMessageType5 | | EtaMinute | | | | | | +| IAisMessageType18 | | | HasDisplay | | | | | +| IIsAssigned | | | IsAssigned | IsAssigned | | | | +| IAisMessageType18 | | | IsDscAttached | | | | | +| IAisMessageType5 | | ImoNumber | | | | | | +| IAisIsDteNotReady | | IsDteNotReady | | IsDteNotReady | | | | +| IVesselNavigation | Latitude10000thMins | | Latitude10000thMins | Latitude10000thMins | | | | +| IVesselNavigation | Longitude10000thMins | | Longitude10000thMins | Longitude10000thMins | | | | +| IAisMessageType1to3 | ManoeuvreIndicator | | | | | | | +| IAisMessageType24Part1 | | | | | | MothershipMmsi | | +| IAisMessageType | MessageType | MessageType | MessageType | MessageType | MessageType | MessageType | | +| IVesselIdentity | Mmsi | Mmsi | Mmsi | Mmsi | Mmsi | Mmsi | | +| IAisMultipartMessage | | | | | PartNumber | PartNumber | | +| IVesselPositionAccuracy | PositionAccuracy | | PositionAccuracy | PositionAccuracy | | | PositionAccuracy | +| IAisPositionFixType | | PositionFixType | | PositionFixType | | | | +| IAisMessageType18 | | | RadioStatusType | | | | | +| IAisMessageType1to3 | RadioSlotTimeout | | | | | | | +| IAisMessageType1to3 | RadioSubMessage | | | | | | | +| IAisMessageType1to3 | RadioSyncState | | | | | | | +| IAisMessageType19 | | | | RegionalReserved139 | | | | +| IAisMessageType19 | | | | RegionalReserved38 | | | | +| IRaimFlag | RaimFlag | | RaimFlag | RaimFlag | | | RaimFlag | +| IAisMessageType18 | | | RegionalReserved139 | | | | | +| IAisMessageType18 | | | RegionalReserved38 | | | | | +| IAisMessageType1to3 | RateOfTurn | | | | | | | +| IRepeatIndicator | RepeatIndicator | RepeatIndicator | RepeatIndicator | RepeatIndicator | RepeatIndicator | RepeatIndicator | RepeatIndicator | +| IAisMessageType24Part1 | | | | | | SerialNumber | | +| IAisMessageType19 | | | | ShipName | | | | +| IShipType | | ShipType | | ShipType | | ShipType | | +| IAisMessageType1to3 | SpareBits145 | | | | | | | +| IAisMessageType24Part0 | | | | | Spare160 | | | +| IAisMessageType24Part1 | | | | | | Spare162 | | +| IAisMessageType5 | | Spare423 | | | | | | +| IAisMessageType19 | | | | Spare308 | | | | +| IVesselSpeedOverGround | SpeedOverGround | | SpeedOverGround | SpeedOverGround | | | SpeedOverGround | +| IVesselNavigation | TimeStampSecond | | TimeStampSecond | TimeStampSecond | | | | +| IVesselNavigation | TrueHeadingDegrees | | TrueHeadingDegrees | TrueHeadingDegrees | | | | +| IAisMessageType24Part1 | | | | | | UnitModelCode | | +| IAisMessageType24Part1 | | | | | | VendorIdRev3 | | +| IAisMessageType24Part1 | | | | | | VendorIdRev4 | | +| IVesselName | | VesselName | | | | | | +| IAisMessageType27 | | | | | | | GnssPositionStatus | +| IAisMessageType27 | | | | | | | Position | +| IVesselNavigationStatus | NavigationStatus | | | | | | NavigationStatus |
The C# record types then implement the relevant interfaces, which enables simpler higher level programming constructs, such as Rx queries over an `IAisMessage` stream: diff --git a/Solutions/Ais.Net.Models.sln b/Solutions/Ais.Net.Models.sln index db585d4..476f7e4 100644 --- a/Solutions/Ais.Net.Models.sln +++ b/Solutions/Ais.Net.Models.sln @@ -7,6 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig ..\GitVersion.yml = ..\GitVersion.yml + ..\README.md = ..\README.md EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ais.Net.Models", "Ais.Net.Models\Ais.Net.Models.csproj", "{5B090F5E-28EA-4394-83DB-8C2764970FDC}" diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IAisMessageType1to3.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IAisMessageType1to3.cs index 4055595..7c98287 100644 --- a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IAisMessageType1to3.cs +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IAisMessageType1to3.cs @@ -8,8 +8,6 @@ public interface IAisMessageType1to3 { ManoeuvreIndicator ManoeuvreIndicator { get; } - NavigationStatus NavigationStatus { get; } - uint RadioSlotTimeout { get; } uint RadioSubMessage { get; } diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IAisMessageType27.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IAisMessageType27.cs new file mode 100644 index 0000000..efc086b --- /dev/null +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IAisMessageType27.cs @@ -0,0 +1,12 @@ +// +// Copyright (c) Endjin Limited. All rights reserved. +// + +namespace Ais.Net.Models.Abstractions; + +public interface IAisMessageType27 +{ + bool GnssPositionStatus { get; } + + Position? Position { get; } +} \ No newline at end of file diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselCourseOverGround.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselCourseOverGround.cs new file mode 100644 index 0000000..f3e5bf2 --- /dev/null +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselCourseOverGround.cs @@ -0,0 +1,10 @@ +// +// Copyright (c) Endjin Limited. All rights reserved. +// + +namespace Ais.Net.Models.Abstractions; + +public interface IVesselCourseOverGround +{ + float? CourseOverGround { get; } +} \ No newline at end of file diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselNavigation.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselNavigation.cs index e7315c3..4acc947 100644 --- a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselNavigation.cs +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselNavigation.cs @@ -4,16 +4,10 @@ namespace Ais.Net.Models.Abstractions; -public interface IVesselNavigation +public interface IVesselNavigation: IVesselPositionAccuracy, IVesselSpeedOverGround, IVesselCourseOverGround { - float? CourseOverGroundDegrees { get; } - Position? Position { get; } - bool PositionAccuracy { get; } - - float? SpeedOverGround { get; } - uint TimeStampSecond { get; } uint TrueHeadingDegrees { get; } diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselNavigationStatus.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselNavigationStatus.cs new file mode 100644 index 0000000..58558e7 --- /dev/null +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselNavigationStatus.cs @@ -0,0 +1,10 @@ +// +// Copyright (c) Endjin Limited. All rights reserved. +// + +namespace Ais.Net.Models.Abstractions; + +public interface IVesselNavigationStatus +{ + NavigationStatus NavigationStatus { get; } +} \ No newline at end of file diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselPositionAccuracy.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselPositionAccuracy.cs new file mode 100644 index 0000000..a47eb94 --- /dev/null +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselPositionAccuracy.cs @@ -0,0 +1,10 @@ +// +// Copyright (c) Endjin Limited. All rights reserved. +// + +namespace Ais.Net.Models.Abstractions; + +public interface IVesselPositionAccuracy +{ + bool PositionAccuracy { get; } +} \ No newline at end of file diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselSpeedOverGround.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselSpeedOverGround.cs new file mode 100644 index 0000000..66a4243 --- /dev/null +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/IVesselSpeedOverGround.cs @@ -0,0 +1,10 @@ +// +// Copyright (c) Endjin Limited. All rights reserved. +// + +namespace Ais.Net.Models.Abstractions; + +public interface IVesselSpeedOverGround +{ + float? SpeedOverGround { get; } +} \ No newline at end of file diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/Position.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/Position.cs index 64144b2..d692a41 100644 --- a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/Position.cs +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/Position.cs @@ -1,11 +1,14 @@ -// -// Copyright (c) Endjin Limited. All rights reserved. -// - -namespace Ais.Net.Models.Abstractions; - -public record Position(double Latitude, double Longitude) -{ - public static Position From10000thMins(int latitude, int longitude) => - new (latitude.From10000thMinsToDegrees(), longitude.From10000thMinsToDegrees()); +// +// Copyright (c) Endjin Limited. All rights reserved. +// + +namespace Ais.Net.Models.Abstractions; + +public record Position(double Latitude, double Longitude) +{ + public static Position From10000thMins(int latitude, int longitude) => + new (latitude.From10000thMinsToDegrees(), longitude.From10000thMinsToDegrees()); + + public static Position From10thMins(int latitude, int longitude) => + new(latitude.From10thMinsToDegrees(), longitude.From10thMinsToDegrees()); } \ No newline at end of file diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/ShipTypeGroup.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/ShipTypeGroup.cs index b86487e..1062b7b 100644 --- a/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/ShipTypeGroup.cs +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/Abstractions/ShipTypeGroup.cs @@ -14,7 +14,7 @@ public enum ShipTypeGroup Fishing, Towing, - TowingLengthOver200OmrBreadthOver25m, + TowingLengthOver200MOrBreadthOver25M, DredgingOrUnderwaterOps, DivingOps, MilitaryOps, diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageExtensions.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageExtensions.cs index 9f0f81d..212173f 100644 --- a/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageExtensions.cs +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageExtensions.cs @@ -15,6 +15,11 @@ public static double From10000thMinsToDegrees(this int value) return value / 600000.0; } + public static double From10thMinsToDegrees(this int value) + { + return value / 600.0; + } + public static float? FromTenths(this uint value) { return value == 1023 ? null : (value / 10.0f); @@ -59,7 +64,7 @@ public static ShipTypeCategory ToShipTypeCategory(this ShipTypeGroup shipTypeGro ShipTypeGroup.WingInGroundReserved => ShipTypeCategory.WingInGround, ShipTypeGroup.Fishing => ShipTypeCategory.SpecialCategory3, ShipTypeGroup.Towing => ShipTypeCategory.SpecialCategory3, - ShipTypeGroup.TowingLengthOver200OmrBreadthOver25m => ShipTypeCategory.SpecialCategory3, + ShipTypeGroup.TowingLengthOver200MOrBreadthOver25M => ShipTypeCategory.SpecialCategory3, ShipTypeGroup.DredgingOrUnderwaterOps => ShipTypeCategory.SpecialCategory3, ShipTypeGroup.DivingOps => ShipTypeCategory.SpecialCategory3, ShipTypeGroup.MilitaryOps => ShipTypeCategory.SpecialCategory3, @@ -204,7 +209,7 @@ public static ShipTypeGroup ToShipTypeGroup(this int shipType) case >= 25 and <= 29: return ShipTypeGroup.WingInGroundReserved; case 30: return ShipTypeGroup.Fishing; case 31: return ShipTypeGroup.Towing; - case 32: return ShipTypeGroup.TowingLengthOver200OmrBreadthOver25m; + case 32: return ShipTypeGroup.TowingLengthOver200MOrBreadthOver25M; case 33: return ShipTypeGroup.DredgingOrUnderwaterOps; case 34: return ShipTypeGroup.DivingOps; case 35: return ShipTypeGroup.MilitaryOps; diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType18.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType18.cs index 5fd9040..ccc70c7 100644 --- a/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType18.cs +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType18.cs @@ -9,7 +9,7 @@ namespace Ais.Net.Models; public record AisMessageType18( bool CanAcceptMessage22ChannelAssignment, bool CanSwitchBands, - float? CourseOverGroundDegrees, + float? CourseOverGround, ClassBUnit CsUnit, bool HasDisplay, bool IsAssigned, diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType19.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType19.cs index a6b1451..12884b7 100644 --- a/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType19.cs +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType19.cs @@ -7,7 +7,7 @@ namespace Ais.Net.Models; public record AisMessageType19( - float? CourseOverGroundDegrees, + float? CourseOverGround, uint DimensionToBow, uint DimensionToPort, uint DimensionToStarboard, diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType1Through3.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType1Through3.cs index 95b34cf..c945de3 100644 --- a/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType1Through3.cs +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType1Through3.cs @@ -7,7 +7,7 @@ namespace Ais.Net.Models; public record AisMessageType1Through3( - float? CourseOverGroundDegrees, + float? CourseOverGround, ManoeuvreIndicator ManoeuvreIndicator, int MessageType, uint Mmsi, @@ -28,4 +28,5 @@ public record AisMessageType1Through3( IAisMessageType1to3, IRaimFlag, IRepeatIndicator, - IVesselNavigation; \ No newline at end of file + IVesselNavigation, + IVesselNavigationStatus; \ No newline at end of file diff --git a/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType27.cs b/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType27.cs new file mode 100644 index 0000000..15076ff --- /dev/null +++ b/Solutions/Ais.Net.Models/Ais/Net/Models/AisMessageType27.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Endjin Limited. All rights reserved. +// + +using Ais.Net.Models.Abstractions; + +namespace Ais.Net.Models; + +public record AisMessageType27( + float? CourseOverGround, + bool GnssPositionStatus, + uint Mmsi, + NavigationStatus NavigationStatus, + Position? Position, + bool PositionAccuracy, + bool RaimFlag, + uint RepeatIndicator, + float? SpeedOverGround) : + AisMessageBase(MessageType: 27, Mmsi), + IAisMessageType27, + IRaimFlag, + IRepeatIndicator, + IVesselCourseOverGround, + IVesselNavigationStatus, + IVesselPositionAccuracy; \ No newline at end of file From dba4940f2ff4cd261299b747aedeb0091f25956e Mon Sep 17 00:00:00 2001 From: Howard van Rooijen Date: Wed, 9 Oct 2024 12:48:37 +0100 Subject: [PATCH 3/6] Refactor type names --- .gitignore | 1 + .../AisMessageType18StepDefinitions.cs | 4 ++-- .../Features/AisMessageType18.feature.cs | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index f27cf61..2b2c810 100644 --- a/.gitignore +++ b/.gitignore @@ -131,6 +131,7 @@ $tf/ _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user +*.DotSettings # TeamCity is a build add-in _TeamCity* diff --git a/Solutions/Ais.Net.Models.Specs/AisMessageType18StepDefinitions.cs b/Solutions/Ais.Net.Models.Specs/AisMessageType18StepDefinitions.cs index 5655845..aa37e8a 100644 --- a/Solutions/Ais.Net.Models.Specs/AisMessageType18StepDefinitions.cs +++ b/Solutions/Ais.Net.Models.Specs/AisMessageType18StepDefinitions.cs @@ -31,7 +31,7 @@ public void WhenTheAisMessageTypeIsCreated() this.sut = new AisMessageType18( CanAcceptMessage22ChannelAssignment: this.data.CanAcceptMessage22ChannelAssignment, CanSwitchBands: this.data.CanSwitchBands, - CourseOverGroundDegrees: this.data.CourseOverGroundDegrees, + CourseOverGround: this.data.CourseOverGroundDegrees, CsUnit: Enum.Parse(this.data.CsUnit), HasDisplay: this.data.HasDisplay, IsAssigned: this.data.IsAssigned, @@ -56,7 +56,7 @@ public void ThenThePropertiesShouldBeSetCorrectly() this.sut.ShouldNotBeNull(); this.sut.CanAcceptMessage22ChannelAssignment.ShouldBeTrue(); this.sut.CanSwitchBands.ShouldBeTrue(); - this.sut.CourseOverGroundDegrees.ShouldBe(123.45f); + this.sut.CourseOverGround.ShouldBe(123.45f); this.sut.CsUnit.ShouldBe(ClassBUnit.Cstdma); this.sut.HasDisplay.ShouldBeTrue(); this.sut.IsAssigned.ShouldBeTrue(); diff --git a/Solutions/Ais.Net.Models.Specs/Features/AisMessageType18.feature.cs b/Solutions/Ais.Net.Models.Specs/Features/AisMessageType18.feature.cs index ebb564a..aab3790 100644 --- a/Solutions/Ais.Net.Models.Specs/Features/AisMessageType18.feature.cs +++ b/Solutions/Ais.Net.Models.Specs/Features/AisMessageType18.feature.cs @@ -35,7 +35,7 @@ public partial class AisMessageType18Feature public virtual async System.Threading.Tasks.Task FeatureSetupAsync() { testRunner = global::Reqnroll.TestRunnerManager.GetTestRunnerForAssembly(); - global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "AisMessageType18", " A short summary of the feature", global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); + global::Reqnroll.FeatureInfo featureInfo = new global::Reqnroll.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Features", "AisMessageType18", null, global::Reqnroll.ProgrammingLanguage.CSharp, featureTags); await testRunner.OnFeatureStartAsync(featureInfo); } @@ -81,7 +81,7 @@ public async System.Threading.Tasks.Task CreateAisMessageType18Record() string[] tagsOfScenario = ((string[])(null)); System.Collections.Specialized.OrderedDictionary argumentsOfScenario = new System.Collections.Specialized.OrderedDictionary(); global::Reqnroll.ScenarioInfo scenarioInfo = new global::Reqnroll.ScenarioInfo("Create AisMessageType18 record", null, tagsOfScenario, argumentsOfScenario, featureTags); -#line 5 +#line 3 this.ScenarioInitialize(scenarioInfo); #line hidden if ((global::Reqnroll.TagHelper.ContainsIgnoreTag(scenarioInfo.CombinedTags) || global::Reqnroll.TagHelper.ContainsIgnoreTag(featureTags))) @@ -131,13 +131,13 @@ public async System.Threading.Tasks.Task CreateAisMessageType18Record() "12.34", "56", "78"}); -#line 6 +#line 4 await testRunner.GivenAsync("a new AisMessageType18 record with the following properties:", ((string)(null)), table1, "Given "); #line hidden -#line 9 +#line 7 await testRunner.WhenAsync("the AisMessageType is created", ((string)(null)), ((global::Reqnroll.Table)(null)), "When "); #line hidden -#line 10 +#line 8 await testRunner.ThenAsync("the properties should be set correctly", ((string)(null)), ((global::Reqnroll.Table)(null)), "Then "); #line hidden } From 1035a09001e75e2fc8992856f9b8ade704fbbc22 Mon Sep 17 00:00:00 2001 From: Howard van Rooijen Date: Wed, 9 Oct 2024 12:51:44 +0100 Subject: [PATCH 4/6] Update ignore files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2b2c810..86e77bd 100644 --- a/.gitignore +++ b/.gitignore @@ -402,3 +402,4 @@ FodyWeavers.xsd _codeCoverage/ _packages/ *.sbom.* +Solutions/Ais.Net.Models.sln.DotSettings From 1dc78637a6a521efc7192605a814d29f8503b38b Mon Sep 17 00:00:00 2001 From: Howard van Rooijen Date: Wed, 9 Oct 2024 12:52:08 +0100 Subject: [PATCH 5/6] Remove file --- Solutions/Ais.Net.Models.sln.DotSettings | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 Solutions/Ais.Net.Models.sln.DotSettings diff --git a/Solutions/Ais.Net.Models.sln.DotSettings b/Solutions/Ais.Net.Models.sln.DotSettings deleted file mode 100644 index d4da241..0000000 --- a/Solutions/Ais.Net.Models.sln.DotSettings +++ /dev/null @@ -1,3 +0,0 @@ - - True - True \ No newline at end of file From 0cf20739d09e7f03fca3c227a3ceb19e7d0c920d Mon Sep 17 00:00:00 2001 From: Howard van Rooijen Date: Wed, 9 Oct 2024 12:52:37 +0100 Subject: [PATCH 6/6] Remove ignore rule --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 86e77bd..8ee7fb9 100644 --- a/.gitignore +++ b/.gitignore @@ -401,5 +401,4 @@ FodyWeavers.xsd # Build outputs _codeCoverage/ _packages/ -*.sbom.* -Solutions/Ais.Net.Models.sln.DotSettings +*.sbom.* \ No newline at end of file