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/QPointer>
5#include <QtCore/QStringList>
6#include <QtCore/QTimer>
7#include <QtQmlIntegration/QtQmlIntegration>
8
9class Vehicle;
10class Fact;
12
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)
26
27public:
28 explicit FactPanelController(QObject *parent = nullptr);
29 virtual ~FactPanelController();
30
31 Q_INVOKABLE Fact *getParameterFact(int componentId, const QString &name, bool reportMissing = true) const;
32 Q_INVOKABLE bool parameterExists(int componentId, const QString &name) const;
33
36 Q_INVOKABLE void getMissingParameters(const QStringList &rgNames);
37
38 bool suppressRebootMessage() const { return _rebootMessageSuppressedBy != nullptr; }
39
40 void setSuppressRebootMessage(bool suppress);
41
42signals:
45
46protected:
49 bool _allParametersExists(int componentId, const QStringList &names) const;
50
52 void _reportMissingParameter(int componentId, const QString &name) const;
53
54 Vehicle *_vehicle = nullptr;
55
56private slots:
57 void _checkForMissingParameters();
58
59private:
60 QStringList _missingParameterWaitList;
61 QTimer _missingParametersTimer;
62 QPointer<ParameterManager> _rebootMessageSuppressedBy;
63};
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)
FactPanelController(QObject *parent=nullptr)
void setSuppressRebootMessage(bool suppress)
void suppressRebootMessageChanged()
Q_INVOKABLE bool parameterExists(int componentId, const QString &name) const
bool suppressRebootMessage() const
A Fact is used to hold a single value within the system.
Definition Fact.h:15