1 #ifndef __NMEA__BWW__HPP__
2 #define __NMEA__BWW__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(bww
)
14 /// @brief BWW - Bearing - Waypoint to Waypoint
19 /// $--BWW,x.x,T,x.x,M,c--c,c--c*hh<CR><LF>
23 /// 1. Bearing Degrees true
24 /// 2. Bearing Degrees true reference
26 /// 3. Bearing Degrees Magnetic
27 /// 4. Bearing Degrees Magnetic reference
30 /// 6. FROM Waypoint ID
32 class bww
: public sentence
34 MARNAV_NMEA_SENTENCE_FRIENDS(bww
)
37 constexpr static const sentence_id ID
= sentence_id::BWW
;
38 constexpr static const char * TAG
= "BWW";
43 bww(const bww
&) = default;
44 bww
& operator=(const bww
&) = default;
47 bww(const std::string
& talker
, fields::const_iterator first
, fields::const_iterator last
);
48 virtual std::vector
<std::string
> get_data() const override
;
51 utils::optional
<double> bearing_true
;
52 utils::optional
<reference
> bearing_true_ref
;
53 utils::optional
<double> bearing_mag
;
54 utils::optional
<reference
> bearing_mag_ref
;
55 utils::optional
<waypoint
> waypoint_to
;
56 utils::optional
<waypoint
> waypoint_from
;
59 NMEA_GETTER(bearing_true
)
60 NMEA_GETTER(bearing_true_ref
)
61 NMEA_GETTER(bearing_mag
)
62 NMEA_GETTER(bearing_mag_ref
)
63 NMEA_GETTER(waypoint_to
)
64 NMEA_GETTER(waypoint_from
)
66 void set_bearing_true(double t
) noexcept
;
67 void set_bearing_mag(double t
) noexcept
;
68 void set_waypoint_to(const waypoint
& id
) { waypoint_to
= id
; }
69 void set_waypoint_from(const waypoint
& id
) { waypoint_from
= id
; }