1 #ifndef __NMEA__ZFO__HPP__
2 #define __NMEA__ZFO__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/nmea/time.hpp>
6 #include <marnav/nmea/waypoint.hpp>
7 #include <marnav/utils/optional.hpp>
13 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(zfo
)
15 /// @brief ZFO - UTC & Time from origin Waypoint
20 /// $--ZFO,hhmmss.ss,hhmmss.ss,c--c*hh<CR><LF>
24 /// 1. Universal Time Coordinated (UTC)
26 /// 3. Origin Waypoint ID
28 class zfo
: public sentence
30 MARNAV_NMEA_SENTENCE_FRIENDS(zfo
)
33 constexpr static const sentence_id ID
= sentence_id::ZFO
;
34 constexpr static const char * TAG
= "ZFO";
39 zfo(const zfo
&) = default;
40 zfo
& operator=(const zfo
&) = default;
43 zfo(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
<nmea::time
> time_utc
;
48 utils::optional
<nmea::duration
> time_elapsed
;
49 utils::optional
<waypoint
> waypoint_id
;
53 NMEA_GETTER(time_elapsed
)
54 NMEA_GETTER(waypoint_id
)
56 void set_time_utc(const nmea::time
& t
) noexcept
{ time_utc
= t
; }
57 void set_time_elapsed(const nmea::duration
& t
) noexcept
{ time_elapsed
= t
; }
58 void set_waypoint_id(const waypoint
& id
) { waypoint_id
= id
; }