17 if (!parameterManager) {
32 return tr(
"Assign functions such as MAVLink telemetry, GPS and RC input to the vehicle's serial ports.");
37 return QStringLiteral(
"/InstrumentValueIcons/link.svg");
42 return QUrl::fromUserInput(
43 QStringLiteral(
"qrc:/qml/QGroundControl/AutoPilotPlugins/PX4/PX4SerialPortsComponent.qml"));
50 triggers.append(fact->name());
58 QList<PX4SerialPortConfig::Function> functions;
61 fact->enumStrings(), fact->rawValue().toInt()));
64 QList<VehicleSummaryItem> items;
68 if (function.currentPortId == port.id) {
69 labels.append(function.label);
72 if (!labels.isEmpty()) {
73 items.append({port.label, labels.join(QStringLiteral(
", "))});
The AutoPilotPlugin class is an abstract base class which represents the methods and objects which ar...
A Fact is used to hold a single value within the system.
QVariantList enumValues() const
QString name() const final
static QList< Fact * > functionFacts(ParameterManager *parameterManager)
Parameters which select the serial port a function runs on. The page is only shown when there are som...
QList< VehicleSummaryItem > summaryItems() const final
Values for this component's card on the Summary page. A component with none falls back to summaryQmlS...
QString iconResource() const final
QStringList summaryChangedTriggerList() const final
Parameters whose change emits summaryItemsChanged, besides those that change setupComplete.
PX4SerialPortsComponent(Vehicle *vehicle, AutoPilotPlugin *autopilot, QObject *parent=nullptr)
QString description() const final
QUrl setupSource() const final
Fact * getParameter(int componentId, const QString ¶mName)
static constexpr int defaultComponentId
QStringList parameterNames(int componentId) const
Returns all parameter names.
VehicleComponent(Vehicle *vehicle, AutoPilotPlugin *autopilot, AutoPilotPlugin::KnownVehicleComponent KnownVehicleComponent, QObject *parent=nullptr)
bool isFunctionParam(const QVariantList &enumValues)
true: the enum values are a PX4 serial port selection, which makes the parameter a port function
Function makeFunction(const QString ¶mName, const QString &shortDescription, const QVariantList &enumValues, const QStringList &enumStrings, int value)
value is the function parameter's value. currentPortId is defaultPortId when it is Disabled.
QList< Port > ports(const QList< Function > &functions)
Every port any function can run on, in port id order.