1 #ifndef __NMEA__DPT__HPP__
2 #define __NMEA__DPT__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
11 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(dpt
)
13 /// @brief DPT - Depth of Water
15 /// Water depth relative to the transducer and offset of the measuring transducer.
20 /// $--DPT,x.x,x.x,x.x*hh<CR><LF>
25 /// 2. Offset from transducer
26 /// - positive value means distance from tansducer to water line
27 /// - negative value means distance from transducer to keel
28 /// 3. Max depth in meters, might be empty. This field exists allegedly since NMEA 3.0
30 class dpt
: public sentence
32 MARNAV_NMEA_SENTENCE_FRIENDS(dpt
)
35 constexpr static const sentence_id ID
= sentence_id::DPT
;
36 constexpr static const char * TAG
= "DPT";
41 dpt(const std::string
& talker
);
42 dpt(const dpt
&) = default;
43 dpt
& operator=(const dpt
&) = default;
46 dpt(const std::string
& talker
, fields::const_iterator first
, fields::const_iterator last
);
47 virtual std::vector
<std::string
> get_data() const override
;
50 double depth_meter
= 0.0;
51 double transducer_offset
= 0.0;
52 utils::optional
<double> max_depth
;
55 NMEA_GETTER(depth_meter
)
56 NMEA_GETTER(transducer_offset
)
57 NMEA_GETTER(max_depth
)
59 void set_depth_meter(double t
) noexcept
{ depth_meter
= t
; }
60 void set_transducer_offset(double t
) noexcept
{ transducer_offset
= t
; }
61 void set_max_depth(double t
) noexcept
{ max_depth
= t
; }