QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
SensorsComponentController Class Reference

Sensors Component MVC Controller for SensorsComponent.qml. More...

#include <SensorsComponentController.h>

Inheritance diagram for SensorsComponentController:
Collaboration diagram for SensorsComponentController:

Public Types

enum  SideCalState { SideCalStateIdle , SideCalStateIncomplete , SideCalStateInProgress , SideCalStateCompleted }
enum  ActiveCalibration {
  ActiveCalibrationNone , ActiveCalibrationCompass , ActiveCalibrationGyro , ActiveCalibrationAccel ,
  ActiveCalibrationLevel , ActiveCalibrationAirspeed , ActiveCalibrationBaro
}
 Calibration which is running through the firmware's [cal] message protocol. More...
enum  CalibrationResult { CalibrationResultNone , CalibrationResultSuccess , CalibrationResultFailed }
 How the last calibration which the page shows in its panel ended. More...
enum class  LargeVehicleCalibrationResult { Pending , Succeeded , Failed }

Signals

void showGyroCalAreaChanged (void)
void showOrientationCalAreaChanged (void)
void orientationCalSidesStateChanged (void)
void orientationCalSidesVisibleChanged (void)
void calibrationLogChanged (void)
void calibrationResultChanged (void)
void waitingForCancelChanged (void)
void magCalComplete (void)
void calibrationActiveChanged (void)
void calibrationProgressChanged (void)
void inlineCalibrationFinished (bool success, const QString &message)
void largeVehicleCalibrationFinished (bool success, const QString &message)
 success is false when the firmware reported a failure, message is its text
void largeVehicleCalibrationPendingChanged (void)
Signals inherited from FactPanelController
void missingParametersAvailable ()
void suppressRebootMessageChanged ()

Public Member Functions

 SensorsComponentController (void)
Q_INVOKABLE void calibrateCompass (void)
 What the firmware has logged during the calibration, one message per line.
Q_INVOKABLE void calibrateGyro (void)
Q_INVOKABLE void calibrateAccel (void)
Q_INVOKABLE void calibrateLevel (void)
Q_INVOKABLE void calibrateAirspeed (void)
Q_INVOKABLE void calibrateBaro (void)
Q_INVOKABLE void calibrateCompassLargeVehicle (double headingDegrees)
Q_INVOKABLE void cancelCalibration (void)
Q_INVOKABLE bool usingUDPLink (void)
Q_INVOKABLE void resetFactoryParameters ()
Q_INVOKABLE QString deviceDescription (int deviceId) const
 Chip and bus of a CAL_*_ID device ID parameter value, empty when the ID is not set.
bool calibrationActive () const
bool largeVehicleCalibrationPending () const
double calibrationProgress () const
QString calibrationLog () const
CalibrationResultCalibrationResult calibrationResult () const
QString calibrationFailureText () const
ActiveCalibration activeCalibration () const
Public Member Functions inherited from FactPanelController
 FactPanelController (QObject *parent=nullptr)
virtual ~FactPanelController ()
Q_INVOKABLE Fact * getParameterFact (int componentId, const QString &name, bool reportMissing=true) const
Q_INVOKABLE bool parameterExists (int componentId, const QString &name) const
Q_INVOKABLE void getMissingParameters (const QStringList &rgNames)
bool suppressRebootMessage () const
void setSuppressRebootMessage (bool suppress)

Static Public Member Functions

static LargeVehicleCalibrationResult largeVehicleCalibrationResult (const QString &text)
 What a status text from the vehicle says about the outcome of a large vehicle compass calibration.
static QString largeVehicleCommandFailureText (int failureCode)
 Why the large vehicle compass calibration command failed, from the failureCode of Vehicle::mavCommandResult.

Additional Inherited Members

Protected Member Functions inherited from FactPanelController
bool _allParametersExists (int componentId, const QStringList &names) const
void _reportMissingParameter (int componentId, const QString &name) const
 Report a missing parameter.
Protected Attributes inherited from FactPanelController
Vehicle * _vehicle = nullptr

Detailed Description

Sensors Component MVC Controller for SensorsComponent.qml.

Definition at line 10 of file SensorsComponentController.h.

Member Enumeration Documentation

◆ ActiveCalibration

Calibration which is running through the firmware's [cal] message protocol.

Enumerator
ActiveCalibrationNone 
ActiveCalibrationCompass 
ActiveCalibrationGyro 
ActiveCalibrationAccel 
ActiveCalibrationLevel 
ActiveCalibrationAirspeed 
ActiveCalibrationBaro 

Definition at line 28 of file SensorsComponentController.h.

◆ CalibrationResult

How the last calibration which the page shows in its panel ended.

Enumerator
CalibrationResultNone 

Running, cancelled, or none has run.

CalibrationResultSuccess 
CalibrationResultFailed 

Definition at line 41 of file SensorsComponentController.h.

◆ LargeVehicleCalibrationResult

Enumerator
Pending 

Not a result message.

Succeeded 
Failed 

Definition at line 113 of file SensorsComponentController.h.

◆ SideCalState

Calibration state of a single orientation side shown in the preview. Values must stay in sync with the VehicleRotationCal.CalState QML enum.

Enumerator
SideCalStateIdle 

No calibration data to show (neutral preview).

SideCalStateIncomplete 

Calibration running, side not yet calibrated.

SideCalStateInProgress 

Side actively being calibrated.

SideCalStateCompleted 

Side calibration complete.

Definition at line 19 of file SensorsComponentController.h.

Constructor & Destructor Documentation

◆ SensorsComponentController()

