A vehicle component is an object which abstracts the physical portion of a vehicle into a set of configurable values and user interface. More...
#include <VehicleComponent.h>
Signals | |
| void | requiresSetupChanged () |
| void | setupCompleteChanged () |
| void | summaryItemsChanged () |
| void | setupSourceChanged () |
| void | sectionIdsChanged () |
Public Member Functions | |
| VehicleComponent (Vehicle *vehicle, AutoPilotPlugin *autopilot, AutoPilotPlugin::KnownVehicleComponent KnownVehicleComponent, QObject *parent=nullptr) | |
| virtual | ~VehicleComponent () |
| virtual QString | name () const =0 |
| virtual QString | description () const |
| virtual QString | iconResource () const =0 |
| virtual bool | requiresSetup () const =0 |
| virtual int | setupOrder () const |
| virtual bool | setupComplete () const =0 |
| virtual QUrl | setupSource () const =0 |
| virtual QUrl | summaryQmlSource () const =0 |
| virtual QList< VehicleSummaryItem > | summaryItems () const |
| Values for this component's card on the Summary page. A component with none falls back to summaryQmlSource(). | |
| virtual QStringList | summaryChangedTriggerList () const |
| Parameters whose change emits summaryItemsChanged, besides those that change setupComplete. | |
| virtual QString | vehicleConfigJson () const |
| Resource path to a VehicleConfig.json page definition, or empty if none. | |
| virtual QStringList | sectionIds () const |
| virtual Q_INVOKABLE QString | sectionDisplayName (const QString §ionId) const |
| QVariantMap | sectionKeywords () const |
| Search keywords per section, keyed by section ID. Values are original-case translatable terms. | |
| virtual QStringList | searchKeywords () const |
| Translated search terms for the whole component, for pages without vehicleConfigJson() sections. | |
| virtual bool | showFirstSectionOnRootClick () const |
| When true, clicking the root component in the tree selects the first section instead of showing all. | |
| virtual Q_INVOKABLE bool | sectionSetupComplete (const QString §ionId) const |
| Returns setup-complete status for a section ID. Default returns true (no per-section tracking). | |
| virtual bool | allowSetupWhileArmed () const |
| virtual bool | allowSetupWhileFlying () const |
| virtual void | addSummaryQmlComponent (QQmlContext *context, QQuickItem *parent) |
| virtual QStringList | setupCompleteChangedTriggerList () const =0 |
| virtual void | setupTriggerSignals () |
| AutoPilotPlugin::KnownVehicleComponent | KnownVehicleComponent () const |
Protected Slots | |
| void | _triggerUpdated (QVariant) |
Protected Member Functions | |
| Fact * | _parameterFact (const QString &name) const |
| Fact of a parameter of the default component, nullptr when the vehicle does not have it. | |
Static Protected Member Functions | |
| static QString | _valueWithUnits (const Fact *fact) |
| The fact's value followed by its units, when it has any. | |
Protected Attributes | |
| Vehicle * | _vehicle = nullptr |
| AutoPilotPlugin * | _autopilot = nullptr |
| AutoPilotPlugin::KnownVehicleComponent | _KnownVehicleComponent |
A vehicle component is an object which abstracts the physical portion of a vehicle into a set of configurable values and user interface.
Definition at line 23 of file VehicleComponent.h.
|
explicit |
Definition at line 16 of file VehicleComponent.cc.
References _autopilot, _KnownVehicleComponent, _vehicle, KnownVehicleComponent(), setupCompleteChanged(), and summaryItemsChanged().
Referenced by ActuatorComponent::ActuatorComponent(), AirframeComponent::AirframeComponent(), APMAdvancedTuningCopterComponent::APMAdvancedTuningCopterComponent(), APMAirframeComponent::APMAirframeComponent(), APMAirspeedComponent::APMAirspeedComponent(), APMESCComponent::APMESCComponent(), APMFailsafesComponent::APMFailsafesComponent(), APMFlightModesComponent::APMFlightModesComponent(), APMFlightSafetyComponent::APMFlightSafetyComponent(), APMFollowComponent::APMFollowComponent(), APMGimbalComponent::APMGimbalComponent(), APMHeliComponent::APMHeliComponent(), APMLightsComponent::APMLightsComponent(), APMLoggingComponent::APMLoggingComponent(), APMPowerComponent::APMPowerComponent(), APMRadioComponent::APMRadioComponent(), APMRemoteSupportComponent::APMRemoteSupportComponent(), APMSafetyComponent::APMSafetyComponent(), APMSensorsComponent::APMSensorsComponent(), APMServoComponent::APMServoComponent(), APMSubFrameComponent::APMSubFrameComponent(), APMTuningComponent::APMTuningComponent(), ESP8266Component::ESP8266Component(), FailureInjectionComponent::FailureInjectionComponent(), FlightModesComponent::FlightModesComponent(), JoystickComponent::JoystickComponent(), MotorComponent::MotorComponent(), PX4BatteryComponent::PX4BatteryComponent(), PX4CollisionComponent::PX4CollisionComponent(), PX4EscComponent::PX4EscComponent(), PX4FailsafesComponent::PX4FailsafesComponent(), PX4FlightBehavior::PX4FlightBehavior(), PX4RadioComponent::PX4RadioComponent(), PX4ReturnLandComponent::PX4ReturnLandComponent(), PX4SerialPortsComponent::PX4SerialPortsComponent(), PX4TuningComponent::PX4TuningComponent(), ScriptingComponent::ScriptingComponent(), SensorsComponent::SensorsComponent(), and SyslinkComponent::SyslinkComponent().
|
virtual |
Definition at line 31 of file VehicleComponent.cc.
|
protected |
Fact of a parameter of the default component, nullptr when the vehicle does not have it.
Definition at line 289 of file VehicleComponent.cc.
References _vehicle, ParameterManager::defaultComponentId, ParameterManager::getParameter(), name(), and ParameterManager::parameterExists().
Referenced by PX4BatteryComponent::summaryChangedTriggerList(), AirframeComponent::summaryItems(), FlightModesComponent::summaryItems(), PX4BatteryComponent::summaryItems(), PX4CollisionComponent::summaryItems(), PX4EscComponent::summaryItems(), PX4FailsafesComponent::summaryItems(), PX4RadioComponent::summaryItems(), PX4ReturnLandComponent::summaryItems(), and SensorsComponent::summaryItems().
|
inlineprotectedslot |
Definition at line 119 of file VehicleComponent.h.
References setupCompleteChanged().
Referenced by ActuatorComponent::ActuatorComponent(), and setupTriggerSignals().
|
staticprotected |
The fact's value followed by its units, when it has any.
Definition at line 299 of file VehicleComponent.cc.
References Fact::cookedUnits(), and Fact::cookedValueString().
Referenced by PX4BatteryComponent::summaryItems(), PX4CollisionComponent::summaryItems(), and PX4ReturnLandComponent::summaryItems().
|
virtual |
Definition at line 236 of file VehicleComponent.cc.
|
inlinevirtual |
Reimplemented in APMAdvancedTuningCopterComponent, APMAirspeedComponent, APMESCComponent, APMFailsafesComponent, APMFlightSafetyComponent, APMFollowComponent, APMHeliComponent, APMLoggingComponent, APMMotorComponent, APMPowerComponent, APMSafetyComponent, APMTuningComponent, FailureInjectionComponent, PX4BatteryComponent, PX4CollisionComponent, PX4EscComponent, PX4FailsafesComponent, PX4FlightBehavior, PX4ReturnLandComponent, PX4SerialPortsComponent, and PX4TuningComponent.
Definition at line 94 of file VehicleComponent.h.
|
inlinevirtual |
Reimplemented in APMFailsafesComponent, APMFlightSafetyComponent, APMFollowComponent, APMLoggingComponent, APMSafetyComponent, FailureInjectionComponent, PX4CollisionComponent, PX4FailsafesComponent, PX4FlightBehavior, PX4ReturnLandComponent, and PX4TuningComponent.
Definition at line 97 of file VehicleComponent.h.
|
inlinevirtual |
Reimplemented in ActuatorComponent, AirframeComponent, APMAdvancedTuningCopterComponent, APMAirframeComponent, APMAirspeedComponent, APMESCComponent, APMFailsafesComponent, APMFlightModesComponent, APMFlightSafetyComponent, APMFollowComponent, APMGimbalComponent, APMHeliComponent, APMLightsComponent, APMLoggingComponent, APMPowerComponent, APMRadioComponent, APMRemoteSupportComponent, APMSafetyComponent, APMSensorsComponent, APMServoComponent, APMSubFrameComponent, APMTuningComponent, ESP8266Component, FailureInjectionComponent, FlightModesComponent, JoystickComponent, MotorComponent, PX4BatteryComponent, PX4CollisionComponent, PX4EscComponent, PX4FailsafesComponent, PX4FlightBehavior, PX4RadioComponent, PX4ReturnLandComponent, PX4SerialPortsComponent, PX4TuningComponent, ScriptingComponent, SensorsComponent, and SyslinkComponent.
Definition at line 52 of file VehicleComponent.h.
|
pure virtual |
Implemented in ActuatorComponent, AirframeComponent, APMAdvancedTuningCopterComponent, APMAirframeComponent, APMAirspeedComponent, APMESCComponent, APMFailsafesComponent, APMFlightModesComponent, APMFlightSafetyComponent, APMFollowComponent, APMGimbalComponent, APMHeliComponent, APMLightsComponent, APMLoggingComponent, APMPowerComponent, APMRadioComponent, APMRemoteSupportComponent, APMSafetyComponent, APMSensorsComponent, APMServoComponent, APMSubFrameComponent, APMTuningComponent, ESP8266Component, FailureInjectionComponent, FlightModesComponent, JoystickComponent, MotorComponent, PX4BatteryComponent, PX4CollisionComponent, PX4EscComponent, PX4FailsafesComponent, PX4FlightBehavior, PX4RadioComponent, PX4ReturnLandComponent, PX4SerialPortsComponent, PX4TuningComponent, ScriptingComponent, SensorsComponent, and SyslinkComponent.
|
inline |
Definition at line 109 of file VehicleComponent.h.
References _KnownVehicleComponent.
Referenced by AutoPilotPlugin::findKnownVehicleComponent(), and VehicleComponent().
|
pure virtual |
Implemented in ActuatorComponent, AirframeComponent, APMAdvancedTuningCopterComponent, APMAirframeComponent, APMAirspeedComponent, APMESCComponent, APMFailsafesComponent, APMFlightModesComponent, APMFlightSafetyComponent, APMFollowComponent, APMGimbalComponent, APMHeliComponent, APMLightsComponent, APMLoggingComponent, APMPowerComponent, APMRadioComponent, APMRemoteSupportComponent, APMSafetyComponent, APMSensorsComponent, APMServoComponent, APMSubFrameComponent, APMTuningComponent, ESP8266Component, FailureInjectionComponent, FlightModesComponent, JoystickComponent, MotorComponent, PX4BatteryComponent, PX4CollisionComponent, PX4EscComponent, PX4FailsafesComponent, PX4FlightBehavior, PX4RadioComponent, PX4ReturnLandComponent, PX4SerialPortsComponent, PX4TuningComponent, ScriptingComponent, SensorsComponent, and SyslinkComponent.
Referenced by _parameterFact().
|
pure virtual |
Implemented in ActuatorComponent, AirframeComponent, APMAdvancedTuningCopterComponent, APMAirframeComponent, APMAirspeedComponent, APMESCComponent, APMFailsafesComponent, APMFlightModesComponent, APMFlightSafetyComponent, APMFollowComponent, APMGimbalComponent, APMHeliComponent, APMLightsComponent, APMLoggingComponent, APMPowerComponent, APMRadioComponent, APMRemoteSupportComponent, APMSafetyComponent, APMSensorsComponent, APMServoComponent, APMSubFrameComponent, APMTuningComponent, ESP8266Component, FailureInjectionComponent, FlightModesComponent, JoystickComponent, MotorComponent, PX4BatteryComponent, PX4CollisionComponent, PX4EscComponent, PX4FailsafesComponent, PX4FlightBehavior, PX4RadioComponent, PX4ReturnLandComponent, PX4SerialPortsComponent, PX4TuningComponent, ScriptingComponent, SensorsComponent, and SyslinkComponent.
|
signal |
Referenced by PX4RadioComponent::setupTriggerSignals().
|
inlinevirtual |
Translated search terms for the whole component, for pages without vehicleConfigJson() sections.
Reimplemented in PX4BatteryComponent, PX4CollisionComponent, PX4EscComponent, PX4FailsafesComponent, PX4ReturnLandComponent, and SensorsComponent.
Definition at line 85 of file VehicleComponent.h.
|
inlinevirtual |
Translated display name for a section ID. Default returns the ID unchanged (JSON-driven components are translated by the view using the JSON filename context).
Definition at line 79 of file VehicleComponent.h.
|
virtual |
Untranslated section IDs for sidebar navigation. Auto-populated from vehicleConfigJson() JSON. Repeat sections are expanded by probing vehicle parameters. IDs are stable across locales and are used for section filtering; display uses sectionDisplayName() or the JSON translation context.
Definition at line 36 of file VehicleComponent.cc.
References _vehicle, and ParameterManager::defaultComponentId.
|
signal |
Referenced by setupTriggerSignals().
| QVariantMap VehicleComponent::sectionKeywords | ( | ) | const |
Search keywords per section, keyed by section ID. Values are original-case translatable terms.
Definition at line 68 of file VehicleComponent.cc.
|
inlinevirtual |
Returns setup-complete status for a section ID. Default returns true (no per-section tracking).
Definition at line 91 of file VehicleComponent.h.
|
pure virtual |
Implemented in ActuatorComponent, AirframeComponent, APMAdvancedTuningCopterComponent, APMAirframeComponent, APMAirspeedComponent, APMESCComponent, APMFailsafesComponent, APMFlightModesComponent, APMFlightSafetyComponent, APMFollowComponent, APMGimbalComponent, APMHeliComponent, APMLightsComponent, APMLoggingComponent, APMPowerComponent, APMRadioComponent, APMRemoteSupportComponent, APMSafetyComponent, APMSensorsComponent, APMServoComponent, APMSubFrameComponent, APMTuningComponent, ESP8266Component, FailureInjectionComponent, FlightModesComponent, JoystickComponent, MotorComponent, PX4BatteryComponent, PX4CollisionComponent, PX4EscComponent, PX4FailsafesComponent, PX4FlightBehavior, PX4RadioComponent, PX4ReturnLandComponent, PX4SerialPortsComponent, PX4TuningComponent, ScriptingComponent, SensorsComponent, and SyslinkComponent.
|
signal |
|
pure virtual |
Returns an list of parameter names for which a change should cause the setupCompleteChanged signal to be emitted.
Implemented in ActuatorComponent, AirframeComponent, APMAdvancedTuningCopterComponent, APMAirframeComponent, APMAirspeedComponent, APMESCComponent, APMFailsafesComponent, APMFlightModesComponent, APMFlightSafetyComponent, APMFollowComponent, APMGimbalComponent, APMHeliComponent, APMLightsComponent, APMLoggingComponent, APMPowerComponent, APMRadioComponent, APMRemoteSupportComponent, APMSafetyComponent, APMSensorsComponent, APMServoComponent, APMSubFrameComponent, APMTuningComponent, ESP8266Component, FailureInjectionComponent, FlightModesComponent, JoystickComponent, MotorComponent, PX4BatteryComponent, PX4CollisionComponent, PX4EscComponent, PX4FailsafesComponent, PX4FlightBehavior, PX4RadioComponent, PX4ReturnLandComponent, PX4SerialPortsComponent, PX4TuningComponent, ScriptingComponent, SensorsComponent, and SyslinkComponent.
Referenced by setupTriggerSignals().
|
inlinevirtual |
Where the component comes in the recommended order of setting up a vehicle, lowest first. Components that do not set one come after those that do.
Reimplemented in ActuatorComponent, AirframeComponent, PX4BatteryComponent, PX4RadioComponent, and SensorsComponent.
Definition at line 58 of file VehicleComponent.h.
|
pure virtual |
Implemented in ActuatorComponent, AirframeComponent, APMAdvancedTuningCopterComponent, APMAirframeComponent, APMAirspeedComponent, APMESCComponent, APMFailsafesComponent, APMFlightModesComponent, APMFlightSafetyComponent, APMFollowComponent, APMGimbalComponent, APMHeliComponent, APMLightsComponent, APMLoggingComponent, APMMotorComponent, APMPowerComponent, APMRadioComponent, APMRemoteSupportComponent, APMSafetyComponent, APMSensorsComponent, APMServoComponent, APMSubFrameComponent, APMTuningComponent, ESP8266Component, FailureInjectionComponent, FlightModesComponent, JoystickComponent, MotorComponent, PX4BatteryComponent, PX4CollisionComponent, PX4EscComponent, PX4FailsafesComponent, PX4FlightBehavior, PX4RadioComponent, PX4ReturnLandComponent, PX4SerialPortsComponent, PX4TuningComponent, ScriptingComponent, SensorsComponent, and SyslinkComponent.
|
signal |
|
virtual |
Should be called after the component is created (but not in constructor) to setup the signals which are used to track parameter changes which affect setupComplete state.
Reimplemented in AirframeComponent, FlightModesComponent, PX4BatteryComponent, and PX4RadioComponent.
Definition at line 259 of file VehicleComponent.cc.
References _triggerUpdated(), _vehicle, ParameterManager::defaultComponentId, sectionIdsChanged(), setupCompleteChangedTriggerList(), summaryChangedTriggerList(), summaryItemsChanged(), and Fact::valueChanged().
Referenced by AirframeComponent::setupTriggerSignals(), FlightModesComponent::setupTriggerSignals(), PX4BatteryComponent::setupTriggerSignals(), and PX4RadioComponent::setupTriggerSignals().
|
inlinevirtual |
When true, clicking the root component in the tree selects the first section instead of showing all.
Definition at line 88 of file VehicleComponent.h.
|
inlinevirtual |
Parameters whose change emits summaryItemsChanged, besides those that change setupComplete.
Reimplemented in AirframeComponent, FlightModesComponent, PX4BatteryComponent, PX4CollisionComponent, PX4EscComponent, PX4FailsafesComponent, PX4RadioComponent, PX4ReturnLandComponent, PX4SerialPortsComponent, and SensorsComponent.
Definition at line 67 of file VehicleComponent.h.
Referenced by setupTriggerSignals().
|
inlinevirtual |
Values for this component's card on the Summary page. A component with none falls back to summaryQmlSource().
Reimplemented in ActuatorComponent, AirframeComponent, FlightModesComponent, PX4BatteryComponent, PX4CollisionComponent, PX4EscComponent, PX4FailsafesComponent, PX4RadioComponent, PX4ReturnLandComponent, PX4SerialPortsComponent, and SensorsComponent.
Definition at line 64 of file VehicleComponent.h.
|
signal |
|
pure virtual |
Implemented in ActuatorComponent, AirframeComponent, APMAdvancedTuningCopterComponent, APMAirframeComponent, APMAirspeedComponent, APMESCComponent, APMFailsafesComponent, APMFlightModesComponent, APMFlightSafetyComponent, APMFollowComponent, APMGimbalComponent, APMHeliComponent, APMLightsComponent, APMLoggingComponent, APMPowerComponent, APMRadioComponent, APMRemoteSupportComponent, APMSafetyComponent, APMSensorsComponent, APMServoComponent, APMSubFrameComponent, APMTuningComponent, ESP8266Component, FailureInjectionComponent, FlightModesComponent, JoystickComponent, MotorComponent, PX4BatteryComponent, PX4CollisionComponent, PX4EscComponent, PX4FailsafesComponent, PX4FlightBehavior, PX4RadioComponent, PX4ReturnLandComponent, PX4SerialPortsComponent, PX4TuningComponent, ScriptingComponent, SensorsComponent, and SyslinkComponent.
|
inlinevirtual |
Resource path to a VehicleConfig.json page definition, or empty if none.
Reimplemented in APMFailsafesComponent, APMFlightSafetyComponent, APMLoggingComponent, APMPowerComponent, APMSafetyComponent, and APMTuningComponent.
Definition at line 70 of file VehicleComponent.h.
|
protected |
Definition at line 129 of file VehicleComponent.h.
Referenced by VehicleComponent().
|
protected |
Definition at line 130 of file VehicleComponent.h.
Referenced by KnownVehicleComponent(), and VehicleComponent().
|
protected |
Definition at line 128 of file VehicleComponent.h.
Referenced by _parameterFact(), APMSensorsComponent::accelSetupNeeded(), APMRadioComponent::APMRadioComponent(), APMSensorsComponent::compassSetupNeeded(), APMFailsafesComponent::description(), APMFlightSafetyComponent::description(), APMSafetyComponent::description(), PX4RadioComponent::requiresSetup(), sectionIds(), AirframeComponent::setupComplete(), APMRadioComponent::setupComplete(), PX4BatteryComponent::setupComplete(), PX4RadioComponent::setupComplete(), SensorsComponent::setupComplete(), APMAdvancedTuningCopterComponent::setupSource(), APMFailsafesComponent::setupSource(), APMFlightSafetyComponent::setupSource(), APMMotorComponent::setupSource(), APMSafetyComponent::setupSource(), APMTuningComponent::setupSource(), PX4FlightBehavior::setupSource(), PX4TuningComponent::setupSource(), AirframeComponent::setupTriggerSignals(), FlightModesComponent::setupTriggerSignals(), PX4BatteryComponent::setupTriggerSignals(), PX4RadioComponent::setupTriggerSignals(), setupTriggerSignals(), PX4SerialPortsComponent::summaryChangedTriggerList(), AirframeComponent::summaryItems(), PX4FailsafesComponent::summaryItems(), PX4RadioComponent::summaryItems(), PX4SerialPortsComponent::summaryItems(), APMFailsafesComponent::summaryQmlSource(), APMFlightSafetyComponent::summaryQmlSource(), APMSafetyComponent::summaryQmlSource(), and VehicleComponent().