|
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 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 QString | showAdvancedUIMessage () 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 | 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 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 | stableDownloadLocation () 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 36 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 124 of file QGCCorePlugin.cc.
References 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 59 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 382 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 411 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 89 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 278 of file QGCCorePlugin.cc.
References JoystickManager::instance().
|
virtual |
Allows the plugin to override the creation of the root (native) window.
Definition at line 286 of file QGCCorePlugin.cc.
|
virtual |
Allows the plugin to override the creation of VideoReceiver.
Definition at line 291 of file QGCCorePlugin.cc.
References GStreamer::createVideoReceiver(), and QtMultimediaReceiver::createVideoReceiver().
|
virtual |
Allows the plugin to override the creation of VideoSink.
Definition at line 303 of file QGCCorePlugin.cc.
References GStreamer::createVideoSink(), and QtMultimediaReceiver::createVideoSink().
|
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 119 of file QGCCorePlugin.cc.
|
inlinevirtual |
The default settings panel to show
Definition at line 67 of file QGCCorePlugin.h.
|
virtual |
Definition at line 164 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 189 of file QGCCorePlugin.h.
Referenced by firstRunPromptsToShow().
|
virtual |
Returns the resource which contains the specified first run prompt for display.
Definition at line 356 of file QGCCorePlugin.cc.
References kInitialSetupPromptId.
|
inlinevirtual |
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 184 of file QGCCorePlugin.h.
References kInitialSetupPromptId.
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 336 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 199 of file QGCCorePlugin.h.
|
inlinevirtual |
Definition at line 58 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(), MissionController::insertComplexMissionItem(), MissionController::insertComplexMissionItemFromKMLOrSHP(), PlanMasterController::loadFromFile(), PlanMasterController::saveToJson(), and QGCApplication::shutdown().
|
inlinevirtual |
Definition at line 205 of file QGCCorePlugin.h.
|
inlinevirtual |
Allows the plugin to see all mavlink traffic to a vehicle
Definition at line 112 of file QGCCorePlugin.h.
|
virtual |
|
inlinevirtual |
Allows the core plugin to override the visibility for a settings group
| name | - SettingsGroup name |
Definition at line 76 of file QGCCorePlugin.h.
|
inlinevirtual |
Allows a plugin to override the specified color name from the palette.
Definition at line 92 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 401 of file QGCCorePlugin.cc.
|
inlinevirtual |
Allows custom builds to load custom items from the plan file after the document is parsed.
Definition at line 130 of file QGCCorePlugin.h.
Referenced by PlanMasterController::loadFromFile().
|
inlinevirtual |
Allows custom builds to add custom items to the plan file after the document is created.
Definition at line 120 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 125 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 128 of file QGCCorePlugin.h.
Referenced by PlanMasterController::loadFromFile().
|
inlinevirtual |
Allows custom builds to add custom items to the plan file before the document is created.
Definition at line 118 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 123 of file QGCCorePlugin.h.
Referenced by PlanMasterController::saveToJson().
|
virtual |
Allows the plugin to override the release of VideoSink.
Definition at line 314 of file QGCCorePlugin.cc.
References GStreamer::releaseVideoSink(), and QtMultimediaReceiver::releaseVideoSink().
Referenced by VideoManager::cleanup().
|
inline |
Definition at line 211 of file QGCCorePlugin.h.
References _showAdvancedUI.
|
signal |
|
virtual |
Definition at line 156 of file QGCCorePlugin.cc.
|
inline |
Definition at line 210 of file QGCCorePlugin.h.
References _showTouchAreas.
|
signal |
|
inlinevirtual |
Returns the user visible url to show user where to download new stable builds from. Custom builds must override to provide their own location.
Definition at line 146 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 141 of file QGCCorePlugin.h.
|
virtual |
Returns the list of toolbar indicators which are not related to a vehicle
Definition at line 325 of file QGCCorePlugin.cc.
|
protected |
Definition at line 225 of file QGCCorePlugin.h.
Referenced by showAdvancedUI().
|
protected |
Definition at line 224 of file QGCCorePlugin.h.
Referenced by showTouchAreas().
|
staticconstexpr |
Definition at line 217 of file QGCCorePlugin.h.
|
staticconstexpr |
Definition at line 214 of file QGCCorePlugin.h.
Referenced by firstRunPromptResource(), and firstRunPromptStdIds().