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 MARNAV_NMEA_DECLARE_SENTENCE_PARSE_FUNC(tpc
)
13 /// @brief TPC - Trawl Position Cartesian Coordinates
18 /// $--TPC,x,M,y,P,z.z,M*hh,<CR><LF>
22 /// 1. Horizontal distance from the vessel center line
23 /// 2. Unit of horizontal distance
25 /// 3. Horizontal distance from the transducer to the trawl along the vessel
26 /// center line. The value is normally positive assuming the trawl is located
27 /// behind the vessel.
28 /// 4. Unit of horizontal distance from transducer to the trawl
30 /// 5. Depth of the trawl below the surface
34 class tpc
: public sentence
36 MARNAV_NMEA_SENTENCE_FRIENDS(tpc
)
39 constexpr static const sentence_id ID
= sentence_id::TPC
;
40 constexpr static const char * TAG
= "TPC";
43 tpc(const tpc
&) = default;
44 tpc
& operator=(const tpc
&) = default;
45 tpc(tpc
&&) = default;
46 tpc
& operator=(tpc
&&) = default;
49 tpc(const std::string
& talker
, fields::const_iterator first
, fields::const_iterator last
);
50 virtual std::vector
<std::string
> get_data() const override
;
53 double distance_centerline
= 0.0;
54 unit::distance distance_centerline_unit
= unit::distance::meter
;
55 double distance_transducer
= 0.0;
56 unit::distance distance_transducer_unit
= unit::distance::meter
;
58 unit::distance depth_unit
= unit::distance::meter
;
61 decltype(distance_centerline
) get_distance_centerline() const
63 return distance_centerline
;
65 decltype(distance_centerline_unit
) get_distance_centerline_unit() const
67 return distance_centerline_unit
;
69 decltype(distance_transducer
) get_distance_transducer() const
71 return distance_transducer
;
73 decltype(distance_transducer_unit
) get_distance_transducer_unit() const
75 return distance_transducer_unit
;
77 decltype(depth
) get_depth() const { return depth
; }
78 decltype(depth_unit
) get_depth_unit() const { return depth_unit
; }
80 void set_distance_centerline(double t
) noexcept
82 distance_centerline
= t
;
83 distance_centerline_unit
= unit::distance::meter
;
85 void set_distance_transducer(double t
) noexcept
87 distance_transducer
= t
;
88 distance_centerline_unit
= unit::distance::meter
;
90 void set_depth(double t
) noexcept
93 distance_centerline_unit
= unit::distance::meter
;