1 #ifndef __MARNAV__NMEA__DPT__HPP__
2 #define __MARNAV__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";
39 dpt(const std::string
& talker
);
40 dpt(const dpt
&) = default;
41 dpt
& operator=(const dpt
&) = default;
42 dpt(dpt
&&) = default;
43 dpt
& operator=(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 decltype(depth_meter
) get_depth_meter() const noexcept
{ return depth_meter
; }
56 decltype(transducer_offset
) get_transducer_offset() const noexcept
58 return transducer_offset
;
60 decltype(max_depth
) get_max_depth() const noexcept
{ return max_depth
; }
62 void set_depth_meter(double t
) noexcept
{ depth_meter
= t
; }
63 void set_transducer_offset(double t
) noexcept
{ transducer_offset
= t
; }
64 void set_max_depth(double t
) noexcept
{ max_depth
= t
; }