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/QLoggingCategory>
4#include <QtCore/QObject>
5#include <QtCore/QStringList>
6#include <QtCore/QTimer>
7#include <QtQmlIntegration/QtQmlIntegration>
8
9Q_DECLARE_LOGGING_CATEGORY(FactPanelControllerLog)
10
11class Vehicle;
12class Fact;
13
15class FactPanelController : public QObject
16{
17 Q_OBJECT
18 QML_ELEMENT
19 Q_MOC_INCLUDE("Vehicle.h")
20 Q_MOC_INCLUDE("Fact.h")
21 Q_PROPERTY(Vehicle *vehicle MEMBER _vehicle CONSTANT)
22
23public:
24 explicit FactPanelController(QObject *parent = nullptr);
25 virtual ~FactPanelController();
26
27 Q_INVOKABLE Fact *getParameterFact(int componentId, const QString &name, bool reportMissing = true) const;
28 Q_INVOKABLE bool parameterExists(int componentId, const QString &name) const;
29
32 Q_INVOKABLE void getMissingParameters(const QStringList &rgNames);
33
34signals:
36
37protected:
40 bool _allParametersExists(int componentId, const QStringList &names) const;
41
43 void _reportMissingParameter(int componentId, const QString &name) const;
44
45 Vehicle *_vehicle = nullptr;
46
47private slots:
48 void _checkForMissingParameters();
49
50private:
51 QStringList _missingParameterWaitList;
52 QTimer _missingParametersTimer;
53};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
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()
A Fact is used to hold a single value within the system.
Definition Fact.h:19