1 #ifndef MARNAV__NMEA__TPC__HPP
2 #define MARNAV__NMEA__TPC__HPP
4 #include <marnav/nmea/sentence.hpp>
5 #include <marnav/utils/optional.hpp>
11 /// @brief TPC - Trawl Position Cartesian Coordinates
16 /// $--TPC,x,M,y,P,z.z,M*hh,<CR><LF>
20 /// 1. Horizontal distance from the vessel center line
21 /// 2. Unit of horizontal distance
23 /// 3. Horizontal distance from the transducer to the trawl along the vessel
24 /// center line. The value is normally positive assuming the trawl is located
25 /// behind the vessel.
26 /// 4. Unit of horizontal distance from transducer to the trawl
28 /// 5. Depth of the trawl below the surface
32 class tpc
: public sentence
34 friend class detail::factory
;
37 constexpr static sentence_id ID
= sentence_id::TPC
;
38 constexpr static const char * TAG
= "TPC";
41 tpc(const tpc
&) = default;
42 tpc
& operator=(const tpc
&) = default;
43 tpc(tpc
&&) = default;
44 tpc
& operator=(tpc
&&) = default;
47 tpc(talker talk
, fields::const_iterator first
, fields::const_iterator last
);
48 virtual void append_data_to(std::string
&) const override
;
51 double distance_centerline_
= 0.0;
52 unit::distance distance_centerline_unit_
= unit::distance::meter
;
53 double distance_transducer_
= 0.0;
54 unit::distance distance_transducer_unit_
= unit::distance::meter
;
56 unit::distance depth_unit_
= unit::distance::meter
;
59 decltype(distance_centerline_
) get_distance_centerline() const
61 return distance_centerline_
;
63 decltype(distance_centerline_unit_
) get_distance_centerline_unit() const
65 return distance_centerline_unit_
;
67 decltype(distance_transducer_
) get_distance_transducer() const
69 return distance_transducer_
;
71 decltype(distance_transducer_unit_
) get_distance_transducer_unit() const
73 return distance_transducer_unit_
;
75 decltype(depth_
) get_depth() const { return depth_
; }
76 decltype(depth_unit_
) get_depth_unit() const { return depth_unit_
; }
78 void set_distance_centerline(double t
) noexcept
80 distance_centerline_
= t
;
81 distance_centerline_unit_
= unit::distance::meter
;
83 void set_distance_transducer(double t
) noexcept
85 distance_transducer_
= t
;
86 distance_centerline_unit_
= unit::distance::meter
;
88 void set_depth(double t
) noexcept
91 distance_centerline_unit_
= unit::distance::meter
;