NDEVR
API Documentation
MagnetometerWidget.h
1
#pragma once
2
#include <QWidget>
3
namespace
NDEVR
4
{
5
class
ProgressWidget
;
6
struct
PopupInfo
;
7
class
Button
;
8
class
QCustomLabel
;
9
class
OrientationSensor
;
10
class
QCustomLineEdit
;
11
17
class
MagnetometerWidget
:
public
QWidget
18
{
19
public
:
24
MagnetometerWidget
(QWidget* parent =
nullptr
);
29
void
setSensor
(
OrientationSensor
* sensor);
30
public
:
35
static
void
SetMagneticCalibrationCallback
(
const
std::function<
void
(
PopupInfo
info,
OrientationSensor
* sensor)>& function);
36
protected
:
40
void
init
();
41
protected
slots:
42
void
onUpdatedSlot
();
43
protected
:
44
static
std::function<void(
PopupInfo
info,
OrientationSensor
* sensor)>
s_magnetic_calibration_function
;
45
protected
:
46
Button
*
m_enable_button
=
nullptr
;
47
QCustomLabel
*
m_compass_label
=
nullptr
;
48
QCustomLineEdit
*
m_grid_compass_offset
=
nullptr
;
49
OrientationSensor
*
m_sensor
=
nullptr
;
50
ProgressWidget
*
m_intensity
=
nullptr
;
51
};
52
}
Button
A core widget that allows the user to click one of many button types.
Definition
Button.h:68
MagnetometerWidget::m_sensor
OrientationSensor * m_sensor
The orientation sensor providing magnetometer data.
Definition
MagnetometerWidget.h:49
MagnetometerWidget::SetMagneticCalibrationCallback
static void SetMagneticCalibrationCallback(const std::function< void(PopupInfo info, OrientationSensor *sensor)> &function)
Sets the global callback invoked when magnetic calibration is requested.
MagnetometerWidget::m_enable_button
Button * m_enable_button
Button to enable or disable the magnetometer.
Definition
MagnetometerWidget.h:46
MagnetometerWidget::m_compass_label
QCustomLabel * m_compass_label
Label displaying the current compass heading.
Definition
MagnetometerWidget.h:47
MagnetometerWidget::m_grid_compass_offset
QCustomLineEdit * m_grid_compass_offset
Line edit for the grid-to-compass offset angle.
Definition
MagnetometerWidget.h:48
MagnetometerWidget::s_magnetic_calibration_function
static std::function< void(PopupInfo info, OrientationSensor *sensor)> s_magnetic_calibration_function
Global callback for magnetic calibration requests.
Definition
MagnetometerWidget.h:44
MagnetometerWidget::m_intensity
ProgressWidget * m_intensity
Progress widget showing magnetic field intensity.
Definition
MagnetometerWidget.h:50
MagnetometerWidget::setSensor
void setSensor(OrientationSensor *sensor)
Sets the orientation sensor whose magnetometer data is displayed.
MagnetometerWidget::onUpdatedSlot
void onUpdatedSlot()
Slot called when the magnetometer data is updated.
MagnetometerWidget::MagnetometerWidget
MagnetometerWidget(QWidget *parent=nullptr)
Constructs a MagnetometerWidget.
MagnetometerWidget::init
void init()
Initializes the UI layout and child widgets.
OrientationSensor
Forward declaration for design object lookup service.
Definition
OrientationSensor.h:99
ProgressWidget
Displays the progress, either horizontally as a bar or as a round spin dial.
Definition
ProgressWidget.h:49
QCustomLabel
Displays translated text.
Definition
QCustomLabel.h:47
QCustomLineEdit
A line edit allows users to enter and edit a single line of plain text with useful editing functions,...
Definition
QCustomLineEdit.h:192
NDEVR
The primary namespace for the NDEVR SDK.
Definition
ArialTileFetcherModule.h:35
PopupInfo
Class which is used to pass arguments and requests for creating a popup dialog or widget.
Definition
PopupInfo.h:16
HardwareWidgets
Headers
MagnetometerWidget.h
NDEVR.org