1 #ifndef __MARNAV__NMEA__WCV__HPP__
2 #define __MARNAV__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";
37 wcv(const wcv
&) = default;
38 wcv
& operator=(const wcv
&) = default;
39 wcv(wcv
&&) = default;
40 wcv
& operator=(wcv
&&) = default;
43 wcv(talker talk
, 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 decltype(speed
) get_speed() const { return speed
; }
53 decltype(speed_unit
) get_speed_unit() const { return speed_unit
; }
54 decltype(waypoint_id
) get_waypoint_id() const { return waypoint_id
; }
56 void set_speed(double t
) noexcept
;
57 void set_waypoint(const waypoint
& id
) { waypoint_id
= id
; }