22 explicit NotVHWException(
const std::string& context,
const std::string& details =
"") :
23 NmeaException(context,
"The sentence is not a VHW sentence", details) {}
50 VHW(std::string talkerId,
52 double headingMagnetic,
60 VHW& operator=(
VHW&&) noexcept = default;
62 ~
VHW() override = default;
104 bool operator==(const
VHW& other) const noexcept;
107 double headingTrue_{};
108 char headingTrueType_{};
109 double headingMagnetic_{};
110 char headingMagneticType_{};
111 double speedKnots_{};
112 char speedKnotsType_{};
114 char speedKphType_{};
118 VHW(Message0183 baseMessage,
120 char headingTrueType,
121 double headingMagnetic,
122 char headingMagneticType,
129 static std::unique_ptr<VHW> create(std::unique_ptr<Message0183> baseMessage);
130 static std::string composeRaw(
const std::string& talkerId,
132 double headingMagnetic,
Defines a base class for NMEA messages, encapsulating common properties and behaviors.
Base exception class for all NMEA library errors.
Represents an NMEA 0183 sentence.
Registry for message type creators.
Factory for creating typed NMEA 0183 message objects from raw sentence strings.
Exception thrown when a sentence is not a valid VHW sentence.
NotVHWException(const std::string &context, const std::string &details="")
Construct a NotVHWException with context and optional details.
Represents a parsed NMEA 0183 VHW (Water Speed and Heading) sentence.
std::unique_ptr< nmealib::Message > clone() const override
Create a polymorphic copy of this VHW message.
char getSpeedKphType() const noexcept
Get km/h unit indicator (typically 'K').
char getHeadingTrueType() const noexcept
Get true heading type indicator (typically 'T').
double getHeadingMagnetic() const noexcept
Get magnetic heading in degrees.
VHW & operator=(const VHW &)=default
VHW(VHW &&) noexcept=default
std::string getStringContent(bool verbose) const noexcept override
Return a human-readable string representation of this message.
double getHeadingTrue() const noexcept
Get true heading in degrees.
char getHeadingMagneticType() const noexcept
Get magnetic heading type indicator (typically 'M').
double getSpeedKph() const noexcept
Get speed through water in kilometers per hour.
double getSpeedKnots() const noexcept
Get speed through water in knots.
VHW(std::string talkerId, double headingTrue, double headingMagnetic, double speedKnots, double speedKph)
Construct a VHW message from individual field values.
char getSpeedKnotsType() const noexcept
Get knots unit indicator (typically 'N').