3#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
31#ifdef QGC_CUSTOM_BUILD
35#include <QtCore/QApplicationStatic>
36#include <QtCore/QFile>
37#include <QtQml/QQmlApplicationEngine>
38#include <QtQml/QQmlContext>
39#include <QtQuick/QQuickItem>
43#ifndef QGC_CUSTOM_BUILD
52 qCDebug(QGCCorePluginLog) <<
this;
57 qCDebug(QGCCorePluginLog) <<
this;
62#ifndef QGC_CUSTOM_BUILD
63 return _qgcCorePluginInstance();
65 return CUSTOMCLASS::instance();
75#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
76 static const QVariantList analyzeList = {
78 static const QVariantList analyzeList = {
81 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/LogViewer/LogViewerPage.qml")),
82 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/MAVLinkInspector.svg")))),
86 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/OnboardLogs/OnboardLogPage.qml")),
87 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/OnboardLogIcon.svg")),
90 tr(
"Onboard Logs (FTP)"),
91 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/OnboardLogsFtp/OnboardLogFtpPage.qml")),
92 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/OnboardLogIcon.svg")),
96 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/GeoTag/GeoTagPage.qml")),
97 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/GeoTag/GeoTagIcon.svg")))),
99 tr(
"MAVLink Console"),
100 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/MAVLinkConsole/MAVLinkConsolePage.qml")),
101 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/MAVLinkConsoleIcon.svg")),
104 tr(
"MAVLink Inspector"),
105 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/MAVLinkInspector/MAVLinkInspectorPage.qml")),
106 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/MAVLinkInspector.svg")),
110 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/Vibration/VibrationPage.qml")),
111 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/VibrationPageIcon")),
120 return _defaultOptions;
125 return _emptyCustomMapItems;
131 Q_UNUSED(userVisible);
135 if (metaData.
name() == AppSettings::indoorPaletteName) {
136 QVariant outdoorPalette;
137#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
145#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
146 else if (metaData.
name() == MavlinkSettings::telemetrySaveName) {
152 else if (metaData.
name() == AppSettings::androidDontSaveToSDCardName) {
162 return tr(
"WARNING: You are about to enter Advanced Mode. "
163 "If used incorrectly, this may cause your vehicle to malfunction thus voiding your warranty. "
164 "You should do so only if instructed by customer support. "
165 "Are you sure you want to enable Advanced Mode?");
170#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
189 value->
setFact(
"Vehicle",
"AltitudeRelative");
190 value->setIcon(
"arrow-thick-up.svg");
191 value->setText(value->fact()->shortDescription());
192 value->setShowUnits(
true);
197 if (includeFWValues) {
198 value->
setFact(
"Vehicle",
"AirSpeed");
199 value->setText(
"AirSpd");
200 value->setShowUnits(
true);
202 value->setFact(
"Vehicle",
"GroundSpeed");
203 value->setIcon(
"arrow-simple-right.svg");
204 value->setText(value->fact()->shortDescription());
205 value->setShowUnits(
true);
215 if (includeFWValues) {
224 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"AltitudeRelative"));
225 value->setIcon(QStringLiteral(
"arrow-thick-up.svg"));
226 value->setText(value->fact()->shortDescription());
227 value->setShowUnits(
true);
230 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"DistanceToHome"));
231 value->setIcon(QStringLiteral(
"bookmark copy 3.svg"));
232 value->setText(value->fact()->shortDescription());
233 value->setShowUnits(
true);
239 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"ClimbRate"));
240 value->setIcon(QStringLiteral(
"arrow-simple-up.svg"));
241 value->setText(value->fact()->shortDescription());
242 value->setShowUnits(
true);
245 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"GroundSpeed"));
246 value->setIcon(QStringLiteral(
"arrow-simple-right.svg"));
247 value->setText(value->fact()->shortDescription());
248 value->setShowUnits(
true);
250 if (includeFWValues) {
255 value->setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"AirSpeed"));
256 value->setText(QStringLiteral(
"AirSpd"));
257 value->setShowUnits(
true);
260 value->setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"ThrottlePct"));
261 value->setText(QStringLiteral(
"Thr"));
262 value->setShowUnits(
true);
269 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"FlightTime"));
270 value->setIcon(QStringLiteral(
"timer.svg"));
271 value->setText(value->fact()->shortDescription());
272 value->setShowUnits(
false);
275 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"FlightDistance"));
276 value->setIcon(QStringLiteral(
"travel-walk.svg"));
277 value->setText(value->fact()->shortDescription());
278 value->setShowUnits(
true);
284 QQmlApplicationEngine *
const qmlEngine =
new QQmlApplicationEngine(parent);
285 qmlEngine->addImportPath(QStringLiteral(
"qrc:/qml"));
292 qmlEngine->load(QUrl(QStringLiteral(
"qrc:/qml/QGroundControl/MainWindow.qml")));
312 static const QVariantList toolBarIndicatorList = QVariantList(
314 QVariant::fromValue(QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/Toolbar/RTKGPSIndicator.qml"))),
318 return toolBarIndicatorList;
323 QList<int> rgIdsToShow;
329 for (
int idToRemove: rgAlreadyShownIds) {
330 (void) rgIdsToShow.removeOne(idToRemove);
333 QVariantList rgVarIdsToShow;
334 for (
int id: rgIdsToShow) {
335 rgVarIdsToShow.append(
id);
338 return rgVarIdsToShow;
345 return QStringLiteral(
"/qml/QGroundControl/FirstRunPromptDialogs/InitialSetupPrompt.qml");
351void QGCCorePlugin::_setShowTouchAreas(
bool show)
359void QGCCorePlugin::_setShowAdvancedUI(
bool show)
369 auto makeEntry = [](
const char* canonical,
const QString& translated) {
371 entry[QStringLiteral(
"canonicalName")] = QString(canonical);
372 entry[QStringLiteral(
"translatedName")] = translated;
397 const QString &complexItemType,
400 const QString &kmlOrShpFile)
414 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)
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
void releaseSink(void *sink)
void * createSink(QQuickItem *widget, QObject *parent)
VideoReceiver * createReceiver(QObject *parent)