1 #ifndef __MARNAV__NMEA__DBT__HPP__
2 #define __MARNAV__NMEA__DBT__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
11 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(dbt
)
13 /// @brief DBT - Depth Below Transducer
18 /// $--DBT,x.x,f,x.x,M,x.x,F*hh<CR><LF>
23 /// 2. Depth feet unit
26 /// 4. Depth meters unit
29 /// 6. Depth Fathoms unit
32 /// In real-world sensors, sometimes not all three conversions are reported.
33 /// So you night see something like <tt>$SDDBT,,f,22.5,M,,F*cs</tt>
35 class dbt
: public sentence
37 MARNAV_NMEA_SENTENCE_FRIENDS(dbt
)
40 constexpr static const sentence_id ID
= sentence_id::DBT
;
41 constexpr static const char * TAG
= "DBT";
44 dbt(const dbt
&) = default;
45 dbt
& operator=(const dbt
&) = default;
46 dbt(dbt
&&) = default;
47 dbt
& operator=(dbt
&&) = default;
50 dbt(talker talk
, fields::const_iterator first
, fields::const_iterator last
);
51 virtual std::vector
<std::string
> get_data() const override
;
54 utils::optional
<double> depth_feet
; // water depth in feet
55 utils::optional
<unit::distance
> depth_feet_unit
; // f:feet
56 utils::optional
<double> depth_meter
; // water depth in meter
57 utils::optional
<unit::distance
> depth_meter_unit
; // M:meter
58 utils::optional
<double> depth_fathom
; // water depth in fathom
59 utils::optional
<unit::distance
> depth_fathom_unit
; // F:fathom
62 decltype(depth_feet
) get_depth_feet() const { return depth_feet
; }
63 decltype(depth_feet_unit
) get_depth_feet_unit() const { return depth_feet_unit
; }
64 decltype(depth_meter
) get_depth_meter() const { return depth_meter
; }
65 decltype(depth_meter_unit
) get_depth_meter_unit() const { return depth_meter_unit
; }
66 decltype(depth_fathom
) get_depth_fathom() const { return depth_fathom
; }
67 decltype(depth_fathom_unit
) get_depth_fathom_unit() const { return depth_fathom_unit
; }
69 void set_depth_feet(double t
) noexcept
;
70 void set_depth_meter(double t
) noexcept
;
71 void set_depth_fathom(double t
) noexcept
;