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 /// @brief DBT - Depth Below Transducer
16 /// $--DBT,x.x,f,x.x,M,x.x,F*hh<CR><LF>
21 /// 2. Depth feet unit
24 /// 4. Depth meters unit
27 /// 6. Depth Fathoms unit
30 /// In real-world sensors, sometimes not all three conversions are reported.
31 /// So you night see something like <tt>$SDDBT,,f,22.5,M,,F*cs</tt>
33 class dbt
: public sentence
35 friend class detail::factory
;
38 constexpr static sentence_id ID
= sentence_id::DBT
;
39 constexpr static const char * TAG
= "DBT";
42 dbt(const dbt
&) = default;
43 dbt
& operator=(const dbt
&) = default;
44 dbt(dbt
&&) = default;
45 dbt
& operator=(dbt
&&) = default;
48 dbt(talker talk
, fields::const_iterator first
, fields::const_iterator last
);
49 virtual void append_data_to(std::string
&) const override
;
52 utils::optional
<double> depth_feet_
; // water depth in feet
53 utils::optional
<unit::distance
> depth_feet_unit_
; // f:feet
54 utils::optional
<double> depth_meter_
; // water depth in meter
55 utils::optional
<unit::distance
> depth_meter_unit_
; // M:meter
56 utils::optional
<double> depth_fathom_
; // water depth in fathom
57 utils::optional
<unit::distance
> depth_fathom_unit_
; // F:fathom
60 decltype(depth_feet_
) get_depth_feet() const { return depth_feet_
; }
61 decltype(depth_feet_unit_
) get_depth_feet_unit() const { return depth_feet_unit_
; }
62 decltype(depth_meter_
) get_depth_meter() const { return depth_meter_
; }
63 decltype(depth_meter_unit_
) get_depth_meter_unit() const { return depth_meter_unit_
; }
64 decltype(depth_fathom_
) get_depth_fathom() const { return depth_fathom_
; }
65 decltype(depth_fathom_unit_
) get_depth_fathom_unit() const { return depth_fathom_unit_
; }
67 void set_depth_feet(double t
) noexcept
;
68 void set_depth_meter(double t
) noexcept
;
69 void set_depth_fathom(double t
) noexcept
;