1 #ifndef __MARNAV__NMEA__WPL__HPP__
2 #define __MARNAV__NMEA__WPL__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/nmea/angle.hpp>
6 #include <marnav/nmea/waypoint.hpp>
7 #include <marnav/utils/optional.hpp>
13 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(wpl
)
15 /// @brief WPL - Waypoint Location
20 /// $--WPL,llll.ll,a,yyyyy.yy,a,c--c*hh<CR><LF>
25 /// 2. Latitude hemisphere
29 /// 4. Longitude hemisphere
34 class wpl
: public sentence
36 MARNAV_NMEA_SENTENCE_FRIENDS(wpl
)
39 constexpr static const sentence_id ID
= sentence_id::WPL
;
40 constexpr static const char * TAG
= "WPL";
43 wpl(const wpl
&) = default;
44 wpl
& operator=(const wpl
&) = default;
45 wpl(wpl
&&) = default;
46 wpl
& operator=(wpl
&&) = default;
49 wpl(talker talk
, fields::const_iterator first
, fields::const_iterator last
);
50 virtual std::vector
<std::string
> get_data() const override
;
53 utils::optional
<geo::latitude
> lat
;
54 utils::optional
<direction
> lat_hem
; // latitude hemisphere (N or S)
55 utils::optional
<geo::longitude
> lon
;
56 utils::optional
<direction
> lon_hem
; // longitude hemisphere (E or W)
57 utils::optional
<waypoint
> waypoint_id
;
60 decltype(waypoint_id
) get_waypoint_id() const { return waypoint_id
; }
62 utils::optional
<geo::longitude
> get_longitude() const;
63 utils::optional
<geo::latitude
> get_latitude() const;
65 void set_lat(const geo::latitude
& t
);
66 void set_lon(const geo::longitude
& t
);
67 void set_waypoint(const waypoint
& id
) { waypoint_id
= id
; }