QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
ActuatorComponent.cc
Go to the documentation of this file.
1#include "ActuatorComponent.h"
2#include "QGCApplication.h"
3#include "GeometryImage.h"
5
6#include <QtQml/QQmlApplicationEngine>
7
8static bool imageProviderAdded{false};
9
10ActuatorComponent::ActuatorComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent)
11 : VehicleComponent(vehicle, autopilot, AutoPilotPlugin::UnknownVehicleComponent, parent)
12 , _name(tr("Actuators"))
13 , _actuators(*vehicle->actuators())
14{
15 if (!imageProviderAdded) {
16 // TODO: qmlAppEngine should not be accessed inside app
17 qgcApp()->qmlAppEngine()->addImageProvider(QLatin1String("actuators"), GeometryImage::VehicleGeometryImageProvider::instance());
18 imageProviderAdded = true;
19 }
20
21 connect(&_actuators, &Actuators::hasUnsetRequiredFunctionsChanged, this, [this]() { _triggerUpdated({}); });
22}
23
24QString ActuatorComponent::name(void) const
25{
26 return _name;
27}
28
30{
31 return "";
32}
33
35{
36 return QStringLiteral("/qmlimages/MotorComponentIcon.svg");
37}
38
40{
41 return true;
42}
43
45{
46 return !_actuators.hasUnsetRequiredFunctions();
47}
48
50{
51 return QStringList();
52}
53
55{
56 return QUrl::fromUserInput(QStringLiteral("qrc:/qml/QGroundControl/AutoPilotPlugins/PX4/ActuatorComponent.qml"));
57}
58
60{
61 return QUrl();
62}
static bool imageProviderAdded
#define qgcApp()
QUrl summaryQmlSource(void) const final
virtual QUrl setupSource(void) const
QString description(void) const final
ActuatorComponent(Vehicle *vehicle, AutoPilotPlugin *autopilot, QObject *parent=nullptr)
QString name(void) const final
QStringList setupCompleteChangedTriggerList(void) const final
bool setupComplete(void) const final
QString iconResource(void) const final
bool requiresSetup(void) const final
void hasUnsetRequiredFunctionsChanged()
bool hasUnsetRequiredFunctions() const
Definition Actuators.h:59
static VehicleGeometryImageProvider * instance()
void _triggerUpdated(QVariant)