NDEVR
API Documentation
GPSDialog.h
1#pragma once
2#include "DLLInfo.h"
3#include "GPSInterface/Headers/GPSSensor.h"
4#include <QWidget>
5#include <QTabWidget>
6namespace Ui {
7 class GPSDialogUI;
8}
9namespace NDEVR
10{
12 class BluetoothConnectionDialog;
13 class QTModelManager;
14 struct PopupInfo;
15 class Button;
16 class QCustomLabel;
18 class CSignalQuality;
20 class CAzimuthElevationWnd;
21 class ConnectionDialog;
25 {
27 std::function<void()> on_selected;
28 };
29
31 class GPS_INTERFACE_API GPSDialog : public QWidget
32 {
33 Q_OBJECT
34 public:
38 explicit GPSDialog(GPSSensor* sensor, QWidget* parent = nullptr);
46 QSize sizeHint() const override;
49 void setGPSSensor(GPSSensor* sensor);
52 void addTab(QWidget* tab);
55 virtual void showEvent(QShowEvent* event) override;
58 virtual void hideEvent(QHideEvent* event) override;
62 virtual bool event(QEvent* event) override;
65 void paintEvent(QPaintEvent*) override;
68 void showAcceptButton(bool show_accept);
72 protected:
78 void setAutoConnect(bool autoconnect);
84 signals:
89 private slots:
91 void onPositionSensorUpdated();
93 void onOrientationSensorUpdated();
95 void updateDialogConnectionSlot();
97 void satelliteInfoChangedSlot();
98 private:
101 void showFileChooser(PopupInfo info);
103 void init();
104 protected:
105 GPSSensor* m_sensor = nullptr;
107 InfoPipe* m_log = nullptr;
108 Ui::GPSDialogUI* ui = nullptr;
114 QPixmap m_background;
115 };
116}
The equivelent of std::vector but with a bit more control.
Definition Buffer.hpp:58
A core widget that allows the user to click one of many button types.
Definition Button.h:68
A bar chart widget that displays per-satellite signal quality (SNR) with animated transitions and con...
Used to, given a Connection, generate an appropriate ConnectionDialog to allow adjustment of paramete...
A virtual dialog that provides an interface that allows the user to adjust certain parameters for a C...
The root class that manages a series of SectionContent that can share the same space or lay out in va...
A dialog that allows the user to set a Coordinate projection for the current project.
A hash-based key-value store, useful for quick associative lookups.
Definition Dictionary.h:64
A dialog designed to allow the user to navigate a filesytem and select or create one or more files or...
Buffer< ConnectionDialogFactory * > m_connection_dialog_factories
Factories for creating connection dialogs.
Definition GPSDialog.h:111
FileChooserDialog * m_file_chooser_dialog
File chooser for GPS file selection.
Definition GPSDialog.h:106
GPSSensor * gps()
Returns the GPS sensor being configured.
ContainerWidgetBase * mainContainer() const
Returns the main container widget of this dialog.
void disconnectGNSS()
Disconnects the current GNSS connection.
void addTab(QWidget *tab)
Adds a tab widget to the dialog's tab bar.
void showAcceptButton(bool show_accept)
Shows or hides the accept button at the bottom of the dialog.
void setGPSSensor(GPSSensor *sensor)
Sets the GPS sensor for this dialog.
Ui::GPSDialogUI * ui
The auto-generated UI form.
Definition GPSDialog.h:108
void setAutoConnect(bool autoconnect)
Sets whether the GPS should auto-connect on startup.
virtual void showEvent(QShowEvent *event) override
Handles the dialog show event.
Buffer< Button * > m_connection_buttons
Buttons for each connection type.
Definition GPSDialog.h:110
~GPSDialog()
Destructor.
GPSDialog(GPSSensor *sensor, QWidget *parent=nullptr)
Constructs the GPS dialog for the given sensor.
virtual void hideEvent(QHideEvent *event) override
Handles the dialog hide event.
QSize sizeHint() const override
Returns the preferred size for this dialog.
void paintEvent(QPaintEvent *) override
Paints the dialog background.
virtual bool event(QEvent *event) override
Handles generic events for the dialog.
void addConfigCallback(GNSSConfigCallback *callback)
Adds a configuration callback option to the dialog.
InfoPipe * m_log
Log for status messages.
Definition GPSDialog.h:107
Buffer< GNSSConfigCallback * > m_config_callbacks
Registered configuration callbacks.
Definition GPSDialog.h:113
void newGPSSignal()
Emitted when a new GPS sensor is chosen.
void setConnectionInfo(ConnectionInfo info)
Sets the connection info for the GPS sensor.
QPixmap m_background
Background image for the dialog.
Definition GPSDialog.h:114
Buffer< ConnectionDialog * > m_connection_dialogs
Active connection dialog instances.
Definition GPSDialog.h:112
void acceptedSignal()
Emitted when the user accepts the dialog.
Dictionary< String, QCustomLabel * > m_stream_speed_widgets
Labels showing stream speed per connection.
Definition GPSDialog.h:109
GPSSensor * m_sensor
The GPS sensor being configured.
Definition GPSDialog.h:105
A GPS sensor implementation that receives NMEA data from serial connections, files,...
Definition GPSSensor.h:61
A light-weight base class for Log that allows processes to update, without the need for additional in...
Displays translated text.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
A ConnectionDialog that allows the user to modify a Serial port connection.
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
The primary namespace for the NDEVR SDK.
A structure designed to store information about a specific Connection.
Definition Connection.h:90
Callback descriptor for GNSS configuration options displayed in the GPS dialog.
Definition GPSDialog.h:25
std::function< void()> on_selected
Function invoked when the option is selected.
Definition GPSDialog.h:27
TranslatedString title
The display title for the configuration option.
Definition GPSDialog.h:26
Class which is used to pass arguments and requests for creating a popup dialog or widget.
Definition PopupInfo.h:16