AIS: smaller public interface for AIS messages regarding encoding.
[marnav.git] / src / marnav / nmea / gst.hpp
blob05486282569b203f7f5b07313eb16f10107e8d1a
1 #ifndef __NMEA__GST__HPP__
2 #define __NMEA__GST__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/nmea/time.hpp>
6 #include <marnav/utils/optional.hpp>
8 namespace marnav
10 namespace nmea
12 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(gst)
14 /// @brief GST - GPS Pseudorange Noise Statistics
15 ///
16 /// @code
17 /// 1 2 3 4 5 6 7 8
18 /// | | | | | | | |
19 /// $--GST,hhmmss.ss,x,x,x,x,x,x,x*hh<CR><LF>
20 /// @endcode
21 ///
22 /// Field Number:
23 /// 1. TC time of associated GGA fix
24 /// 2. Total RMS standard deviation of ranges inputs to the navigation solution
25 /// 3. Standard deviation (meters) of semi-major axis of error ellipse
26 /// 4. Standard deviation (meters) of semi-minor axis of error ellipse
27 /// 5. Orientation of semi-major axis of error ellipse (true north degrees)
28 /// 6. Standard deviation (meters) of latitude error
29 /// 7. Standard deviation (meters) of longitude error
30 /// 8. Standard deviation (meters) of altitude error
31 ///
32 class gst : public sentence
34 MARNAV_NMEA_SENTENCE_FRIENDS(gst)
36 public:
37 constexpr static const sentence_id ID = sentence_id::GST;
38 constexpr static const char * TAG = "GST";
40 virtual ~gst() {}
42 gst();
43 gst(const gst &) = default;
44 gst & operator=(const gst &) = default;
46 protected:
47 gst(const std::string & talker, fields::const_iterator first, fields::const_iterator last);
48 virtual std::vector<std::string> get_data() const override;
50 private:
51 nmea::time time_utc;
52 double total_rms = 0.0;
53 double dev_semi_major = 0.0;
54 double dev_semi_minor = 0.0;
55 double orientation = 0.0;
56 double dev_lat = 0.0;
57 double dev_lon = 0.0;
58 double dev_alt = 0.0;
60 public:
61 NMEA_GETTER(time_utc)
62 NMEA_GETTER(total_rms)
63 NMEA_GETTER(dev_semi_major)
64 NMEA_GETTER(dev_semi_minor)
65 NMEA_GETTER(orientation)
66 NMEA_GETTER(dev_lat)
67 NMEA_GETTER(dev_lon)
68 NMEA_GETTER(dev_alt)
70 void set_time_utc(const nmea::time & t) noexcept { time_utc = t; }
71 void set_total_rms(double t) noexcept { total_rms = t; }
72 void set_dev_semi_major(double t) noexcept { dev_semi_major = t; }
73 void set_dev_semi_minor(double t) noexcept { dev_semi_minor = t; }
74 void set_orientation(double t) noexcept { orientation = t; }
75 void set_dev_lat(double t) noexcept { dev_lat = t; }
76 void set_dev_lon(double t) noexcept { dev_lon = t; }
77 void set_dev_alt(double t) noexcept { dev_alt = t; }
82 #endif