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 "MAVLinkLib.h"
3#include "QGCApplication.h"
4#include "GeometryImage.h"
6#include "Vehicle.h"
7
8#include <QtQml/QQmlApplicationEngine>
9
10static bool imageProviderAdded{false};
11
12ActuatorComponent::ActuatorComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent)
13 : VehicleComponent(vehicle, autopilot, AutoPilotPlugin::UnknownVehicleComponent, parent)
14 , _name(tr("Actuators"))
15 , _actuators(*vehicle->actuators())
16{
17 if (!imageProviderAdded) {
18 // TODO: qmlAppEngine should not be accessed inside app
19 qgcApp()->qmlAppEngine()->addImageProvider(QLatin1String("actuators"), GeometryImage::VehicleGeometryImageProvider::instance());
20 imageProviderAdded = true;
21 }
22
23 connect(&_actuators, &Actuators::hasUnsetRequiredFunctionsChanged, this, [this]() { _triggerUpdated({}); });
24}
25
26QString ActuatorComponent::name(void) const
27{
28 return _name;
29}
30
32{
33 return "";
34}
35
37{
38 return QStringLiteral("/qmlimages/MotorComponentIcon.svg");
39}
40
42{
43 return true;
44}
45
47{
48 return !_actuators.hasUnsetRequiredFunctions();
49}
50
52{
53 return QStringList();
54}
55
57{
58 return QUrl::fromUserInput(QStringLiteral("qrc:/qml/QGroundControl/AutoPilotPlugins/PX4/ActuatorComponent.qml"));
59}
60
62{
63 return QUrl();
64}
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
The AutoPilotPlugin class is an abstract base class which represents the methods and objects which ar...
static VehicleGeometryImageProvider * instance()
A vehicle component is an object which abstracts the physical portion of a vehicle into a set of conf...
void _triggerUpdated(QVariant)