SensorsComponentController::SensorsComponentController ( void )

Member Function Documentation

◆ activeCalibration()

◆ calibrateAccel()

void SensorsComponentController::calibrateAccel ( void )

◆ calibrateAirspeed()

void SensorsComponentController::calibrateAirspeed ( void )

◆ calibrateBaro()

void SensorsComponentController::calibrateBaro ( void )

◆ calibrateCompass()

void SensorsComponentController::calibrateCompass ( void )

What the firmware has logged during the calibration, one message per line.

The firmware's reason for a failed calibration, empty otherwise True after the vehicle was put on a side which is already calibrated, until another side is detected 0 to 1, as reported by the firmware's progress messages True from the large vehicle calibration request until its result

Definition at line 196 of file SensorsComponentController.cc.

References FactPanelController::_vehicle, and QGCMAVLink::CalibrationMag.

◆ calibrateCompassLargeVehicle()

void SensorsComponentController::calibrateCompassLargeVehicle ( double headingDegrees)

For vehicles too large to rotate: offsets only, from a known heading and the vehicle's GPS position. largeVehicleCalibrationFinished is emitted when the firmware reports the result.

Definition at line 226 of file SensorsComponentController.cc.

References FactPanelController::_vehicle.

◆ calibrateGyro()

void SensorsComponentController::calibrateGyro ( void )

◆ calibrateLevel()

void SensorsComponentController::calibrateLevel ( void )

◆ calibrationActive()

bool SensorsComponentController::calibrationActive ( ) const
inline

Definition at line 99 of file SensorsComponentController.h.

References activeCalibration(), and ActiveCalibrationNone.

◆ calibrationActiveChanged

void SensorsComponentController::calibrationActiveChanged ( void )
signal

◆ calibrationFailureText()

QString SensorsComponentController::calibrationFailureText ( ) const
inline

Definition at line 109 of file SensorsComponentController.h.

◆ calibrationLog()

QString SensorsComponentController::calibrationLog ( ) const
inline

Definition at line 105 of file SensorsComponentController.h.

◆ calibrationLogChanged

void SensorsComponentController::calibrationLogChanged ( void )
signal

◆ calibrationProgress()

double SensorsComponentController::calibrationProgress ( ) const
inline

Definition at line 103 of file SensorsComponentController.h.

◆ calibrationProgressChanged

void SensorsComponentController::calibrationProgressChanged ( void )
signal

◆ calibrationResult()

CalibrationResultCalibrationResult SensorsComponentController::calibrationResult ( ) const
inline

Definition at line 107 of file SensorsComponentController.h.

◆ calibrationResultChanged

void SensorsComponentController::calibrationResultChanged ( void )
signal

◆ cancelCalibration()

void SensorsComponentController::cancelCalibration ( void )

◆ deviceDescription()

QString SensorsComponentController::deviceDescription ( int deviceId) const

Chip and bus of a CAL_*_ID device ID parameter value, empty when the ID is not set.

Definition at line 354 of file SensorsComponentController.cc.

References PX4SensorDevice::description().

◆ inlineCalibrationFinished

void SensorsComponentController::inlineCalibrationFinished ( bool success,
const QString & message )
signal

A gyroscope, barometer or level horizon calibration finished. message is the firmware's failure text, empty on success.

◆ largeVehicleCalibrationFinished

void SensorsComponentController::largeVehicleCalibrationFinished ( bool success,
const QString & message )
signal

success is false when the firmware reported a failure, message is its text

◆ largeVehicleCalibrationPending()

bool SensorsComponentController::largeVehicleCalibrationPending ( ) const
inline

Definition at line 101 of file SensorsComponentController.h.

◆ largeVehicleCalibrationPendingChanged

void SensorsComponentController::largeVehicleCalibrationPendingChanged ( void )
signal

◆ largeVehicleCalibrationResult()

SensorsComponentController::LargeVehicleCalibrationResult SensorsComponentController::largeVehicleCalibrationResult ( const QString & text)
static

What a status text from the vehicle says about the outcome of a large vehicle compass calibration.

Definition at line 241 of file SensorsComponentController.cc.

References Failed, Pending, and Succeeded.

◆ largeVehicleCommandFailureText()

QString SensorsComponentController::largeVehicleCommandFailureText ( int failureCode)
static

Why the large vehicle compass calibration command failed, from the failureCode of Vehicle::mavCommandResult.

Definition at line 292 of file SensorsComponentController.cc.

References VehicleTypes::MavCmdResultFailureDuplicateCommand, and VehicleTypes::MavCmdResultFailureNoResponseToCommand.

◆ magCalComplete

void SensorsComponentController::magCalComplete ( void )
signal

◆ orientationCalSidesStateChanged

void SensorsComponentController::orientationCalSidesStateChanged ( void )
signal

◆ orientationCalSidesVisibleChanged

void SensorsComponentController::orientationCalSidesVisibleChanged ( void )
signal

◆ resetFactoryParameters()

void SensorsComponentController::resetFactoryParameters ( )

Definition at line 636 of file SensorsComponentController.cc.

References FactPanelController::_vehicle.

◆ showGyroCalAreaChanged

void SensorsComponentController::showGyroCalAreaChanged ( void )
signal

◆ showOrientationCalAreaChanged

void SensorsComponentController::showOrientationCalAreaChanged ( void )
signal

◆ usingUDPLink()

bool SensorsComponentController::usingUDPLink ( void )

◆ waitingForCancelChanged

void SensorsComponentController::waitingForCancelChanged ( void )
signal

Referenced by cancelCalibration().


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