QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
AutoPilotPlugin.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QLoggingCategory>
4#include <QtCore/QObject>
5#include <QtCore/QString>
6#include <QtCore/QVariantList>
7#include <QtQmlIntegration/QtQmlIntegration>
8
10class Vehicle;
12
13Q_DECLARE_LOGGING_CATEGORY(AutoPilotPluginLog)
14
15
19class AutoPilotPlugin : public QObject
20{
21 Q_OBJECT
22 QML_ELEMENT
23 QML_UNCREATABLE("")
24 Q_PROPERTY(QVariantList vehicleComponents READ vehicleComponents NOTIFY vehicleComponentsChanged)
25 Q_PROPERTY(bool setupComplete READ setupComplete NOTIFY setupCompleteChanged)
26
27public:
28 explicit AutoPilotPlugin(Vehicle *vehicle, QObject *parent = nullptr);
29 virtual ~AutoPilotPlugin();
30
31 // Vehicle Components which are available for firmware types
32 enum KnownVehicleComponent {
33 KnownRadioVehicleComponent,
34 KnownFlightModesVehicleComponent,
35 KnownSensorsVehicleComponent,
36 KnownSafetyVehicleComponent,
37 KnownPowerVehicleComponent,
38 KnownJoystickVehicleComponent,
39 UnknownVehicleComponent // Firmware specific vehicle components
40 };
41 Q_ENUM(KnownVehicleComponent)
42
43
45 virtual void parametersReadyPreChecks();
46
47 // Must be implemented by derived class
48 virtual const QVariantList &vehicleComponents() = 0;
49
51 Q_INVOKABLE virtual QString prerequisiteSetup(VehicleComponent *component) const = 0;
52
54 Q_INVOKABLE bool knownVehicleComponentAvailable(KnownVehicleComponent knownVehicleComponent) { return (findKnownVehicleComponent(knownVehicleComponent) != nullptr); }
55
57 Q_INVOKABLE VehicleComponent *findKnownVehicleComponent(KnownVehicleComponent knownVehicleComponent);
58
59 bool setupComplete() const { return _setupComplete; }
60
61signals:
64
65protected:
66 Vehicle *_vehicle = nullptr;
67 FirmwarePlugin *_firmwarePlugin = nullptr;
68 bool _setupComplete = false;
69
70private slots:
71 void _recalcSetupComplete();
72};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
void vehicleComponentsChanged()
void setupCompleteChanged()
void setupCompleteChanged()