3#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
8#ifndef QGC_NO_SERIAL_LINK
37#ifdef QGC_CUSTOM_BUILD
41#include <QtCore/QApplicationStatic>
42#include <QtCore/QFile>
43#include <QtQml/QQmlApplicationEngine>
44#include <QtQml/QQmlContext>
45#include <QtQuick/QQuickItem>
49#ifndef QGC_CUSTOM_BUILD
58 qCDebug(QGCCorePluginLog) <<
this;
63 qCDebug(QGCCorePluginLog) <<
this;
68#ifndef QGC_CUSTOM_BUILD
69 return _qgcCorePluginInstance();
71 return CUSTOMCLASS::instance();
81#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
82 static const QVariantList analyzeList = {
84 static const QVariantList analyzeList = {
87 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/LogViewer/LogViewerPage.qml")),
88 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/MAVLinkInspector.svg")))),
92 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/OnboardLogs/OnboardLogPage.qml")),
93 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/OnboardLogIcon.svg")),
97 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/GeoTag/GeoTagPage.qml")),
98 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/GeoTag/GeoTagIcon.svg")))),
100 tr(
"MAVLink Console"),
101 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/MAVLinkConsole/MAVLinkConsolePage.qml")),
102 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/MAVLinkConsoleIcon.svg")),
105 tr(
"MAVLink Inspector"),
106 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/MAVLinkInspector/MAVLinkInspectorPage.qml")),
107 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/MAVLinkInspector.svg")),
111 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/Vibration/VibrationPage.qml")),
112 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/VibrationPageIcon")),
121 return _defaultOptions;
126 return _emptyCustomMapItems;
142 if (metaData.
name() == AppSettings::indoorPaletteName) {
143 QVariant outdoorPalette;
144#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
152#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
153 else if (metaData.
name() == MavlinkSettings::telemetrySaveName) {
159 else if (metaData.
name() == AppSettings::androidDontSaveToSDCardName) {
164 else if (metaData.
name() == AppSettings::androidUsePosixSerialName) {
165#if defined(Q_OS_ANDROID) && !defined(QGC_NO_SERIAL_LINK)
178 return tr(
"WARNING: You are about to enter Advanced Mode. "
179 "If used incorrectly, this may cause your vehicle to malfunction thus voiding your warranty. "
180 "You should do so only if instructed by customer support. "
181 "Are you sure you want to enable Advanced Mode?");
186#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
205 value->
setFact(
"Vehicle",
"AltitudeRelative");
206 value->setIcon(
"arrow-thick-up.svg");
207 value->setText(value->fact()->shortDescription());
208 value->setShowUnits(
true);
213 if (includeFWValues) {
214 value->
setFact(
"Vehicle",
"AirSpeed");
215 value->setText(
"AirSpd");
216 value->setShowUnits(
true);
218 value->setFact(
"Vehicle",
"GroundSpeed");
219 value->setIcon(
"arrow-simple-right.svg");
220 value->setText(value->fact()->shortDescription());
221 value->setShowUnits(
true);
231 if (includeFWValues) {
240 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"AltitudeRelative"));
241 value->setIcon(QStringLiteral(
"arrow-thick-up.svg"));
242 value->setText(value->fact()->shortDescription());
243 value->setShowUnits(
true);
246 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"DistanceToHome"));
247 value->setIcon(QStringLiteral(
"bookmark copy 3.svg"));
248 value->setText(value->fact()->shortDescription());
249 value->setShowUnits(
true);
255 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"ClimbRate"));
256 value->setIcon(QStringLiteral(
"arrow-simple-up.svg"));
257 value->setText(value->fact()->shortDescription());
258 value->setShowUnits(
true);
261 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"GroundSpeed"));
262 value->setIcon(QStringLiteral(
"arrow-simple-right.svg"));
263 value->setText(value->fact()->shortDescription());
264 value->setShowUnits(
true);
266 if (includeFWValues) {
271 value->setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"AirSpeed"));
272 value->setText(QStringLiteral(
"AirSpd"));
273 value->setShowUnits(
true);
276 value->setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"ThrottlePct"));
277 value->setText(QStringLiteral(
"Thr"));
278 value->setShowUnits(
true);
285 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"FlightTime"));
286 value->setIcon(QStringLiteral(
"timer.svg"));
287 value->setText(value->fact()->shortDescription());
288 value->setShowUnits(
false);
291 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"FlightDistance"));
292 value->setIcon(QStringLiteral(
"travel-walk.svg"));
293 value->setText(value->fact()->shortDescription());
294 value->setShowUnits(
true);
300 QQmlApplicationEngine *
const qmlEngine =
new QQmlApplicationEngine(parent);
301 qmlEngine->addImportPath(QStringLiteral(
"qrc:/qml"));
313 qmlEngine->load(QUrl(QStringLiteral(
"qrc:/qml/QGroundControl/MainWindow.qml")));
333 static const QVariantList toolBarIndicatorList = QVariantList(
335 QVariant::fromValue(QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/Toolbar/RTKGPSIndicator.qml"))),
339 return toolBarIndicatorList;
344 QList<int> rgIdsToShow;
350 for (
int idToRemove: rgAlreadyShownIds) {
351 (void) rgIdsToShow.removeOne(idToRemove);
354 QVariantList rgVarIdsToShow;
355 for (
int id: rgIdsToShow) {
356 rgVarIdsToShow.append(
id);
359 return rgVarIdsToShow;
366 return QStringLiteral(
"/qml/QGroundControl/FirstRunPromptDialogs/InitialSetupPrompt.qml");
372void QGCCorePlugin::_setShowTouchAreas(
bool show)
380void QGCCorePlugin::_setShowAdvancedUI(
bool show)
390 auto makeEntry = [](
const char* canonical,
const QString& translated) {
392 entry[QStringLiteral(
"canonicalName")] = QString(canonical);
393 entry[QStringLiteral(
"translatedName")] = translated;
418 const QString &complexItemType,
421 const QString &kmlOrShpFile)
435 qCWarning(QGCCorePluginLog) <<
"QGCCorePlugin::createComplexMissionItem - Unknown complex item type:" << complexItemType;
Q_APPLICATION_STATIC(QGCCorePlugin, _qgcCorePluginInstance)
#define QGC_LOGGING_CATEGORY(name, categoryStr)
static QList< int > firstRunPromptsIdsVariantToList(const QVariant &firstRunPromptIds)
static constexpr const char * canonicalName
static constexpr const char * jsonComplexItemTypeValue
QmlObjectListModel * columns(void) const
void setFontSize(FontSize fontSize)
Q_INVOKABLE QmlObjectListModel * appendColumn(void)
Vehicle * specificVehicleForCard(void) const
QGCMAVLinkTypes::VehicleClass_t vehicleClass(void) const
Q_INVOKABLE void appendRow(void)
static constexpr const char * jsonComplexItemTypeValue
static constexpr const char * canonicalName
Q_INVOKABLE void setFact(const QString &factGroupName, const QString &factName)
static JoystickManager * instance()
Master controller for mission, fence, rally.
Extension mechanism for generic, non-firmware-specific customization of QGC.
virtual ComplexMissionItem * createComplexMissionItem(const QString &complexItemType, PlanMasterController *masterController, bool flyView, const QString &kmlOrShpFile=QString())
QGCCorePlugin(QObject *parent=nullptr)
virtual QVariantList complexMissionItemNames(Vehicle *vehicle)
void showTouchAreasChanged(bool showTouchAreas)
virtual void * createVideoSink(QQuickItem *widget, QObject *parent)
Allows the plugin to override the creation of VideoSink.
virtual void factValueGridCreateDefaultSettings(FactValueGrid *factValueGrid)
void showAdvancedUIChanged(bool showAdvancedUI)
virtual QList< int > firstRunPromptStdIds()
virtual const QVariantList & toolBarIndicators()
virtual QList< int > firstRunPromptCustomIds()
virtual Q_INVOKABLE QString firstRunPromptResource(int id) const
Returns the resource which contains the specified first run prompt for display.
static constexpr int kInitialSetupPromptId
virtual QGCOptions * options()
virtual QQmlApplicationEngine * createQmlApplicationEngine(QObject *parent)
virtual const QVariantList & analyzePages()
virtual QString showAdvancedUIMessage() const
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 releaseVideoSink(void *sink)
Allows the plugin to override the release of VideoSink.
Q_INVOKABLE QVariantList firstRunPromptsToShow()
Returns the list of first run prompt ids which need to be displayed according to current settings.
virtual const QmlObjectListModel * customMapItems()
Allows custom builds to add custom items to the FlightMap. Objects put into QmlObjectListModel should...
virtual QList< PlanCreator * > planCreators(PlanMasterController *planMasterController)
virtual void adjustSettingMetaData(const QString &settingsGroup, FactMetaData &metaData, bool &userVisible)
virtual void destroyQmlApplicationEngine(QQmlApplicationEngine *qmlEngine)
static QGCCorePlugin * instance()
static constexpr const VehicleClass_t VehicleClassFixedWing
static constexpr const VehicleClass_t VehicleClassAirship
static constexpr const VehicleClass_t VehicleClassVTOL
Represents a Qml component which can be loaded from a resource.
QString settingsGroup() const
static SettingsManager * instance()
static constexpr const char * canonicalName
static constexpr const char * jsonComplexItemTypeValue
static constexpr const char * jsonComplexItemTypeValue
static constexpr const char * canonicalName
static constexpr const char * canonicalName
static constexpr const char * jsonComplexItemTypeValue
bool hasPosixSerialPorts()
void releaseSink(void *sink)
void * createSink(QQuickItem *widget, QObject *parent)
VideoReceiver * createReceiver(QObject *parent)