1 #ifndef __MARNAV__NMEA__VHW__HPP__
2 #define __MARNAV__NMEA__VHW__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
11 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(vhw
)
13 /// @brief VHW - Water speed and heading
18 /// $--VHW,x.x,T,x.x,M,x.x,N,x.x,K*hh<CR><LF>
23 /// 2. Degress True reference
25 /// 3. Degrees Magnetic
26 /// 4. Degrees Magnetic reference
28 /// 5. Knots (speed of vessel relative to the water)
30 /// 7. Kilometers per hour (speed of vessel relative to the water)
31 /// 8. K = Kilometers per hour
33 class vhw
: public sentence
35 MARNAV_NMEA_SENTENCE_FRIENDS(vhw
)
38 constexpr static const sentence_id ID
= sentence_id::VHW
;
39 constexpr static const char * TAG
= "VHW";
42 vhw(const vhw
&) = default;
43 vhw
& operator=(const vhw
&) = default;
44 vhw(vhw
&&) = default;
45 vhw
& operator=(vhw
&&) = default;
48 vhw(talker talk
, fields::const_iterator first
, fields::const_iterator last
);
49 virtual std::vector
<std::string
> get_data() const override
;
52 utils::optional
<char> heading_empty
; // heading (empty)
53 utils::optional
<reference
> degrees_true
; // T:true
54 utils::optional
<double> heading
; // heading in degrees, 0..359
55 utils::optional
<reference
> degrees_mag
; // M:magnetic
56 utils::optional
<double> speed_knots
; // speed in knots
57 utils::optional
<unit::velocity
> speed_knots_unit
; // N:knots
58 utils::optional
<double> speed_kmh
; // speed in kilometers per hour
59 utils::optional
<unit::velocity
> speed_kmh_unit
; // K:kmh
62 decltype(heading_empty
) get_heading_empty() const { return heading_empty
; }
63 decltype(degrees_true
) get_degrees_true() const { return degrees_true
; }
64 decltype(heading
) get_heading() const { return heading
; }
65 decltype(degrees_mag
) get_degrees_mag() const { return degrees_mag
; }
66 decltype(speed_knots
) get_speed_knots() const { return speed_knots
; }
67 decltype(speed_knots_unit
) get_speed_knots_unit() const { return speed_knots_unit
; }
68 decltype(speed_kmh
) get_speed_kmh() const { return speed_kmh
; }
69 decltype(speed_kmh_unit
) get_speed_kmh_unit() const { return speed_kmh_unit
; }
71 void set_heading(double t
) noexcept
;
72 void set_speed_knots(double t
) noexcept
;
73 void set_speed_kmh(double t
) noexcept
;