1 #ifndef __MARNAV__NMEA__ZFO__HPP__
2 #define __MARNAV__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";
37 zfo(const zfo
&) = default;
38 zfo
& operator=(const zfo
&) = default;
39 zfo(zfo
&&) = default;
40 zfo
& operator=(zfo
&&) = default;
43 zfo(talker talk
, 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
;
52 decltype(time_utc
) get_time_utc() const { return time_utc
; }
53 decltype(time_elapsed
) get_time_elapsed() const { return time_elapsed
; }
54 decltype(waypoint_id
) get_waypoint_id() const { return 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
; }