5#ifndef QGC_NO_SERIAL_LINK
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();
79#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
80 static const QVariantList analyzeList = {
82 static const QVariantList analyzeList = {
85 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/LogViewer/LogViewerPage.qml")),
86 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/MAVLinkInspector.svg")))),
90 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/OnboardLogs/OnboardLogPage.qml")),
91 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/OnboardLogIcon.svg")),
95 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/GeoTag/GeoTagPage.qml")),
96 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/GeoTag/GeoTagIcon.svg")))),
98 tr(
"MAVLink Console"),
99 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/MAVLinkConsole/MAVLinkConsolePage.qml")),
100 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/MAVLinkConsoleIcon.svg")),
103 tr(
"MAVLink Inspector"),
104 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/MAVLinkInspector/MAVLinkInspectorPage.qml")),
105 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/MAVLinkInspector.svg")),
109 QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/AnalyzeView/Vibration/VibrationPage.qml")),
110 QUrl::fromUserInput(QStringLiteral(
"qrc:/qmlimages/VibrationPageIcon")),
119 return _defaultOptions;
124 return _emptyCustomMapItems;
129 return _emptyCustomMapItems;
145 if (metaData.
name() == AppSettings::indoorPaletteName) {
146 QVariant outdoorPalette;
147#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
156 else if (metaData.
name() == AppSettings::androidDontSaveToSDCardName) {
161 else if (metaData.
name() == AppSettings::androidUsePosixSerialName) {
162#if defined(Q_OS_ANDROID) && !defined(QGC_NO_SERIAL_LINK)
175 return tr(
"WARNING: You are about to enter Advanced Mode. "
176 "If used incorrectly, this may cause your vehicle to malfunction thus voiding your warranty. "
177 "You should do so only if instructed by customer support. "
178 "Are you sure you want to enable Advanced Mode?");
193#if defined(Q_OS_ANDROID) || defined(Q_OS_IOS)
212 value->
setFact(
"Vehicle",
"AltitudeRelative");
213 value->setIcon(
"arrow-thick-up.svg");
214 value->setText(value->fact()->shortDescription());
215 value->setShowUnits(
true);
220 if (includeFWValues) {
221 value->
setFact(
"Vehicle",
"AirSpeed");
222 value->setText(
"AirSpd");
223 value->setShowUnits(
true);
225 value->setFact(
"Vehicle",
"GroundSpeed");
226 value->setIcon(
"arrow-simple-right.svg");
227 value->setText(value->fact()->shortDescription());
228 value->setShowUnits(
true);
238 if (includeFWValues) {
247 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"AltitudeRelative"));
248 value->setIcon(QStringLiteral(
"arrow-thick-up.svg"));
249 value->setText(value->fact()->shortDescription());
250 value->setShowUnits(
true);
253 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"DistanceToHome"));
254 value->setIcon(QStringLiteral(
"bookmark copy 3.svg"));
255 value->setText(value->fact()->shortDescription());
256 value->setShowUnits(
true);
262 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"ClimbRate"));
263 value->setIcon(QStringLiteral(
"arrow-simple-up.svg"));
264 value->setText(value->fact()->shortDescription());
265 value->setShowUnits(
true);
268 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"GroundSpeed"));
269 value->setIcon(QStringLiteral(
"arrow-simple-right.svg"));
270 value->setText(value->fact()->shortDescription());
271 value->setShowUnits(
true);
273 if (includeFWValues) {
278 value->setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"AirSpeed"));
279 value->setText(QStringLiteral(
"AirSpd"));
280 value->setShowUnits(
true);
283 value->setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"ThrottlePct"));
284 value->setText(QStringLiteral(
"Thr"));
285 value->setShowUnits(
true);
292 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"FlightTime"));
293 value->setIcon(QStringLiteral(
"timer.svg"));
294 value->setText(value->fact()->shortDescription());
295 value->setShowUnits(
false);
298 value->
setFact(QStringLiteral(
"Vehicle"), QStringLiteral(
"FlightDistance"));
299 value->setIcon(QStringLiteral(
"travel-walk.svg"));
300 value->setText(value->fact()->shortDescription());
301 value->setShowUnits(
true);
307 QQmlApplicationEngine *
const qmlEngine =
new QQmlApplicationEngine(parent);
308 qmlEngine->addImportPath(QStringLiteral(
"qrc:/qml"));
320 qmlEngine->load(QUrl(QStringLiteral(
"qrc:/qml/QGroundControl/MainWindow.qml")));
340 static const QVariantList toolBarIndicatorList = QVariantList({
341 QVariant::fromValue(QUrl::fromUserInput(QStringLiteral(
"qrc:/qml/QGroundControl/Toolbar/GPSIndicator.qml"))),
344 return toolBarIndicatorList;
358 QList<int> rgIdsToShow;
364 for (
int idToRemove: rgAlreadyShownIds) {
365 (void) rgIdsToShow.removeOne(idToRemove);
368 QVariantList rgVarIdsToShow;
369 for (
int id: rgIdsToShow) {
370 rgVarIdsToShow.append(
id);
373 return rgVarIdsToShow;
380 return QStringLiteral(
"/qml/QGroundControl/FirstRunPromptDialogs/InitialSetupPrompt.qml");
386void QGCCorePlugin::_setShowTouchAreas(
bool show)
394void QGCCorePlugin::_setShowAdvancedUI(
bool show)
404 auto makeEntry = [](
const char* canonical,
const QString& translated) {
406 entry[QStringLiteral(
"canonicalName")] = QString(canonical);
407 entry[QStringLiteral(
"translatedName")] = translated;
432 const QString &complexItemType,
435 const QString &kmlOrShpFile)
449 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)
bool singleVehicleSupport()
Returns true if the system supports only a single firmware class with a single vehicle type.
static FirmwarePluginManager * instance()
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())
virtual QList< int > firstRunPromptStdIds()
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 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 bool showInitialSetupMeasurementUnits() const
virtual const QVariantList & analyzePages()
virtual bool showInitialSetupVehiclePreferences() const
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 const QmlObjectListModel * customGeoMapItems()
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)