QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
AirframeComponentController.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtCore/QVariant>
5#include <QtQmlIntegration/QtQmlIntegration>
6
9
13{
14 Q_OBJECT
15 QML_ELEMENT
16
17public:
20
21 Q_PROPERTY(bool showCustomConfigPanel MEMBER _showCustomConfigPanel NOTIFY showCustomConfigPanelChanged)
22
23 Q_PROPERTY(QVariantList airframeTypes MEMBER _airframeTypes CONSTANT)
24
25 Q_PROPERTY(QString currentAirframeType MEMBER _currentAirframeType CONSTANT)
26 Q_PROPERTY(QString currentVehicleName MEMBER _currentVehicleName CONSTANT)
27 Q_PROPERTY(int currentVehicleIndex MEMBER _currentVehicleIndex CONSTANT)
28
29 Q_PROPERTY(int autostartId MEMBER _autostartId NOTIFY autostartIdChanged)
30
31 Q_INVOKABLE void changeAutostart(void);
32
34 void setCurrentAirframeIndex(int newIndex);
35
36signals:
37 void autostartIdChanged(int newAutostartId);
39
40private slots:
41 void _waitParamWriteSignal(QVariant value);
42 void _rebootAfterStackUnwind(void);
43
44private:
45 static bool _typesRegistered;
46
47 QVariantList _airframeTypes;
48 QString _currentAirframeType;
49 QString _currentVehicleName;
50 int _currentVehicleIndex;
51 int _autostartId;
52 bool _showCustomConfigPanel;
53 int _waitParamWriteSignalCount;
54};
55
56class Airframe : public QObject
57{
58 Q_OBJECT
59 QML_ELEMENT
60 QML_UNCREATABLE("")
61
62public:
63 Airframe(const QString& name, int autostartId, QObject* parent = nullptr);
64 ~Airframe();
65
66 Q_PROPERTY(QString text MEMBER _name CONSTANT)
67 Q_PROPERTY(int autostartId MEMBER _autostartId CONSTANT)
68
69private:
70 QString _name;
71 int _autostartId;
72};
73
74class AirframeType : public QObject
75{
76 Q_OBJECT
77 QML_ELEMENT
78 QML_UNCREATABLE("")
79
80public:
81 AirframeType(const QString& name, const QString& imageResource, QObject* parent = nullptr);
83
84 Q_PROPERTY(QString name MEMBER _name CONSTANT)
85 Q_PROPERTY(QString imageResource MEMBER _imageResource CONSTANT)
86 Q_PROPERTY(QVariantList airframes MEMBER _airframes CONSTANT)
87
88 void addAirframe(const QString& name, int autostartId);
89
90private:
91 QString _name;
92 QString _imageResource;
93 QVariantList _airframes;
94};
MVC Controller for AirframeComponent.qml.
void showCustomConfigPanelChanged(bool show)
void autostartIdChanged(int newAutostartId)
void setCurrentAirframeIndex(int newIndex)
void addAirframe(const QString &name, int autostartId)
Used for handling missing Facts from C++ code.