pub struct Depth {
pub metres: f64,
pub reference: Sounding,
}Expand description
A sounding, and what it was measured from.
The reference travels with the number so that nothing downstream has to assume one. This is the same discipline a Raymarine, B&G or Garmin display keeps: the offset is stated once, the value is labelled, and an unconfigured installation reads out depth below the transducer rather than quietly claiming to be depth below the keel.
Fields§
§metres: f64Metres. Signal K is already metric here, so nothing is converted.
reference: SoundingWhat it is measured from.
Implementations§
Source§impl Depth
impl Depth
Sourcepub fn to(self, wanted: Sounding, offsets: Offsets) -> Option<Self>
pub fn to(self, wanted: Sounding, offsets: Offsets) -> Option<Self>
The same sounding measured from somewhere else, if the geometry to get there is known.
None when it is not, and that is the whole point of the type.
Guessing an offset – or worse, leaving it at zero and calling the
result depth below the keel – reports more water than there is,
by exactly the amount nobody stated. A depth display that does that
is wrong in the one direction it must never be wrong in.
A negative result is not an error and is not clamped: it means the keel is already in the bottom, which is worth showing.