QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
VehicleComponent Class Referenceabstract

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>

+ Inheritance diagram for VehicleComponent:
+ Collaboration diagram for VehicleComponent:

Signals

void setupCompleteChanged ()
 
void setupSourceChanged ()
 
void sectionsChanged ()
 

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 bool setupComplete () const =0
 
virtual QUrl setupSource () const =0
 
virtual QUrl summaryQmlSource () const =0
 
virtual QString vehicleConfigJson () const
 Resource path to a VehicleConfig.json page definition, or empty if none.
 
virtual QStringList sections () const
 
QVariantMap sectionKeywords () const
 Search keywords per section, keyed by section title. Values are original-case translatable terms.
 
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 &sectionName) const
 Returns setup-complete status for a named section. 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 Attributes

Vehicle_vehicle = nullptr
 
AutoPilotPlugin_autopilot = nullptr
 
AutoPilotPlugin::KnownVehicleComponent _KnownVehicleComponent
 

Detailed Description

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 18 of file VehicleComponent.h.

Constructor & Destructor Documentation

◆ VehicleComponent()

VehicleComponent::VehicleComponent ( Vehicle vehicle,
AutoPilotPlugin autopilot,
AutoPilotPlugin::KnownVehicleComponent  KnownVehicleComponent,
QObject *  parent = nullptr 
)
explicit

Definition at line 16 of file VehicleComponent.cc.

◆ ~VehicleComponent()

VehicleComponent::~VehicleComponent ( )
virtual

Definition at line 29 of file VehicleComponent.cc.

Member Function Documentation

◆ _triggerUpdated

void VehicleComponent::_triggerUpdated ( QVariant  )
inlineprotectedslot

◆ addSummaryQmlComponent()

void VehicleComponent::addSummaryQmlComponent ( QQmlContext *  context,
QQuickItem *  parent 
)
virtual

Definition at line 234 of file VehicleComponent.cc.

◆ allowSetupWhileArmed()

◆ allowSetupWhileFlying()

virtual bool VehicleComponent::allowSetupWhileFlying ( void  ) const
inlinevirtual

◆ description()

◆ iconResource()

◆ KnownVehicleComponent()

AutoPilotPlugin::KnownVehicleComponent VehicleComponent::KnownVehicleComponent ( ) const
inline

Definition at line 83 of file VehicleComponent.h.

References _KnownVehicleComponent.

Referenced by AutoPilotPlugin::findKnownVehicleComponent().

◆ name()

◆ requiresSetup()

◆ sectionKeywords()

QVariantMap VehicleComponent::sectionKeywords ( ) const

Search keywords per section, keyed by section title. Values are original-case translatable terms.

Definition at line 66 of file VehicleComponent.cc.

◆ sections()

QStringList VehicleComponent::sections ( ) const
virtual

Section names for sidebar navigation. Auto-populated from vehicleConfigJson() JSON. Repeat sections are expanded by probing vehicle parameters.

Reimplemented in FlightModesComponent, and SensorsComponent.

Definition at line 34 of file VehicleComponent.cc.

References _vehicle, ParameterManager::defaultComponentId, and Vehicle::parameterManager().

◆ sectionsChanged

void VehicleComponent::sectionsChanged ( )
signal

Referenced by setupTriggerSignals().

◆ sectionSetupComplete()

virtual Q_INVOKABLE bool VehicleComponent::sectionSetupComplete ( const QString &  sectionName) const
inlinevirtual

Returns setup-complete status for a named section. Default returns true (no per-section tracking).

Reimplemented in SensorsComponent.

Definition at line 65 of file VehicleComponent.h.

◆ setupComplete()

◆ setupCompleteChanged

◆ setupCompleteChangedTriggerList()

◆ setupSource()

◆ setupSourceChanged

void VehicleComponent::setupSourceChanged ( )
signal

◆ setupTriggerSignals()

void VehicleComponent::setupTriggerSignals ( )
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.

Definition at line 257 of file VehicleComponent.cc.

References _triggerUpdated(), _vehicle, ParameterManager::defaultComponentId, ParameterManager::getParameter(), ParameterManager::parameterExists(), Vehicle::parameterManager(), sectionsChanged(), setupCompleteChangedTriggerList(), and Fact::valueChanged().

Referenced by GenericAutoPilotPlugin::vehicleComponents(), APMAutoPilotPlugin::vehicleComponents(), and PX4AutoPilotPlugin::vehicleComponents().

◆ showFirstSectionOnRootClick()

virtual bool VehicleComponent::showFirstSectionOnRootClick ( ) const
inlinevirtual

When true, clicking the root component in the tree selects the first section instead of showing all.

Reimplemented in SensorsComponent.

Definition at line 62 of file VehicleComponent.h.

◆ summaryQmlSource()

◆ vehicleConfigJson()

virtual QString VehicleComponent::vehicleConfigJson ( void  ) const
inlinevirtual

Resource path to a VehicleConfig.json page definition, or empty if none.

Reimplemented in APMFailsafesComponent, APMFlightSafetyComponent, APMLoggingComponent, APMPowerComponent, APMSafetyComponent, APMTuningComponent, PowerComponent, and SafetyComponent.

Definition at line 52 of file VehicleComponent.h.

Member Data Documentation

◆ _autopilot

AutoPilotPlugin* VehicleComponent::_autopilot = nullptr
protected

Definition at line 95 of file VehicleComponent.h.

◆ _KnownVehicleComponent

AutoPilotPlugin::KnownVehicleComponent VehicleComponent::_KnownVehicleComponent
protected

Definition at line 96 of file VehicleComponent.h.

Referenced by KnownVehicleComponent().

◆ _vehicle


The documentation for this class was generated from the following files: