|
QGroundControl
Ground Control Station for MAVLink Drones
|
Extension mechanism for generic, non-firmware-specific customization of QGC. More...
#include <QGCCorePlugin.h>
Inheritance diagram for QGCCorePlugin:
Collaboration diagram for QGCCorePlugin:Classes | |
| struct | JoystickAction |
Signals | |
| void | showTouchAreasChanged (bool showTouchAreas) |
| void | showAdvancedUIChanged (bool showAdvancedUI) |
Public Member Functions | |
| QGCCorePlugin (QObject *parent=nullptr) | |
| virtual | ~QGCCorePlugin () |
| virtual void | init () |
| virtual void | cleanup () |
| virtual void | linkConfigurationsLoaded (LinkManager *linkManager) |
| Called at boot after saved link configurations are loaded and before auto-connect links are started. | |
| virtual const QVariantList & | analyzePages () |
| virtual int | defaultSettings () |
| virtual QGCOptions * | options () |
| virtual bool | overrideSettingsGroupVisibility (const QString &name) |
| virtual void | adjustSettingMetaData (const QString &settingsGroup, FactMetaData &metaData, bool &userVisible) |
| virtual void | registerCustomSettings (SettingsManager *settingsManager) |
| virtual QString | showAdvancedUIMessage () const |
| virtual bool | showInitialSetupVehiclePreferences () const |
| virtual bool | showInitialSetupMeasurementUnits () const |
| virtual QGeoPositionInfoSource * | createPositionSource (QObject *parent) |
| virtual void | paletteOverride (const QString &colorName, QGCPalette::PaletteColorInfo_t &colorInfo) |
| Allows a plugin to override the specified color name from the palette. | |
| virtual void | factValueGridCreateDefaultSettings (FactValueGrid *factValueGrid) |
| virtual QQmlApplicationEngine * | createQmlApplicationEngine (QObject *parent) |
| virtual void | destroyQmlApplicationEngine (QQmlApplicationEngine *qmlEngine) |
| virtual void | createRootWindow (QQmlApplicationEngine *qmlEngine) |
| Allows the plugin to override the creation of the root (native) window. | |
| virtual VideoReceiver * | createVideoReceiver (QObject *parent) |
| Allows the plugin to override the creation of VideoReceiver. | |
| virtual void * | createVideoSink (QQuickItem *widget, QObject *parent) |
| Allows the plugin to override the creation of VideoSink. | |
| virtual void | releaseVideoSink (void *sink) |
| Allows the plugin to override the release of VideoSink. | |
| virtual bool | mavlinkMessage (Vehicle *vehicle, LinkInterface *link, const mavlink_message_t &message) |
| virtual const QmlObjectListModel * | customMapItems () |
| Allows custom builds to add custom items to the FlightMap. Objects put into QmlObjectListModel should derive from QmlComponentInfo and set the url property. | |
| virtual const QmlObjectListModel * | customGeoMapItems () |
| virtual void | preSaveToJson (PlanMasterController *pController, QJsonObject &json) |
| Allows custom builds to add custom items to the plan file before the document is created. | |
| virtual void | postSaveToJson (PlanMasterController *pController, QJsonObject &json) |
| Allows custom builds to add custom items to the plan file after the document is created. | |
| virtual void | preSaveToMissionJson (PlanMasterController *pController, QJsonObject &missionJson) |
| Allows custom builds to add custom items to the mission section of the plan file before the item is created. | |
| virtual void | postSaveToMissionJson (PlanMasterController *pController, QJsonObject &missionJson) |
| Allows custom builds to add custom items to the mission section of the plan file after the item is created. | |
| virtual void | preLoadFromJson (PlanMasterController *pController, QJsonObject &json) |
| Allows custom builds to load custom items from the plan file before the document is parsed. | |
| virtual void | postLoadFromJson (PlanMasterController *pController, QJsonObject &json) |
| Allows custom builds to load custom items from the plan file after the document is parsed. | |
| virtual QString | stableVersionCheckFileUrl () const |
| virtual QString | stableDownloadUrl () const |
| virtual QVariantList | complexMissionItemNames (Vehicle *vehicle) |
| virtual ComplexMissionItem * | createComplexMissionItem (const QString &complexItemType, PlanMasterController *masterController, bool flyView, const QString &kmlOrShpFile=QString()) |
| virtual QList< PlanCreator * > | planCreators (PlanMasterController *planMasterController) |
| virtual QList< int > | firstRunPromptStdIds () |
| virtual QList< int > | firstRunPromptCustomIds () |
| virtual Q_INVOKABLE QString | firstRunPromptResource (int id) const |
| Returns the resource which contains the specified first run prompt for display. | |
| virtual const QVariantList & | toolBarIndicators () |
| virtual bool | getOfflineCameraDefinitionFile (const QString &cameraName, QFile &file) |
| Returns a true if xml definition file of a providen camera name exists, and loads it to file argument, to allow definition files to be loaded from resources. | |
| virtual QList< JoystickAction > | joystickActions () |
| Q_INVOKABLE QVariantList | firstRunPromptsToShow () |
| Returns the list of first run prompt ids which need to be displayed according to current settings. | |
| bool | showTouchAreas () const |
| bool | showAdvancedUI () const |
Static Public Member Functions | |
| static QGCCorePlugin * | instance () |
Static Public Attributes | |
| static constexpr int | kInitialSetupPromptId = 3 |
| static constexpr int | kFirstRunPromptIdsFirstCustomId = 10000 |
Protected Attributes | |
| bool | _showTouchAreas = false |
| bool | _showAdvancedUI = true |
Extension mechanism for generic, non-firmware-specific customization of QGC.
QGCCorePlugin is the extension point for custom builds that need to modify QGC as a whole, rather than for behavior that varies by firmware type (which belongs in FirmwarePlugin). Override its virtual methods to add or replace UI pages, Flight Map items, toolbar indicators, video pipeline components, plan file hooks, and other application-level behavior. The base class provides the standard QGC implementation; custom builds subclass it and register the subclass before QGCApplication starts up.
Definition at line 38 of file QGCCorePlugin.h.
|
explicit |
Definition at line 51 of file QGCCorePlugin.cc.
|
virtual |
Definition at line 59 of file QGCCorePlugin.cc.
|
virtual |
Allows the core plugin to override the meta data before the fact is created.
| settingsGroup | - QSettings group which contains this item |
| metaData | - MetaData for setting fact |
| userVisible | - true: Setting should be visible in ui, false: Setting should not be shown in ui (default value will be used as value) If not overridden, metaData and userVisible are left unchanged. |
Definition at line 132 of file QGCCorePlugin.cc.
References AndroidSerial::hasPosixSerialPorts(), FactMetaData::name(), FactMetaData::setRawDefaultValue(), and SettingsGroup::settingsGroup().
Referenced by SettingsManager::adjustSettingMetaData().
|
virtual |
The list of pages/buttons under the Analyze Menu
Definition at line 73 of file QGCCorePlugin.cc.
|
inlinevirtual |
Definition at line 65 of file QGCCorePlugin.h.
Referenced by QGCApplication::shutdown().
|
virtual |
Returns the complex mission items to display in the Plan UI. Each entry in the list is a QVariantMap with keys: "canonicalName" - untranslated key used with insertComplexMissionItem() "translatedName" - user-visible display string (already translated) The base class builds and returns the default set. Custom builds should override this method, call the base class to get the defaults, modify as needed, and return the result. When adding a new entry, set both keys and override createComplexMissionItem() to handle the new canonicalName.
| vehicle | Vehicle for which the list is being built |
Definition at line 402 of file QGCCorePlugin.cc.
References CorridorScanComplexItem::canonicalName, StructureScanComplexItem::canonicalName, SurveyComplexItem::canonicalName, Vehicle::multiRotor(), and Vehicle::vtol().
Referenced by MissionController::complexMissionItems().
|
virtual |
Factory for creating custom complex mission items. Called by MissionController when the canonicalName/complexItemType is not one of the built-in types (Survey, CorridorScan, StructureScan, FixedWingLanding, VTOLLanding). For JSON load, the returned item has load() called on it immediately afterward.
| complexItemType | The canonicalName / jsonComplexItemTypeValue identifying the item |
| masterController | PlanMasterController for the item |
| flyView | true if creating for fly view (read-only) |
| kmlOrShpFile | Optional KML/SHP file to initialize from; QString() if none |
Definition at line 431 of file QGCCorePlugin.cc.
References CorridorScanComplexItem::canonicalName, FixedWingLandingComplexItem::canonicalName, StructureScanComplexItem::canonicalName, SurveyComplexItem::canonicalName, VTOLLandingComplexItem::canonicalName, CorridorScanComplexItem::jsonComplexItemTypeValue, FixedWingLandingComplexItem::jsonComplexItemTypeValue, StructureScanComplexItem::jsonComplexItemTypeValue, SurveyComplexItem::jsonComplexItemTypeValue, and VTOLLandingComplexItem::jsonComplexItemTypeValue.
Referenced by MissionController::insertComplexMissionItem(), and MissionController::insertComplexMissionItemFromKMLOrSHP().
|
inlinevirtual |
Definition at line 109 of file QGCCorePlugin.h.
|
virtual |
Allows the plugin to override or get access to the QmlApplicationEngine to do things like add import path or stuff things into the context prior to window creation.
Definition at line 305 of file QGCCorePlugin.cc.
References JoystickManager::instance().
|
virtual |
Allows the plugin to override the creation of the root (native) window.
Definition at line 318 of file QGCCorePlugin.cc.
|
virtual |
Allows the plugin to override the creation of VideoReceiver.
Definition at line 323 of file QGCCorePlugin.cc.
References VideoBackend::createReceiver().
|
virtual |
Allows the plugin to override the creation of VideoSink.
Definition at line 328 of file QGCCorePlugin.cc.
References VideoBackend::createSink().
|
virtual |
GeoMap counterpart of customMapItems, shown when the Fly View uses the GeoMap engine. Same QmlComponentInfo/url contract; each component is created in the map with its customMapObject, scene and surfaceModel properties set, so its root should be a GeoMapItem (or declare those properties and pass scene/surfaceModel on to GeoMap items).
Definition at line 127 of file QGCCorePlugin.cc.
|
virtual |
Allows custom builds to add custom items to the FlightMap. Objects put into QmlObjectListModel should derive from QmlComponentInfo and set the url property.
Definition at line 122 of file QGCCorePlugin.cc.
|
inlinevirtual |
The default settings panel to show
Definition at line 76 of file QGCCorePlugin.h.
|
virtual |
Symmetric counterpart to createQmlApplicationEngine. Engines obtained from the create hook must be destroyed through this hook so the plugin can release any per-engine state it attached at creation (url interceptors, etc) before the engine goes away.
Definition at line 313 of file QGCCorePlugin.cc.
Referenced by QGCApplication::shutdown().
|
virtual |
Definition at line 191 of file QGCCorePlugin.cc.
References FactValueGrid::appendColumn(), FactValueGrid::appendRow(), FactValueGrid::columns(), FactValueGrid::DefaultFontSize, FactValueGrid::MediumFontSize, InstrumentValueData::setFact(), FactValueGrid::setFontSize(), FactValueGrid::specificVehicleForCard(), QmlObjectListModel::value(), FactValueGrid::vehicleClass(), QGCMAVLink::VehicleClassAirship, QGCMAVLink::VehicleClassFixedWing, and QGCMAVLink::VehicleClassVTOL.
|
inlinevirtual |
Returns the custom build list of first run prompt ids for possible display. Actual display is based on the current AppSettings::firstRunPromptIds value. The order of this list also determines the order the prompts will be displayed in.
Definition at line 219 of file QGCCorePlugin.h.
Referenced by firstRunPromptsToShow().
|
virtual |
Returns the resource which contains the specified first run prompt for display.
Definition at line 376 of file QGCCorePlugin.cc.
References kInitialSetupPromptId.
|
virtual |
Returns the standard list of first run prompt ids for possible display. Actual display is based on the current AppSettings::firstRunPromptIds value. The order of this list also determines the order the prompts will be displayed in.
Definition at line 347 of file QGCCorePlugin.cc.
References kInitialSetupPromptId, showInitialSetupMeasurementUnits(), and showInitialSetupVehiclePreferences().
Referenced by firstRunPromptsToShow().
| QVariantList QGCCorePlugin::firstRunPromptsToShow | ( | ) |
Returns the list of first run prompt ids which need to be displayed according to current settings.
Definition at line 356 of file QGCCorePlugin.cc.
References firstRunPromptCustomIds(), AppSettings::firstRunPromptsIdsVariantToList(), firstRunPromptStdIds(), and SettingsManager::instance().
|
inlinevirtual |
Returns a true if xml definition file of a providen camera name exists, and loads it to file argument, to allow definition files to be loaded from resources.
Definition at line 229 of file QGCCorePlugin.h.
|
inlinevirtual |
Definition at line 64 of file QGCCorePlugin.h.
|
static |
Definition at line 64 of file QGCCorePlugin.cc.
Referenced by VehicleCameraControl::_dataReady(), SettingsManager::adjustSettingMetaData(), VideoManager::cleanup(), MissionController::complexMissionItems(), ComplexMissionItem::deletePreset(), SettingsManager::init(), MissionController::insertComplexMissionItem(), MissionController::insertComplexMissionItemFromKMLOrSHP(), PlanMasterController::saveToJson(), QGCApplication::shutdown(), and QGCVersionCheck::start().
|
inlinevirtual |
Definition at line 235 of file QGCCorePlugin.h.
|
inlinevirtual |
Called at boot after saved link configurations are loaded and before auto-connect links are started.
Definition at line 68 of file QGCCorePlugin.h.
|
inlinevirtual |
Allows the plugin to see all mavlink traffic to a vehicle
Definition at line 137 of file QGCCorePlugin.h.
|
virtual |
|
inlinevirtual |
Allows the core plugin to override the visibility for a settings group
| name | - SettingsGroup name |
Definition at line 85 of file QGCCorePlugin.h.
|
inlinevirtual |
Allows a plugin to override the specified color name from the palette.
Definition at line 112 of file QGCCorePlugin.h.
|
virtual |
Returns the list of plan creators to show when creating a new plan. Custom builds can override to provide their own set of plan creators.
| planMasterController | The plan master controller for the plan being created |
Definition at line 421 of file QGCCorePlugin.cc.
|
inlinevirtual |
Allows custom builds to load custom items from the plan file after the document is parsed.
Definition at line 160 of file QGCCorePlugin.h.
|
inlinevirtual |
Allows custom builds to add custom items to the plan file after the document is created.
Definition at line 150 of file QGCCorePlugin.h.
Referenced by PlanMasterController::saveToJson().
|
inlinevirtual |
Allows custom builds to add custom items to the mission section of the plan file after the item is created.
Definition at line 155 of file QGCCorePlugin.h.
Referenced by PlanMasterController::saveToJson().
|
inlinevirtual |
Allows custom builds to load custom items from the plan file before the document is parsed.
Definition at line 158 of file QGCCorePlugin.h.
|
inlinevirtual |
Allows custom builds to add custom items to the plan file before the document is created.
Definition at line 148 of file QGCCorePlugin.h.
Referenced by PlanMasterController::saveToJson().
|
inlinevirtual |
Allows custom builds to add custom items to the mission section of the plan file before the item is created.
Definition at line 153 of file QGCCorePlugin.h.
Referenced by PlanMasterController::saveToJson().
|
inlinevirtual |
Called at the end of SettingsManager::init. Override to register custom build settings groups via SettingsManager::registerCustomSettingsGroup so generated settings pages can reference them as QGroundControl.settingsManager.<accessor>.
Definition at line 97 of file QGCCorePlugin.h.
Referenced by SettingsManager::init().
|
virtual |
Allows the plugin to override the release of VideoSink.
Definition at line 333 of file QGCCorePlugin.cc.
References VideoBackend::releaseSink().
Referenced by VideoManager::cleanup().
|
inline |
Definition at line 241 of file QGCCorePlugin.h.
References _showAdvancedUI.
|
signal |
|
virtual |
Definition at line 173 of file QGCCorePlugin.cc.
|
virtual |
Definition at line 186 of file QGCCorePlugin.cc.
Referenced by firstRunPromptStdIds().
|
virtual |
Definition at line 181 of file QGCCorePlugin.cc.
References FirmwarePluginManager::instance(), and FirmwarePluginManager::singleVehicleSupport().
Referenced by firstRunPromptStdIds().
|
inline |
Definition at line 240 of file QGCCorePlugin.h.
References _showTouchAreas.
|
signal |
|
inlinevirtual |
Returns the full URL (including scheme) opened by the Update button and the new version dialog link. Custom builds must override to provide their own location.
Definition at line 176 of file QGCCorePlugin.h.
|
inlinevirtual |
Returns the url to download the stable version check file. Return QString() to indicate no version check should be performed. Default QGC mainline implemenentation returns QGC Stable file location. Default QGC custom build code returns QString(). Custom builds can override to turn on and provide their own location. The contents of this file should be a single line in the form: v3.4.4 This indicates the latest stable version number.
Definition at line 171 of file QGCCorePlugin.h.
Referenced by QGCVersionCheck::start().
|
virtual |
Returns the list of toolbar indicators which are not related to a vehicle
Definition at line 338 of file QGCCorePlugin.cc.
|
protected |
Definition at line 255 of file QGCCorePlugin.h.
Referenced by showAdvancedUI().
|
protected |
Definition at line 254 of file QGCCorePlugin.h.
Referenced by showTouchAreas().
|
staticconstexpr |
Definition at line 247 of file QGCCorePlugin.h.
|
staticconstexpr |
Definition at line 244 of file QGCCorePlugin.h.
Referenced by firstRunPromptResource(), and firstRunPromptStdIds().