General: code modernization using clang-tidy
[marnav.git] / include / marnav / nmea / gst.hpp
blobe83042f0c50227960814e9609a9c57f052741cc4
1 #ifndef MARNAV_NMEA_GST_HPP
2 #define MARNAV_NMEA_GST_HPP
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/nmea/time.hpp>
6 #include <marnav/units/units.hpp>
7 #include <optional>
9 namespace marnav::nmea
11 /// @brief GST - GPS Pseudorange Noise Statistics
12 ///
13 /// @code
14 /// 1 2 3 4 5 6 7 8
15 /// | | | | | | | |
16 /// $--GST,hhmmss.ss,x,x,x,x,x,x,x*hh<CR><LF>
17 /// @endcode
18 ///
19 /// Field Number:
20 /// 1. TC time of associated GGA fix
21 /// 2. Total RMS standard deviation of ranges inputs to the navigation solution
22 /// 3. Standard deviation (meters) of semi-major axis of error ellipse
23 /// 4. Standard deviation (meters) of semi-minor axis of error ellipse
24 /// 5. Orientation of semi-major axis of error ellipse (true north degrees)
25 /// 6. Standard deviation (meters) of latitude error
26 /// 7. Standard deviation (meters) of longitude error
27 /// 8. Standard deviation (meters) of altitude error
28 ///
29 class gst : public sentence
31 friend class detail::factory;
33 public:
34 constexpr static sentence_id ID = sentence_id::GST;
35 constexpr static const char * TAG = "GST";
37 gst();
38 gst(const gst &) = default;
39 gst & operator=(const gst &) = default;
40 gst(gst &&) = default;
41 gst & operator=(gst &&) = default;
43 protected:
44 gst(talker talk, fields::const_iterator first, fields::const_iterator last);
45 void append_data_to(std::string &, const version &) const override;
47 private:
48 nmea::time time_utc_;
49 double total_rms_ = 0.0;
50 units::meters dev_semi_major_;
51 units::meters dev_semi_minor_;
52 double orientation_ = 0.0;
53 units::meters dev_lat_;
54 units::meters dev_lon_;
55 units::meters dev_alt_;
57 public:
58 nmea::time get_time_utc() const { return time_utc_; }
59 double get_total_rms() const { return total_rms_; }
60 units::length get_dev_semi_major() const { return {dev_semi_major_}; }
61 units::length get_dev_semi_minor() const { return {dev_semi_minor_}; }
62 double get_orientation() const { return orientation_; }
63 units::length get_dev_lat() const { return {dev_lat_}; }
64 units::length get_dev_lon() const { return {dev_lon_}; }
65 units::length get_dev_alt() const { return {dev_alt_}; }
67 void set_time_utc(const nmea::time & t) noexcept { time_utc_ = t; }
68 void set_total_rms(double t) noexcept { total_rms_ = t; }
69 void set_dev_semi_major(units::length t) noexcept
71 dev_semi_major_ = t.get<units::meters>();
73 void set_dev_semi_minor(units::length t) noexcept
75 dev_semi_minor_ = t.get<units::meters>();
77 void set_orientation(double t) noexcept { orientation_ = t; }
78 void set_dev_lat(units::length t) noexcept { dev_lat_ = t.get<units::meters>(); }
79 void set_dev_lon(units::length t) noexcept { dev_lon_ = t.get<units::meters>(); }
80 void set_dev_alt(units::length t) noexcept { dev_alt_ = t.get<units::meters>(); }
84 #endif