NDEVR
API Documentation
MagnetometerWidget

Widget for displaying the live state of a magnetometer object. More...

Collaboration diagram for MagnetometerWidget:
[legend]

Public Member Functions

 MagnetometerWidget (QWidget *parent=nullptr)
 Constructs a MagnetometerWidget.
void setSensor (OrientationSensor *sensor)
 Sets the orientation sensor whose magnetometer data is displayed.

Static Public Member Functions

static void SetMagneticCalibrationCallback (const std::function< void(PopupInfo info, OrientationSensor *sensor)> &function)
 Sets the global callback invoked when magnetic calibration is requested.

Protected Member Functions

void init ()
 Initializes the UI layout and child widgets.
void onUpdatedSlot ()
 Slot called when the magnetometer data is updated.

Protected Attributes

QCustomLabelm_compass_label = nullptr
 Label displaying the current compass heading.
Buttonm_enable_button = nullptr
 Button to enable or disable the magnetometer.
QCustomLineEditm_grid_compass_offset = nullptr
 Line edit for the grid-to-compass offset angle.
ProgressWidgetm_intensity = nullptr
 Progress widget showing magnetic field intensity.
OrientationSensorm_sensor = nullptr
 The orientation sensor providing magnetometer data.

Static Protected Attributes

static std::function< void(PopupInfo info, OrientationSensor *sensor)> s_magnetic_calibration_function
 Global callback for magnetic calibration requests.

Detailed Description

Widget for displaying the live state of a magnetometer object.


Definition at line 17 of file MagnetometerWidget.h.

Constructor & Destructor Documentation

◆ MagnetometerWidget()

MagnetometerWidget::MagnetometerWidget ( QWidget * parent = nullptr)

Constructs a MagnetometerWidget.

Parameters
[in]parentThe parent widget.

Member Function Documentation

◆ SetMagneticCalibrationCallback()

void MagnetometerWidget::SetMagneticCalibrationCallback ( const std::function< void(PopupInfo info, OrientationSensor *sensor)> & function)
static

Sets the global callback invoked when magnetic calibration is requested.

Parameters
[in]functionThe callback function accepting PopupInfo and OrientationSensor pointer.

◆ setSensor()

void MagnetometerWidget::setSensor ( OrientationSensor * sensor)

Sets the orientation sensor whose magnetometer data is displayed.

Parameters
[in]sensorThe OrientationSensor to monitor.

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