QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
PX4BatteryController.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QPointer>
4#include <QtCore/QSet>
5#include <QtCore/QStringList>
6#include <QtQmlIntegration/QtQmlIntegration>
7
9
11
15{
16 Q_OBJECT
17 QML_ELEMENT
18 Q_PROPERTY(QStringList pendingParams READ pendingParams NOTIFY pendingParamsChanged)
20
21public:
22 explicit PX4BatteryController(QObject* parent = nullptr);
23
27 Q_INVOKABLE void requestParameters(const QStringList& names);
28
30 Q_INVOKABLE bool parameterReady(const QString& name) const;
31
32 QStringList pendingParams() const { return _pendingParams.values(); }
33
37 int addedParamCount() const { return _addedParamCount; }
38
39signals:
42
43private slots:
44 void _factAdded(int componentId, Fact* fact);
45 void _parameterReadFailed(int componentId, const QString& paramName);
46
47private:
48 void _paramAdded(const QString& paramName);
49 void _removePending(const QString& paramName);
50
51 QPointer<ParameterManager> _parameterManager;
52 QSet<QString> _requestedParams;
53 QSet<QString> _pendingParams;
54 int _addedParamCount = 0;
55};
FactPanelController(QObject *parent=nullptr)
A Fact is used to hold a single value within the system.
Definition Fact.h:15
QStringList pendingParams() const
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.
PX4BatteryController(QObject *parent=nullptr)