8#include <QtQml/QQmlApplicationEngine>
14 , _name(tr(
"Actuators"))
15 , _actuators(*vehicle->actuators())
38 return QStringLiteral(
"/qmlimages/MotorComponentIcon.svg");
48 return !_actuators.hasUnsetRequiredFunctions();
58 return QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AutoPilotPlugins/PX4/ActuatorComponent.qml"));
68 if (!_actuators.isInitialized()) {
72 QList<VehicleSummaryItem> items;
74 const QString geometry = mixer->
title();
75 if (!geometry.isEmpty()) {
76 items.append({tr(
"Geometry"), geometry});
78 if (_actuators.hasUnsetRequiredFunctions()) {
79 items.append({tr(
"Required Outputs"), tr(
"Setup required"), VehicleSummaryItem::Attention});
82 const auto groupTitle = [mixer](
int function) {
84 for (
auto it = actuatorTypes.cbegin(); it != actuatorTypes.cend(); ++it) {
85 if (function < it->functionMin || function > it->functionMax) {
99 return tr(
"Other Outputs");
102 const QMap<int, QStringList> channels = _actuators.channelsByFunction();
103 for (
auto it = channels.cbegin(); it != channels.cend(); ++it) {
105 items.append({label.isEmpty() ? tr(
"Function %1").arg(it.key()) : label,
106 it.value().join(QStringLiteral(
", ")), VehicleSummaryItem::Normal, groupTitle(it.key())});
static bool imageProviderAdded
QUrl summaryQmlSource(void) const final
virtual QUrl setupSource(void) const
QString description(void) const final
ActuatorComponent(Vehicle *vehicle, AutoPilotPlugin *autopilot, QObject *parent=nullptr)
QList< VehicleSummaryItem > summaryItems() const final
Values for this component's card on the Summary page. A component with none falls back to summaryQmlS...
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()
The AutoPilotPlugin class is an abstract base class which represents the methods and objects which ar...
static VehicleGeometryImageProvider * instance()
const ActuatorTypes & actuatorTypes() const
QString getSpecificLabelForFunction(int function) const
VehicleComponent(Vehicle *vehicle, AutoPilotPlugin *autopilot, AutoPilotPlugin::KnownVehicleComponent KnownVehicleComponent, QObject *parent=nullptr)
void _triggerUpdated(QVariant)
QMap< QString, ActuatorType > ActuatorTypes
key is the group name, where 'DEFAULT' is the default group
static Type typeFromStr(const QString &type)