AisManager Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Interpreter for AIS messages from NMEA-0183 data streams. Accepts the encoded AIVDM and AIVDO sentences and converts them to user-understandable ship structures.
public class AisManager : Iot.Device.Nmea0183.NmeaSinkAndSource
type AisManager = class
inherit NmeaSinkAndSource
Public Class AisManager
Inherits NmeaSinkAndSource
- Inheritance
Remarks
WARNING: Never rely on an AIS alarm as sole supervision of your surroundings! Many ships do not have AIS or the system may malfunction. Keep a lookout by eye and ear at all times!
Constructors
AisManager(String, Boolean, UInt32, String) |
Creates an instance of an AisManager |
AisManager(String, UInt32, String) |
Creates an instance of an AisManager |
Fields
CleanupLatency |
Controls how often lost targets are removed completely from the target list. The timespan after which a target is considered lost is controlled via TargetLostTimeout |
WarningRepeatTimeout |
Time between repeats of the same warning. If this is set to a short value, the same proximity warning will be shown very often, which is typically annoying. |
Properties
AutoSendWarnings |
True to have the component automatically generate warning broadcast messages (when in collision range, or when seeing something unexpected, such as an AIS-Sart target) |
DeleteTargetAfterTimeout |
If a target has not been updated for this time, it is deleted from the list of targets. Additionally, client software should consider targets as lost whose LastSeen value is older than a minute or so. A value of 0 or less means infinite. |
DimensionToBow |
Distance from GPS receiver to bow of own ship, see DimensionToBow |
DimensionToPort |
Distance from GPS receiver to Port of own ship, see DimensionToPort |
DimensionToStarboard |
Distance from GPS receiver to Starboard of own ship, see DimensionToStarboard |
DimensionToStern |
Distance from GPS receiver to stern of own ship, see DimensionToStern |
GeneratedSentencesId |
Which SentenceId generated AIS messages should get. Meaningful values are Iot.Device.Nmea0183.Ais.AisParser.VdmId or Iot.Device.Nmea0183.Ais.AisParser.VdoId. Default is "VDO" |
InterfaceName |
Name of the interface (Inherited from NmeaSinkAndSource) |
OwnMmsi |
The own MMSI |
OwnShipName |
The name of the own ship |
TrackEstimationParameters |
Set of parameters that control track estimation. |
Methods
ClearWarnings() |
Clears the list of suppressed warnings |
DispatchSentenceEvents(NmeaSentence) |
Forwards the given sentence to listeners, as needed. Use the current instance as source. (Inherited from NmeaSinkAndSource) |
DispatchSentenceEvents(NmeaSinkAndSource, NmeaSentence) |
Forwards the given sentence to listeners, as needed. (Inherited from NmeaSinkAndSource) |
Dispose() |
Standard dispose method (Inherited from NmeaSinkAndSource) |
Dispose(Boolean) |
Dispose this instance (Inherited from NmeaSinkAndSource) |
EnableAisAlarms(Boolean, TrackEstimationParameters) |
Enable automatic generation of AIS alarms. This method will start a background thread that regularly evaluates all ships in vicinity for possibly dangerous proximity. It uses an estimate of a track for each ship to find the closest point of approach (CPA) and the time to that closest point (TCPA). When this is enabled, RelativePosition will be regularly updated for all targets. |
FireOnParserError(String, NmeaError) |
Fire an event informing about parser errors (Inherited from NmeaSinkAndSource) |
GetOwnShipData(Ship) |
Gets the data of the own ship (including position and movement vectors) as a ship structure. |
GetOwnShipData(Ship, DateTimeOffset) |
Gets the data of the own ship (including position and movement vectors) as a ship structure. |
GetSpecificTargets<T>() |
Gets the list of all active targets of the given type |
GetTarget(UInt32) |
Gets the target with the given MMSI |
GetTargets() |
Gets the list of active targets |
SendBroadcastMessage(UInt32, String) |
Send an AIS broadcast message to the NMEA stream (output!) Some NMEA devices (in particular general-purpose displays) may pick up this information from the data stream and show the warning to the user. |
SendSentence(NmeaSentence) |
Send the given sentence to the interface. (Inherited from NmeaSinkAndSource) |
SendSentence(NmeaSinkAndSource, NmeaSentence) |
Processes incomming sequences. Use this method to input an NMEA stream to this component. Note that all messages should be forwarded to this method, as AIS target tracking requires the position and speed of our own vessel. |
SendSentences(IEnumerable<NmeaSentence>) |
Sends a list of messages at once (Inherited from NmeaSinkAndSource) |
SendShipPositionReport(AisTransceiverClass, Ship) |
Sends a ship position report for the given ship to the NMEA stream. Useful for testing or simulation. |
SendWarningMessage(String, UInt32, String) |
Sends a message with the given |
SendWarningMessage(String, UInt32, String, DateTimeOffset) |
Sends a message with the given |
StartDecode() |
Start receiving messages from this interface. An implementation should open streams, connect to sockets or create receiver threads, as appropriate. |
StopDecode() |
Stops sending or receiving messages from and to this interface. Any pending messages are discarded. |
TryGetTarget(UInt32, AisTarget) |
Tries to retrieve the target with the given MMSI from the database |
Events
OnMessage |
This event fires when a new message (individual or broadcast) is received and also when the AisManager generates own messages. |
OnNewPosition |
This is fired when a new position is available (Inherited from NmeaSinkAndSource) |
OnNewSequence |
This is fired on every new sentence (Inherited from NmeaSinkAndSource) |
OnNewTime |
This is fired when the time is updated (Inherited from NmeaSinkAndSource) |
OnParserError |
This is fired when a message couldn't be parsed (Inherited from NmeaSinkAndSource) |