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

#include <PX4BatteryController.h>

Inheritance diagram for PX4BatteryController:
Collaboration diagram for PX4BatteryController:

Signals

void pendingParamsChanged ()
void addedParamCountChanged ()
Signals inherited from FactPanelController
void missingParametersAvailable ()
void suppressRebootMessageChanged ()

Public Member Functions

 PX4BatteryController (QObject *parent=nullptr)
Q_INVOKABLE void requestParameters (const QStringList &names)
Q_INVOKABLE bool parameterReady (const QString &name) const
 True when the vehicle has the parameter and it is not waiting for its requested value.
QStringList pendingParams () const
int addedParamCount () 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)

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

Controller for PX4BatteryComponent.qml. PX4 only streams the parameters a running module has looked up, such as a power monitor driver's settings once the driver runs, so the page requests the rest by name.

Definition at line 14 of file PX4BatteryController.h.

Constructor & Destructor Documentation

◆ PX4BatteryController()

PX4BatteryController::PX4BatteryController ( QObject * parent = nullptr)
explicit

Member Function Documentation

◆ addedParamCount()

int PX4BatteryController::addedParamCount ( ) const
inline

Number of parameters the vehicle has added since the page opened, requested or not. Changes once the new parameter has its value and is ready, and before pendingParams signals the change, so bindings on it have updated by then. A failed read does not change it.

Definition at line 37 of file PX4BatteryController.h.

◆ addedParamCountChanged

void PX4BatteryController::addedParamCountChanged ( )
signal

◆ parameterReady()

bool PX4BatteryController::parameterReady ( const QString & name) const

True when the vehicle has the parameter and it is not waiting for its requested value.

Definition at line 73 of file PX4BatteryController.cc.

References ParameterManager::defaultComponentId.

◆ pendingParams()

QStringList PX4BatteryController::pendingParams ( ) const
inline

Definition at line 32 of file PX4BatteryController.h.

◆ pendingParamsChanged

void PX4BatteryController::pendingParamsChanged ( )
signal

Referenced by requestParameters().

◆ requestParameters()

void PX4BatteryController::requestParameters ( const QStringList & names)

Requests each named parameter the vehicle has not sent. A name stays in pendingParams until its value arrives or the read fails. Parameters the firmware does not have are dropped without telling the user, and are not requested again for the same vehicle.

Definition at line 50 of file PX4BatteryController.cc.

References ParameterManager::defaultComponentId, and pendingParamsChanged().


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