NDEVR
API Documentation
NMEAParserQt.h
1#pragma once
2#include "Base/Headers/Time.h"
3#include "Base/Headers/TimeSpan.h"
4#include <QObject>
5#include "NMEAParserPacket.h"
6namespace NDEVR
7{
8 class Connection;
9 struct ConnectionInfo;
10 class InfoPipe;
11 class Scanner;
14 class CNMEAParserQt : public QObject, public NMEAReader
15 {
16 Q_OBJECT
17 public:
21 explicit CNMEAParserQt(InfoPipe* raw_data_log, QObject* parent = nullptr);
29 bool tryOpen();
31 void reset();
37 void update();
40 Connection* connection() { return m_connection; };
43 File file() const;
49 void setAutoConnect(bool auto_connect);
56 NMEAUpdateInfo& lastInfo() { return m_update_info; };
57
58 signals:
67 void onConnectionChangedSignal(bool connected);
68 public slots:
71
72 protected:
79 virtual NMEAUpdateInfo processRxCommand(const StringView& command, const StringView& data) override;
80
81 private:
82 Connection* m_connection = nullptr;
83 Scanner* m_nmea_scan = nullptr;
84 Time m_last_connection_attemt_time = Time(0);
85 TimeSpan m_gps_file_offset = Constant<TimeSpan>::Invalid;
86 bool m_auto_connect = false;
87 bool m_request_disconnect = false;
88 NMEAUpdateInfo m_update_info;
89
90 };
91}
void onRXReadySlot()
Slot called when data is available to read from the connection.
void positionUpdateSignal()
Emitted when a new position fix is parsed.
bool connectUsingFile(File file)
Connects using an NMEA file as input.
fltp08 filePercent() const
Returns the file read progress as a percentage (0.0 to 1.0).
void reset()
Resets the parser and connection state.
void readNMEAScan()
Reads NMEA data from the file scanner.
NMEAUpdateInfo & lastInfo()
Returns the most recent update info.
void update()
Processes pending data from the connection or file.
void satelliteUpdateSignal()
Emitted when satellite information is updated.
Connection * connection()
Returns the underlying connection object.
void setAutoConnect(bool auto_connect)
Sets whether the parser should auto-connect.
void onConnectionChangedSignal(bool connected)
Emitted when the connection state changes.
bool tryOpen()
Attempts to open the configured connection.
File file() const
Returns the file currently being read.
void requestClose()
Requests that the connection be closed.
virtual NMEAUpdateInfo processRxCommand(const StringView &command, const StringView &data) override
Processes a received NMEA command and emits appropriate signals.
void orientationUpdateSignal()
Emitted when orientation data is updated.
CNMEAParserQt(InfoPipe *raw_data_log, QObject *parent=nullptr)
Constructs the Qt NMEA parser.
void setConnection(ConnectionInfo connection)
Sets the connection parameters for the NMEA data source.
~CNMEAParserQt()
Destructor.
void closeNMEAReadFile()
Closes the current NMEA file reader.
A standard interface for all types of connections that allow transmitting and receiving of data betwe...
Definition Connection.h:316
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Definition File.h:53
A light-weight base class for Log that allows processes to update, without the need for additional in...
NMEAReader()
Constructs the NMEA reader.
Contains methods for easily reading objects in an ascii stream using set deliminators and line logic.
Definition Scanner.h:47
The core String View class for the NDEVR API.
Definition StringView.h:58
Stores a time span, or difference between two times, with an optional start time.
Definition TimeSpan.h:46
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:62
The primary namespace for the NDEVR SDK.
double fltp08
Defines an alias representing an 8 byte floating-point number.
A structure designed to store information about a specific Connection.
Definition Connection.h:90
Describes what was updated after processing an NMEA sentence, including which data categories changed...