1 #ifndef __NMEA__TPT__HPP__
2 #define __NMEA__TPT__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
11 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(tpt
)
13 /// @brief TPT - Trawl Position True
18 /// $--TPT,x,M,y,P,z.z,M*hh,<CR><LF>
22 /// 1. Horizontal range relative to target in meters (0..4000)
23 /// 2. Unit of horizontal range
25 /// 3. True bearing to taget (ie. relative north). Resolution is one degree.
27 /// 5. Depth of trawl below the surface in meters (0..2000)
31 class tpt
: public sentence
33 MARNAV_NMEA_SENTENCE_FRIENDS(tpt
)
36 constexpr static const sentence_id ID
= sentence_id::TPT
;
37 constexpr static const char * TAG
= "TPT";
42 tpt(const tpt
&) = default;
43 tpt
& operator=(const tpt
&) = default;
46 tpt(const std::string
& talker
, fields::const_iterator first
, fields::const_iterator last
);
47 virtual std::vector
<std::string
> get_data() const override
;
51 unit::distance range_unit
= unit::distance::meter
;
54 unit::distance depth_unit
= unit::distance::meter
;
58 NMEA_GETTER(range_unit
)
61 NMEA_GETTER(depth_unit
)
63 void set_range(double t
) noexcept
66 range_unit
= unit::distance::meter
;
68 void set_bearing(double t
) noexcept
{ bearing
= t
; }
69 void set_depth(double t
) noexcept
72 range_unit
= unit::distance::meter
;