24 explicit NotXTEException(
const std::string& context,
const std::string& details =
"") :
25 NmeaException(context,
"The sentence is not an XTE sentence", details) {}
57 XTE(std::string talkerId,
60 double crossTrackError,
63 std::optional<char> faaModeIndicator = std::nullopt
69 XTE& operator=(
XTE&&) noexcept = default;
71 ~
XTE() override = default;
111 bool operator==(const
XTE& other) const noexcept;
116 double crossTrackError_{};
117 char steerDirection_{};
118 char crossTrackUnits_{};
119 std::optional<char> faaModeIndicator_{};
123 XTE(Message0183 baseMessage,
126 double crossTrackError,
128 char crossTrackUnits,
129 std::optional<char> faaModeIndicator
132 static std::unique_ptr<XTE> create(std::unique_ptr<Message0183> baseMessage);
133 static std::string composeRaw(
const std::string& talkerId,
136 double crossTrackError,
138 char crossTrackUnits,
139 std::optional<char> faaModeIndicator);
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 XTE sentence.
NotXTEException(const std::string &context, const std::string &details="")
Construct a NotXTEException with context and optional details.
Represents a parsed NMEA 0183 XTE (Cross-Track Error, Measured) sentence.
char getStatus1() const noexcept
Get the first status field.
double getCrossTrackError() const noexcept
Get the cross-track error magnitude in nautical miles.
char getCrossTrackUnits() const noexcept
Get the cross-track units indicator (typically 'N').
std::optional< char > getFaaModeIndicator() const noexcept
Get optional FAA mode indicator.
std::unique_ptr< nmealib::Message > clone() const override
Create a polymorphic copy of this XTE message.
XTE(XTE &&) noexcept=default
XTE & operator=(const XTE &)=default
char getSteerDirection() const noexcept
Get the steer direction indicator ('L' or 'R').
char getStatus2() const noexcept
Get the second status field.
std::string getStringContent(bool verbose) const noexcept override
Return a human-readable string representation of this message.
bool hasFaaModeIndicator() const noexcept
Return whether FAA mode indicator is present.
XTE(std::string talkerId, char status1, char status2, double crossTrackError, char steerDirection, char crossTrackUnits, std::optional< char > faaModeIndicator=std::nullopt)
Construct an XTE message from individual field values.