1 #ifndef MARNAV_NMEA_VPW_HPP
2 #define MARNAV_NMEA_VPW_HPP
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/units/units.hpp>
10 /// @brief VPW - Speed - Measured Parallel to Wind
15 /// $--VPW,x.x,N,x.x,M*hh<CR><LF>
20 /// 1. Speed knots, "-" means downwind
21 /// 2. Speed knots unit
23 /// 3. Speed meters per second, "-" means downwind
24 /// 4. Speed meters per second unit
25 /// - M = Meters per second
27 class vpw
: public sentence
29 friend class detail::factory
;
32 constexpr static sentence_id ID
= sentence_id::VPW
;
33 constexpr static const char * TAG
= "VPW";
36 vpw(const vpw
&) = default;
37 vpw
& operator=(const vpw
&) = default;
38 vpw(vpw
&&) = default;
39 vpw
& operator=(vpw
&&) = default;
42 vpw(talker talk
, fields::const_iterator first
, fields::const_iterator last
);
43 void append_data_to(std::string
&, const version
&) const override
;
46 std::optional
<units::knots
> speed_knots_
; // negative means downwind
47 std::optional
<units::meters_per_second
> speed_mps_
; // negative means downwind
50 std::optional
<units::knots
> get_speed_knots() const;
51 std::optional
<units::meters_per_second
> get_speed_meters_per_second() const;
53 void set_speed_knots(units::velocity t
) noexcept
;
54 void set_speed_mps(units::velocity t
) noexcept
;