Skip to main content

Crate navcore_fix

Crate navcore_fix 

Source
Expand description

Own-ship state: assembling and ranking it.

Three parts, in the order a fix passes through them.

FixBuilder accumulates readings – a position, then a course – and reports when enough have arrived to form a complete VesselState. It does not track where a reading came from: a Signal K delta, an NMEA 0183 sentence and a recorded passage are all handled identically, which keeps this logic independent of any one protocol.

Sources ranks multiple candidate positions – for example a networked instrument against a local GPS receiver – and treats a value that has stopped arriving as no longer current. See its own module doc for the ranking rules.

VesselState is what a client renders: a position, a course predictor, and a heading line when a compass is available. The geometry is computed once here rather than by each client.

Simulator produces a synthetic VesselState for a client to render before a real data source is available.

§Polar accumulation is out of scope

signalk-polar-builder, a Signal K server plugin, publishes a vessel’s performance polar under performance.activePolarData, the same path a client reads for an imported polar (see signalk::polar). A client-side accumulator duplicating that would be a second, unsynced answer to the same question that resets on restart, so this crate does not implement one.

Structs§

Fix
A value, with everything needed to judge it.
FixBuilder
A VesselState under construction, built up one reading at a time.
SimulatedWind
A plausible wind, for a simulated run with no boat to have a real one.
Simulator
Moves a vessel over the ground, producing a state to render before a real position source is available.
Sources
Several sources for one kind of value.
VesselState
What a client knows about own ship at one instant.

Enums§

Freshness
Whether a reading is still worth acting on.

Functions§

format_latitude
Formats a latitude as degrees and decimal minutes, the conventional format in marine navigation (charts, almanacs, radio position reports), rather than the decimal degrees used internally.
format_longitude
Formats a longitude, three-digit degrees as is conventional.
simulated_wind
A plausible wind for a simulated run, for features built on wind data (laylines, a wind readout) to have something to display before a real wind source exists.