AIS: smaller public interface for AIS messages regarding encoding.
[marnav.git] / src / marnav / nmea / its.hpp
blob2d5e73c7a0a4321ef12955d0dbd06511121142e6
1 #ifndef __NMEA__ITS__HPP__
2 #define __NMEA__ITS__HPP__
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
7 namespace marnav
9 namespace nmea
11 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(its)
13 /// @brief ITS - Trawl Door Spread 2 Distance
14 ///
15 /// @code
16 /// 1 2
17 /// | |
18 /// $--ITS,x.x,M*hh<CR><LF>
19 /// @endcode
20 ///
21 /// Field Number:
22 /// 1. Second spread distance
23 /// 2. Unit of distance
24 /// - M = Meters
25 ///
26 class its : public sentence
28 MARNAV_NMEA_SENTENCE_FRIENDS(its)
30 public:
31 constexpr static const sentence_id ID = sentence_id::ITS;
32 constexpr static const char * TAG = "ITS";
34 virtual ~its() {}
36 its();
37 its(const its &) = default;
38 its & operator=(const its &) = default;
40 protected:
41 its(const std::string & talker, fields::const_iterator first, fields::const_iterator last);
42 virtual std::vector<std::string> get_data() const override;
44 private:
45 double distance = 0.0;
46 unit::distance distance_unit = unit::distance::meter;
48 public:
49 NMEA_GETTER(distance)
50 NMEA_GETTER(distance_unit)
52 void set_distance(double t) noexcept
54 distance = t;
55 distance_unit = unit::distance::meter;
61 #endif