1 #ifndef __NMEA__WCV__HPP__
2 #define __NMEA__WCV__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/nmea/waypoint.hpp>
6 #include <marnav/utils/optional.hpp>
12 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(wcv
)
14 /// @brief WCV - Waypoint Closure Velocity
19 /// $--WCV,x.x,N,c--c*hh<CR><LF>
28 class wcv
: public sentence
30 MARNAV_NMEA_SENTENCE_FRIENDS(wcv
)
33 constexpr static const sentence_id ID
= sentence_id::WCV
;
34 constexpr static const char * TAG
= "WCV";
39 wcv(const wcv
&) = default;
40 wcv
& operator=(const wcv
&) = default;
43 wcv(const std::string
& talker
, fields::const_iterator first
, fields::const_iterator last
);
44 virtual std::vector
<std::string
> get_data() const override
;
47 utils::optional
<double> speed
;
48 utils::optional
<unit::velocity
> speed_unit
;
49 utils::optional
<waypoint
> waypoint_id
;
52 MARNAV_NMEA_GETTER(speed
)
53 MARNAV_NMEA_GETTER(speed_unit
)
54 MARNAV_NMEA_GETTER(waypoint_id
)
56 void set_speed(double t
) noexcept
;
57 void set_waypoint(const waypoint
& id
) { waypoint_id
= id
; }