SentenceCache Class

Definition

Caches the last sentence(s) of each type for later retrieval. This is a helper class for AutopilotController and PositionProvider. Use PositionProvider to query the position from the most appropriate messages.

public sealed class SentenceCache : IDisposable
type SentenceCache = class
    interface IDisposable
Public NotInheritable Class SentenceCache
Implements IDisposable
Inheritance
SentenceCache
Implements

Constructors

SentenceCache(NmeaSinkAndSource)

Creates an new cache using the given source

Properties

StoreRawSentences

True to (also) store raw sentences. Otherwise only recognized decoded sentences are stored. Defaults to false.

Methods

Add(NmeaSentence)

Adds the given sentence to the cache - if manual filling is preferred

Clear()

Clears the cache

Dispose()

Clean up everything

GetLastSentence(SentenceId)

Gets the last sentence of the given type. Does not return sentences that are part of a group (i.e. GSV, RTE)

GetLastSentence(SentenceId, TimeSpan)

Gets the last sentence of the given type. Does not return sentences that are part of a group (i.e. GSV, RTE)

GetLastSentence(String, SentenceId)

Gets the last sentence with the given id from the given talker.

GetSatellitesInView(Int32)

Returns the list of satellites in view

QueryActiveRouteSentences(List<RoutePart>)

Returns the last RTE sentences received, to construct the active route. A set of at most 100 elements is returned, with the newest entry first.

QuerySatellitesInView(List<SatellitesInView>)

Returns a list of recently received SatellitesInView (GSV) messages.

TryGetCurrentPosition(GeographicPosition, Angle, Speed, Nullable<Angle>)

Get the current position from the latest message containing any of the relevant data parts. This does not extrapolate the position if the last received message is old

TryGetCurrentPosition(GeographicPosition, Boolean, Angle, Speed, Nullable<Angle>)

Get the current position from the latest message containing any of the relevant data parts. If extrapolate is true, the speed and direction are used to extrapolate the position (many older GNSS receivers only deliver the position at 1Hz or less)

TryGetCurrentRoute(List<RoutePoint>)

Returns the current route

TryGetLastDinSentence<T>(Int32, T)

Tries to get a DIN sentence type

TryGetLastSentence<T>(SentenceId, T)

Tries to get a sentence of the given type

TryGetTransducerData(String, TransducerDataSet)

Gets the last transducer data set (from an XDR sentence, see TransducerMeasurement) if one with the given name exists.

TryGetWayPoint(String, Waypoint)

Queries the waypoint with the given name

Applies to