6#ifdef QGC_GST_STREAMING
17#ifdef QGC_QT_STREAMING
35#ifdef QGC_CUSTOM_BUILD
39#include <QtCore/QApplicationStatic>
40#include <QtCore/QFile>
41#include <QtQml/QQmlApplicationEngine>
42#include <QtQml/QQmlContext>
43#include <QtQuick/QQuickItem>
47#ifndef QGC_CUSTOM_BUILD
56 qCDebug(QGCCorePluginLog) <<
this;
61 qCDebug(QGCCorePluginLog) <<
this;
66#ifndef QGC_CUSTOM_BUILD
67 return _qgcCorePluginInstance();
69 return CUSTOMCLASS::instance();
75 static const QVariantList analyzeList = {
78 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/LogViewer/LogViewerPage.qml")),
79 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/MAVLinkInspector.svg")))),
82 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/OnboardLogs/OnboardLogPage.qml")),
83 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/OnboardLogIcon.svg")),
86 tr(
"Onboard Logs (FTP)"),
87 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/OnboardLogsFtp/OnboardLogFtpPage.qml")),
88 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/OnboardLogIcon.svg")),
92 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/GeoTag/GeoTagPage.qml")),
93 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/GeoTag/GeoTagIcon.svg")))),
95 tr(
"MAVLink Console"),
96 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/MAVLinkConsole/MAVLinkConsolePage.qml")),
97 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/MAVLinkConsoleIcon.svg")),
100 tr(
"MAVLink Inspector"),
101 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/MAVLinkInspector/MAVLinkInspectorPage.qml")),
102 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/MAVLinkInspector.svg")),
106 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/Vibration/VibrationPage.qml")),
107 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/VibrationPageIcon")),
116 return _defaultOptions;
121 return _emptyCustomMapItems;
127 Q_UNUSED(userVisible);
131 if (metaData.
name() == AppSettings::indoorPaletteName) {
132 QVariant outdoorPalette;
133#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
141#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
142 else if (metaData.
name() == MavlinkSettings::telemetrySaveName) {
148 else if (metaData.
name() == AppSettings::androidDontSaveToSDCardName) {
158 return tr(
"WARNING: You are about to enter Advanced Mode. "
159 "If used incorrectly, this may cause your vehicle to malfunction thus voiding your warranty. "
160 "You should do so only if instructed by customer support. "
161 "Are you sure you want to enable Advanced Mode?");
166#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
185 value->
setFact(
"Vehicle",
"AltitudeRelative");
186 value->setIcon(
"arrow-thick-up.svg");
187 value->setText(value->fact()->shortDescription());
188 value->setShowUnits(
true);
193 if (includeFWValues) {
194 value->
setFact(
"Vehicle",
"AirSpeed");
195 value->setText(
"AirSpd");
196 value->setShowUnits(
true);
198 value->setFact(
"Vehicle",
"GroundSpeed");
199 value->setIcon(
"arrow-simple-right.svg");
200 value->setText(value->fact()->shortDescription());
201 value->setShowUnits(
true);
211 if (includeFWValues) {
220 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"AltitudeRelative"));
221 value->setIcon(QStringLiteral(
"arrow-thick-up.svg"));
222 value->setText(value->fact()->shortDescription());
223 value->setShowUnits(
true);
226 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"DistanceToHome"));
227 value->setIcon(QStringLiteral(
"bookmark copy 3.svg"));
228 value->setText(value->fact()->shortDescription());
229 value->setShowUnits(
true);
235 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"ClimbRate"));
236 value->setIcon(QStringLiteral(
"arrow-simple-up.svg"));
237 value->setText(value->fact()->shortDescription());
238 value->setShowUnits(
true);
241 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"GroundSpeed"));
242 value->setIcon(QStringLiteral(
"arrow-simple-right.svg"));
243 value->setText(value->fact()->shortDescription());
244 value->setShowUnits(
true);
246 if (includeFWValues) {
251 value->setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"AirSpeed"));
252 value->setText(QStringLiteral(
"AirSpd"));
253 value->setShowUnits(
true);
256 value->setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"ThrottlePct"));
257 value->setText(QStringLiteral(
"Thr"));
258 value->setShowUnits(
true);
265 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"FlightTime"));
266 value->setIcon(QStringLiteral(
"timer.svg"));
267 value->setText(value->fact()->shortDescription());
268 value->setShowUnits(
false);
271 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"FlightDistance"));
272 value->setIcon(QStringLiteral(
"travel-walk.svg"));
273 value->setText(value->fact()->shortDescription());
274 value->setShowUnits(
true);
280 QQmlApplicationEngine *
const qmlEngine =
new QQmlApplicationEngine(parent);
281 qmlEngine->addImportPath(QStringLiteral(
"qrc:/qml"));
288 qmlEngine->load(QUrl(QStringLiteral(
"qrc:/qml/QGroundControl/MainWindow.qml")));
293#ifdef QGC_GST_STREAMING
295#elif defined(QGC_QT_STREAMING)
305#ifdef QGC_GST_STREAMING
307#elif defined(QGC_QT_STREAMING)
310 Q_UNUSED(widget); Q_UNUSED(parent);
316#ifdef QGC_GST_STREAMING
318#elif defined(QGC_QT_STREAMING)
327 static const QVariantList toolBarIndicatorList = QVariantList(
329 QVariant::fromValue(QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/Toolbar/RTKGPSIndicator.qml"))),
333 return toolBarIndicatorList;
338 QList<int> rgIdsToShow;
344 for (
int idToRemove: rgAlreadyShownIds) {
345 (void) rgIdsToShow.removeOne(idToRemove);
348 QVariantList rgVarIdsToShow;
349 for (
int id: rgIdsToShow) {
350 rgVarIdsToShow.append(
id);
353 return rgVarIdsToShow;
360 return QStringLiteral(
"/qml/QGroundControl/FirstRunPromptDialogs/InitialSetupPrompt.qml");
366void QGCCorePlugin::_setShowTouchAreas(
bool show)
374void QGCCorePlugin::_setShowAdvancedUI(
bool show)
384 auto makeEntry = [](
const char* canonical,
const QString& translated) {
386 entry[QStringLiteral(
"canonicalName")] = QString(canonical);
387 entry[QStringLiteral(
"translatedName")] = translated;
412 const QString &complexItemType,
415 const QString &kmlOrShpFile)
429 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
VideoReceiver * createVideoReceiver(QObject *parent)
void releaseVideoSink(void *sink)
void * createVideoSink(QQuickItem *, QObject *)