1 #ifndef __MARNAV__NMEA__ZDL__HPP__
2 #define __MARNAV__NMEA__ZDL__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/nmea/time.hpp>
6 #include <marnav/utils/optional.hpp>
12 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(zdl
)
14 /// @brief ZDL - Time and Distance to Variable Point
19 /// $--ZDL,hhmmss.ss,x.x,a*hh<CR><LF>
23 /// 1. Time to Point, hh=00..99
24 /// 2. Distance to Point, nautical miles
25 /// 3. Type of Point, see below
29 /// - T = Turning Point
30 /// - R = Reference (general)
33 class zdl
: public sentence
35 MARNAV_NMEA_SENTENCE_FRIENDS(zdl
)
38 constexpr static const sentence_id ID
= sentence_id::ZDL
;
39 constexpr static const char * TAG
= "ZDL";
42 zdl(const zdl
&) = default;
43 zdl
& operator=(const zdl
&) = default;
44 zdl(zdl
&&) = default;
45 zdl
& operator=(zdl
&&) = default;
48 zdl(talker talk
, fields::const_iterator first
, fields::const_iterator last
);
49 virtual std::vector
<std::string
> get_data() const override
;
52 duration time_to_point
;
53 double distance
= 0.0;
54 type_of_point type_point
= type_of_point::reference
;
57 decltype(time_to_point
) get_time_to_point() const { return time_to_point
; }
58 decltype(distance
) get_distance() const { return distance
; }
59 decltype(type_point
) get_type_point() const { return type_point
; }
61 void set_time_to_point(const duration
& t
) noexcept
{ time_to_point
= t
; }
62 void set_distance(double t
) noexcept
{ distance
= t
; }
63 void set_type_point(type_of_point t
) noexcept
{ type_point
= t
; }