8constexpr int kTimerGroupCount = 8;
19 return tr(
"Calibrate PWM ESCs and configure DShot and DroneCAN ESC settings.");
24 return QStringLiteral(
"/InstrumentValueIcons/bolt.svg");
30 tr(
"Electronic speed controller"), tr(
"Calibration"), tr(
"Motor"), tr(
"PWM"), tr(
"DShot"), tr(
"DroneCAN"),
36 return QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AutoPilotPlugins/PX4/PX4EscComponent.qml"));
41 QStringList triggers{
"DSHOT_BIDIR_EN",
"MOT_POLE_COUNT"};
42 for (
int i = 0; i < kTimerGroupCount; i++) {
43 triggers.append(QStringLiteral(
"PWM_MAIN_TIM%1").arg(i));
44 triggers.append(QStringLiteral(
"PWM_AUX_TIM%1").arg(i));
55 for (
int i = 0; i < kTimerGroupCount; i++) {
56 for (
const QString& prefix : {QStringLiteral(
"PWM_MAIN_TIM"), QStringLiteral(
"PWM_AUX_TIM")}) {
61 if (protocol->
rawValue().toInt() < -1) {
69 QList<VehicleSummaryItem> items;
71 items.append({tr(
"Output"), tr(
"DShot and PWM")});
73 items.append({tr(
"Output"), tr(
"DShot")});
75 items.append({tr(
"Output"), tr(
"PWM")});
81 items.append({tr(
"Bidirectional DShot"), bidirectional->
enumStringValue(),
82 bidirectional->
rawValue().toInt() == 0 ? VehicleSummaryItem::Muted
83 : VehicleSummaryItem::Normal});
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.
QString cookedValueString() const
QString enumStringValue()
QVariant rawValue() const
PX4EscComponent(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 iconResource() const final
QUrl setupSource() const final
QStringList summaryChangedTriggerList() const final
Parameters whose change emits summaryItemsChanged, besides those that change setupComplete.
QStringList searchKeywords() const final
Translated search terms for the whole component, for pages without vehicleConfigJson() sections.
QString description() const final
VehicleComponent(Vehicle *vehicle, AutoPilotPlugin *autopilot, AutoPilotPlugin::KnownVehicleComponent KnownVehicleComponent, QObject *parent=nullptr)
Fact * _parameterFact(const QString &name) const
Fact of a parameter of the default component, nullptr when the vehicle does not have it.