1 #ifndef __NMEA__DBT__HPP__
2 #define __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";
46 dbt(const dbt
&) = default;
47 dbt
& operator=(const dbt
&) = default;
50 dbt(const std::string
& talker
, 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 MARNAV_NMEA_GETTER(depth_feet
)
63 MARNAV_NMEA_GETTER(depth_feet_unit
)
64 MARNAV_NMEA_GETTER(depth_meter
)
65 MARNAV_NMEA_GETTER(depth_meter_unit
)
66 MARNAV_NMEA_GETTER(depth_fathom
)
67 MARNAV_NMEA_GETTER(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
;