NDEVR
API Documentation
CNMEAParserQt

A Qt-integrated NMEA parser that reads data from serial connections or files and emits signals when position, satellite, or orientation data changes. More...

Inheritance diagram for CNMEAParserQt:
[legend]
Collaboration diagram for CNMEAParserQt:
[legend]

Public Member Functions

 CNMEAParserQt (InfoPipe *raw_data_log, QObject *parent=nullptr)
 Constructs the Qt NMEA parser.
 ~CNMEAParserQt ()
 Destructor.
void closeNMEAReadFile ()
 Closes the current NMEA file reader.
Connectionconnection ()
 Returns the underlying connection object.
bool connectUsingFile (File file)
 Connects using an NMEA file as input.
File file () const
 Returns the file currently being read.
fltp08 filePercent () const
 Returns the file read progress as a percentage (0.0 to 1.0).
NMEAUpdateInfolastInfo ()
 Returns the most recent update info.
void onConnectionChangedSignal (bool connected)
 Emitted when the connection state changes.
void onRXReadySlot ()
 Slot called when data is available to read from the connection.
void orientationUpdateSignal ()
 Emitted when orientation data is updated.
void positionUpdateSignal ()
 Emitted when a new position fix is parsed.
void requestClose ()
 Requests that the connection be closed.
void reset ()
 Resets the parser and connection state.
void satelliteUpdateSignal ()
 Emitted when satellite information is updated.
void setAutoConnect (bool auto_connect)
 Sets whether the parser should auto-connect.
void setConnection (ConnectionInfo connection)
 Sets the connection parameters for the NMEA data source.
bool tryOpen ()
 Attempts to open the configured connection.
void update ()
 Processes pending data from the connection or file.
Public Member Functions inherited from NMEAReader
 NMEAReader ()
 Constructs the NMEA reader.
 ~NMEAReader ()
 Destructor.
Buffer< StringViewactiveSentenceTypes () const
 Returns the list of sentence types that have active readers.
void addSentenceReader (const StringView &string, NMEASentenceReader *reader)
 Registers a sentence reader for a specific sentence type.
void addSentenceReader (NMEASentenceReader *reader)
 Registers a sentence reader and auto-maps its supported sentence types.
const NMEAInfoinfo () const
 Returns the current accumulated NMEA info.
NMEAUpdateInfo processNMEABuffer (const StringView &data)
 Processes a buffer of raw NMEA data, extracting and processing complete sentences.
const Buffer< NMEASentenceReader * > & readers () const
 Returns the registered sentence readers.
void reset ()
 Resets the parser state machine to its initial state.

Protected Member Functions

virtual NMEAUpdateInfo processRxCommand (const StringView &command, const StringView &data) override
 Processes a received NMEA command and emits appropriate signals.
void readNMEAScan ()
 Reads NMEA data from the file scanner.

Additional Inherited Members

Protected Attributes inherited from NMEAReader
NMEAInfo m_info
 Accumulated NMEA data.

Detailed Description

A Qt-integrated NMEA parser that reads data from serial connections or files and emits signals when position, satellite, or orientation data changes.

Definition at line 14 of file NMEAParserQt.h.

Constructor & Destructor Documentation

◆ CNMEAParserQt()

CNMEAParserQt::CNMEAParserQt ( InfoPipe * raw_data_log,
QObject * parent = nullptr )
explicit

Constructs the Qt NMEA parser.

Parameters
[in]raw_data_logThe info pipe for logging raw NMEA data.
[in]parentOptional parent QObject.

Member Function Documentation

◆ connection()

Connection * CNMEAParserQt::connection ( )
inline

Returns the underlying connection object.

Returns
Pointer to the connection.

Definition at line 40 of file NMEAParserQt.h.

Referenced by setConnection().

◆ connectUsingFile()

bool CNMEAParserQt::connectUsingFile ( File file)

Connects using an NMEA file as input.

Parameters
[in]fileThe NMEA file to read.
Returns
True if the file was opened successfully.

References file().

◆ file()

File CNMEAParserQt::file ( ) const

Returns the file currently being read.

Returns
The active file.

Referenced by connectUsingFile().

◆ filePercent()

fltp08 CNMEAParserQt::filePercent ( ) const

Returns the file read progress as a percentage (0.0 to 1.0).

Returns
The file read progress.

◆ lastInfo()

NMEAUpdateInfo & CNMEAParserQt::lastInfo ( )
inline

Returns the most recent update info.

Returns
Reference to the last update info.

Definition at line 56 of file NMEAParserQt.h.

◆ onConnectionChangedSignal()

void CNMEAParserQt::onConnectionChangedSignal ( bool connected)

Emitted when the connection state changes.

Parameters
[in]connectedWhether the connection is now active.

◆ processRxCommand()

virtual NMEAUpdateInfo CNMEAParserQt::processRxCommand ( const StringView & command,
const StringView & data )
overrideprotectedvirtual

Processes a received NMEA command and emits appropriate signals.

Parameters
[in]commandThe NMEA command type.
[in]dataThe command data payload.
Returns
Update information describing what changed.

Reimplemented from NMEAReader.

◆ setAutoConnect()

void CNMEAParserQt::setAutoConnect ( bool auto_connect)

Sets whether the parser should auto-connect.

Parameters
[in]auto_connectTrue to enable auto-connect.

◆ setConnection()

void CNMEAParserQt::setConnection ( ConnectionInfo connection)

Sets the connection parameters for the NMEA data source.

Parameters
[in]connectionThe connection info to use.

References connection().

◆ tryOpen()

bool CNMEAParserQt::tryOpen ( )

Attempts to open the configured connection.

Returns
True if the connection was opened successfully.

The documentation for this class was generated from the following file: