QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
FactPanelController.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtCore/QStringList>
5#include <QtCore/QTimer>
6#include <QtQmlIntegration/QtQmlIntegration>
7
8class Vehicle;
9class Fact;
10
13class FactPanelController : public QObject
14{
15 Q_OBJECT
16 QML_ELEMENT
17 Q_MOC_INCLUDE("Vehicle.h")
18 Q_MOC_INCLUDE("Fact.h")
19 Q_PROPERTY(Vehicle *vehicle MEMBER _vehicle CONSTANT)
20
21public:
22 explicit FactPanelController(QObject *parent = nullptr);
23 virtual ~FactPanelController();
24
25 Q_INVOKABLE Fact *getParameterFact(int componentId, const QString &name, bool reportMissing = true) const;
26 Q_INVOKABLE bool parameterExists(int componentId, const QString &name) const;
27
30 Q_INVOKABLE void getMissingParameters(const QStringList &rgNames);
31
32signals:
34
35protected:
38 bool _allParametersExists(int componentId, const QStringList &names) const;
39
41 void _reportMissingParameter(int componentId, const QString &name) const;
42
43 Vehicle *_vehicle = nullptr;
44
45private slots:
46 void _checkForMissingParameters();
47
48private:
49 QStringList _missingParameterWaitList;
50 QTimer _missingParametersTimer;
51};
Used for handling missing Facts from C++ code.
bool _allParametersExists(int componentId, const QStringList &names) const
void _reportMissingParameter(int componentId, const QString &name) const
Report a missing parameter.
void missingParametersAvailable()
Q_INVOKABLE Fact * getParameterFact(int componentId, const QString &name, bool reportMissing=true) const
Q_INVOKABLE void getMissingParameters(const QStringList &rgNames)
Q_INVOKABLE bool parameterExists(int componentId, const QString &name) const
A Fact is used to hold a single value within the system.
Definition Fact.h:17