Commit 763e8382 authored by Gus Grubba's avatar Gus Grubba Committed by GitHub

Merge pull request #4260 from dogmaphobic/customPluginControl

Custom plugin work
parents f88922dc c80fac51
...@@ -38,7 +38,6 @@ linux { ...@@ -38,7 +38,6 @@ linux {
equals(ANDROID_TARGET_ARCH, x86) { equals(ANDROID_TARGET_ARCH, x86) {
CONFIG += Androidx86Build CONFIG += Androidx86Build
DEFINES += __androidx86__ DEFINES += __androidx86__
DEFINES += QGC_DISABLE_UVC
message("Android x86 build") message("Android x86 build")
} else { } else {
message("Android Arm build") message("Android Arm build")
...@@ -77,9 +76,10 @@ linux { ...@@ -77,9 +76,10 @@ linux {
error("Unsupported Qt version, 5.5.x or greater is required for iOS") error("Unsupported Qt version, 5.5.x or greater is required for iOS")
} }
message("iOS build") message("iOS build")
CONFIG += iOSBuild MobileBuild app_bundle CONFIG += iOSBuild MobileBuild app_bundle NoSerialBuild
DEFINES += __ios__ DEFINES += __ios__
DEFINES += QGC_NO_GOOGLE_MAPS DEFINES += QGC_NO_GOOGLE_MAPS
DEFINES += NO_SERIAL_LINK
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0 QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2 # Universal QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2 # Universal
QMAKE_LFLAGS += -Wl,-no_pie QMAKE_LFLAGS += -Wl,-no_pie
......
#pragma once
#include <QObject>
/// @file
/// @brief Core Plugin Interface for QGroundControl
/// @author Gus Grubba <mavlink@grubba.com>
// Work In Progress
class QGCApplication;
class IQGCApplication;
class IQGCOptions;
class IQGCQMLSource;
class IQGCCorePlugin
{
public:
IQGCCorePlugin(QObject*) {}
virtual ~IQGCCorePlugin() {}
#if defined (QGC_DYNAMIC_PLUGIN)
virtual bool init (IQGCApplication* pApp) = 0;
#else
virtual bool init (QGCApplication* pApp) = 0;
#endif
virtual IQGCOptions* uiOptions () { return NULL; }
virtual IQGCQMLSource* settingsQML () { return NULL; }
};
#if defined (QGC_DYNAMIC_PLUGIN)
Q_DECLARE_INTERFACE(IQGCCorePlugin, "org.qgroundcontrol.qgccoreplugin")
#endif
#pragma once
#include <QString>
/// @file
/// @brief Core Plugin Interface for QGroundControl
/// @author Gus Grubba <mavlink@grubba.com>
class IQGCQMLSource
{
public:
IQGCQMLSource() {}
virtual ~IQGCQMLSource() {}
virtual QString pageUrl () { return QString(); }
virtual QString pageTitle () { return QString(); }
virtual QString pageIconUrl () { return QString(); }
};
...@@ -181,6 +181,7 @@ ...@@ -181,6 +181,7 @@
<file alias="TrashDelete.svg">resources/TrashDelete.svg</file> <file alias="TrashDelete.svg">resources/TrashDelete.svg</file>
<file alias="XDelete.svg">resources/XDelete.svg</file> <file alias="XDelete.svg">resources/XDelete.svg</file>
<file alias="XDeleteBlack.svg">resources/XDeleteBlack.svg</file> <file alias="XDeleteBlack.svg">resources/XDeleteBlack.svg</file>
<file alias="waves.svg">resources/waves.svg</file>
<file>resources/icons/qgroundcontrol.ico</file> <file>resources/icons/qgroundcontrol.ico</file>
</qresource> </qresource>
<qresource prefix="/res/firmware"> <qresource prefix="/res/firmware">
......
...@@ -34,6 +34,34 @@ exists(user_config.pri):infile(user_config.pri, CONFIG) { ...@@ -34,6 +34,34 @@ exists(user_config.pri):infile(user_config.pri, CONFIG) {
message($$sprintf("Using user-supplied additional config: '%1' specified in user_config.pri", $$fromfile(user_config.pri, CONFIG))) message($$sprintf("Using user-supplied additional config: '%1' specified in user_config.pri", $$fromfile(user_config.pri, CONFIG)))
} }
#
# Custom Build
#
# QGC will create a "CUSTOMCLASS" object (exposed by your custom build
# and derived from QGCCorePlugin).
# This is the start of allowing custom Plugins, which will eventually use a
# more defined runtime plugin architecture and not require a QGC project
# file you would have to keep in sync with the upstream repo.
#
# This allows you to ignore the custom build even if the custom build
# is present. It's useful to run "regular" builds to make sure you didn't
# break anything.
contains (CONFIG, QGC_DISABLE_CUSTOM_BUILD) {
message("Disable custom build override")
} else {
exists($$PWD/custom/custom.pri) {
message("Found custom build")
CONFIG += CustomBuild
DEFINES += QGC_CUSTOM_BUILD
# custom.pri must define:
# CUSTOMCLASS = YourIQGCCorePluginDerivation
# CUSTOMHEADER = \"\\\"YourIQGCCorePluginDerivation.h\\\"\"
include($$PWD/custom/custom.pri)
}
}
# #
# Plugin configuration # Plugin configuration
# #
...@@ -69,34 +97,6 @@ contains (CONFIG, QGC_DISABLE_PX4_PLUGIN_FACTORY) { ...@@ -69,34 +97,6 @@ contains (CONFIG, QGC_DISABLE_PX4_PLUGIN_FACTORY) {
CONFIG += PX4FirmwarePluginFactory CONFIG += PX4FirmwarePluginFactory
} }
#
# Custom Build
#
# QGC will create a "CUSTOMCLASS" object (exposed by your custom build
# and derived from IQGCCorePlugin) and call its IQGCCorePlugin::init() method.
# This is the start of allowing custom Plugins, which will eventually use a
# more defined runtime plugin architecture and not require a QGC project
# file you would have to keep in sync with the upstream repo.
#
# This allows you to ignore the custom build even if the custom build
# is present. It's useful to run "regular" builds to make sure you didn't
# break anything.
contains (CONFIG, QGC_DISABLE_CUSTOM_BUILD) {
message("Disable custom build override")
} else {
exists($$PWD/custom/custom.pri) {
message("Found custom build")
CONFIG += CustomBuild
DEFINES += QGC_CUSTOM_BUILD
# custom.pri must define:
# CUSTOMCLASS = YourIQGCCorePluginDerivation
# CUSTOMHEADER = \"\\\"YourIQGCCorePluginDerivation.h\\\"\"
include($$PWD/custom/custom.pri)
}
}
# Bluetooth # Bluetooth
contains (DEFINES, QGC_DISABLE_BLUETOOTH) { contains (DEFINES, QGC_DISABLE_BLUETOOTH) {
message("Skipping support for Bluetooth (manual override from command line)") message("Skipping support for Bluetooth (manual override from command line)")
...@@ -273,9 +273,9 @@ DEPENDPATH += \ ...@@ -273,9 +273,9 @@ DEPENDPATH += \
INCLUDEPATH += . INCLUDEPATH += .
INCLUDEPATH += \ INCLUDEPATH += \
api \
include/ui \ include/ui \
src \ src \
src/api \
src/AnalyzeView \ src/AnalyzeView \
src/AutoPilotPlugins \ src/AutoPilotPlugins \
src/FlightDisplay \ src/FlightDisplay \
...@@ -336,10 +336,14 @@ FORMS += \ ...@@ -336,10 +336,14 @@ FORMS += \
# #
HEADERS += \ HEADERS += \
api/IQGCApplication.h \ src/api/QGCCorePlugin.h \
api/IQGCCorePlugin.h \ src/api/QGCOptions.h \
api/IQGCOptions.h \ src/api/QGCSettings.h \
api/IQGCQMLSource.h \
SOURCES += \
src/api/QGCCorePlugin.cc \
src/api/QGCOptions.cc \
src/api/QGCSettings.cc \
# #
# Unit Test specific configuration goes here (requires full debug build with all plugins) # Unit Test specific configuration goes here (requires full debug build with all plugins)
...@@ -503,7 +507,7 @@ contains(DEFINES, QGC_ENABLE_BLUETOOTH) { ...@@ -503,7 +507,7 @@ contains(DEFINES, QGC_ENABLE_BLUETOOTH) {
src/comm/BluetoothLink.h \ src/comm/BluetoothLink.h \
} }
!iOSBuild { !NoSerialBuild {
HEADERS += \ HEADERS += \
src/comm/QGCSerialPortInfo.h \ src/comm/QGCSerialPortInfo.h \
src/comm/SerialLink.h \ src/comm/SerialLink.h \
...@@ -651,7 +655,7 @@ SOURCES += \ ...@@ -651,7 +655,7 @@ SOURCES += \
src/comm/MockLinkMissionItemHandler.cc \ src/comm/MockLinkMissionItemHandler.cc \
} }
!iOSBuild { !NoSerialBuild {
SOURCES += \ SOURCES += \
src/comm/QGCSerialPortInfo.cc \ src/comm/QGCSerialPortInfo.cc \
src/comm/SerialLink.cc \ src/comm/SerialLink.cc \
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 72 72" style="enable-background:new 0 0 72 72;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<path class="st0" d="M61.452,7.063c-0.11,0-0.323,0.015-0.33,0.016C32.528,9.599,9.732,32.398,7.227,61.027
c-0.002,0.02-0.018,0.282-0.019,0.306C7.207,61.351,7.2,61.496,7.2,61.559c0,1.848,1.498,3.346,3.346,3.346
c1.795,0,3.259-1.413,3.341-3.186l-0.002-0.001c2.179-25.436,22.389-45.714,47.777-47.968l0,0c1.696-0.107,3.051-1.479,3.131-3.181
c0.003-0.053,0.003-0.105,0.003-0.159C64.797,8.561,63.3,7.063,61.452,7.063z"/>
<path class="st0" d="M61.456,20.364c-0.12,0-0.238,0.009-0.354,0.021c-0.002,0-0.048,0.004-0.052,0.005
c-21.451,2.476-38.521,19.918-40.563,40.773c0,0-0.026,0.274-0.026,0.416c0,1.848,1.498,3.346,3.346,3.346
c1.795,0,3.259-1.413,3.341-3.186c0.001-0.018,0.001-0.036,0.001-0.054c2.098-18.107,16.431-32.48,34.513-34.632v-0.016
c1.696-0.106,3.055-1.463,3.134-3.167c0.003-0.052,0.003-0.105,0.003-0.158C64.801,21.862,63.303,20.364,61.456,20.364z"/>
<path class="st0" d="M61.452,33.719c-0.211,0-0.423,0.021-0.624,0.058c-13.781,2.338-24.693,13.295-26.965,27.101
c-0.008,0.037-0.013,0.074-0.02,0.11c-0.036,0.202-0.061,0.481-0.061,0.603c0,1.848,1.498,3.346,3.346,3.346
c0.133,0,0.264-0.008,0.392-0.023c1.563-0.182,2.797-1.443,2.939-3.018c0.004-0.049,0.027-0.27,0.033-0.306
c1.93-10.765,10.411-19.238,21.17-21.185c0,0,0.122-0.011,0.181-0.019c1.611-0.188,2.872-1.521,2.949-3.164
c0.003-0.053,0.003-0.105,0.003-0.159C64.797,35.217,63.3,33.719,61.452,33.719z"/>
</svg>
...@@ -143,7 +143,7 @@ Item { ...@@ -143,7 +143,7 @@ Item {
id: flyLabel id: flyLabel
text: qsTr("Fly") text: qsTr("Fly")
color: mapPal.text color: mapPal.text
visible: !ScreenTools.isShortScreen visible: !ScreenTools.isShortScreen && _mainIsMap
anchors.topMargin: _toolButtonTopMargin anchors.topMargin: _toolButtonTopMargin
anchors.horizontalCenter: toolColumn.horizontalCenter anchors.horizontalCenter: toolColumn.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
......
...@@ -20,12 +20,15 @@ ...@@ -20,12 +20,15 @@
#include "ScreenToolsController.h" #include "ScreenToolsController.h"
#include "VideoManager.h" #include "VideoManager.h"
#include "QGCToolbox.h"
#include "QGCCorePlugin.h"
#include "QGCOptions.h"
static const char* kVideoSourceKey = "VideoSource"; static const char* kVideoSourceKey = "VideoSource";
static const char* kVideoUDPPortKey = "VideoUDPPort"; static const char* kVideoUDPPortKey = "VideoUDPPort";
static const char* kVideoRTSPUrlKey = "VideoRTSPUrl"; static const char* kVideoRTSPUrlKey = "VideoRTSPUrl";
static const char* kUDPStream = "UDP Video Stream";
#if defined(QGC_GST_STREAMING) #if defined(QGC_GST_STREAMING)
static const char* kUDPStream = "UDP Video Stream";
static const char* kRTSPStream = "RTSP Video Stream"; static const char* kRTSPStream = "RTSP Video Stream";
#endif #endif
static const char* kNoVideo = "No Video Available"; static const char* kNoVideo = "No Video Available";
...@@ -41,17 +44,6 @@ VideoManager::VideoManager(QGCApplication* app) ...@@ -41,17 +44,6 @@ VideoManager::VideoManager(QGCApplication* app)
, _udpPort(5600) //-- Defalut Port 5600 == Solo UDP Port , _udpPort(5600) //-- Defalut Port 5600 == Solo UDP Port
, _init(false) , _init(false)
{ {
//-- Get saved settings
QSettings settings;
setVideoSource(settings.value(kVideoSourceKey, kUDPStream).toString());
setUdpPort(settings.value(kVideoUDPPortKey, 5600).toUInt());
setRtspURL(settings.value(kVideoRTSPUrlKey, "rtsp://192.168.42.1:554/live").toString()); //-- Example RTSP URL
_init = true;
#if defined(QGC_GST_STREAMING)
_updateVideo();
connect(&_frameTimer, &QTimer::timeout, this, &VideoManager::_updateTimer);
_frameTimer.start(1000);
#endif
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -67,6 +59,34 @@ VideoManager::setToolbox(QGCToolbox *toolbox) ...@@ -67,6 +59,34 @@ VideoManager::setToolbox(QGCToolbox *toolbox)
QGCTool::setToolbox(toolbox); QGCTool::setToolbox(toolbox);
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership); QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
qmlRegisterUncreatableType<VideoManager>("QGroundControl.VideoManager", 1, 0, "VideoManager", "Reference only"); qmlRegisterUncreatableType<VideoManager>("QGroundControl.VideoManager", 1, 0, "VideoManager", "Reference only");
//-- Get saved settings
#if defined(QGC_GST_STREAMING)
QSettings settings;
#if defined(NO_UDP_VIDEO)
setVideoSource(settings.value(kVideoSourceKey, kRTSPStream).toString());
#else
setVideoSource(settings.value(kVideoSourceKey, kUDPStream).toString());
#endif
//-- Check if core plugin defines its own video requirements
if(qgcApp()->toolbox()->corePlugin()->options()->definesVideo()) {
if(qgcApp()->toolbox()->corePlugin()->options()->videoUDPPort()) {
setUdpPort(qgcApp()->toolbox()->corePlugin()->options()->videoUDPPort());
setVideoSource(kUDPStream);
} else {
setVideoSource(kRTSPStream);
setRtspURL(qgcApp()->toolbox()->corePlugin()->options()->videoRSTPUrl());
}
} else {
setUdpPort(settings.value(kVideoUDPPortKey, 5600).toUInt());
setRtspURL(settings.value(kVideoRTSPUrlKey, "rtsp://192.168.42.1:554/live").toString()); //-- Example RTSP URL
}
#endif
_init = true;
#if defined(QGC_GST_STREAMING)
_updateVideo();
connect(&_frameTimer, &QTimer::timeout, this, &VideoManager::_updateTimer);
_frameTimer.start(1000);
#endif
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
......
...@@ -83,11 +83,7 @@ ...@@ -83,11 +83,7 @@
#include "QGCMapPolygon.h" #include "QGCMapPolygon.h"
#include "ParameterManager.h" #include "ParameterManager.h"
#if defined(QGC_CUSTOM_BUILD) #ifndef NO_SERIAL_LINK
#include CUSTOMHEADER
#endif
#ifndef __ios__
#include "SerialLink.h" #include "SerialLink.h"
#endif #endif
...@@ -188,15 +184,10 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) ...@@ -188,15 +184,10 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
, _toolbox(NULL) , _toolbox(NULL)
, _bluetoothAvailable(false) , _bluetoothAvailable(false)
, _lastKnownHomePosition(37.803784, -122.462276, 0.0) , _lastKnownHomePosition(37.803784, -122.462276, 0.0)
, _pQGCOptions(NULL)
, _pCorePlugin(NULL)
{ {
Q_ASSERT(_app == NULL); Q_ASSERT(_app == NULL);
_app = this; _app = this;
//-- Scan and load plugins
_scanAndLoadPlugins();
// This prevents usage of QQuickWidget to fail since it doesn't support native widget siblings // This prevents usage of QQuickWidget to fail since it doesn't support native widget siblings
#ifndef __android__ #ifndef __android__
setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
...@@ -358,9 +349,6 @@ QGCApplication::~QGCApplication() ...@@ -358,9 +349,6 @@ QGCApplication::~QGCApplication()
#endif #endif
shutdownVideoStreaming(); shutdownVideoStreaming();
delete _toolbox; delete _toolbox;
if(_pCorePlugin) {
delete _pCorePlugin;
}
} }
void QGCApplication::_initCommon(void) void QGCApplication::_initCommon(void)
...@@ -456,14 +444,6 @@ bool QGCApplication::_initForNormalAppBoot(void) ...@@ -456,14 +444,6 @@ bool QGCApplication::_initForNormalAppBoot(void)
} }
settings.sync(); settings.sync();
//-- Initialize Core Plugin (if any)
if(_pCorePlugin) {
if(!_pCorePlugin->init(this)) {
return false;
}
}
return true; return true;
} }
...@@ -708,41 +688,3 @@ void QGCApplication::setLastKnownHomePosition(QGeoCoordinate& lastKnownHomePosit ...@@ -708,41 +688,3 @@ void QGCApplication::setLastKnownHomePosition(QGeoCoordinate& lastKnownHomePosit
settings.setValue(_lastKnownHomePositionAltKey, lastKnownHomePosition.altitude()); settings.setValue(_lastKnownHomePositionAltKey, lastKnownHomePosition.altitude());
_lastKnownHomePosition = lastKnownHomePosition; _lastKnownHomePosition = lastKnownHomePosition;
} }
IQGCOptions* QGCApplication::qgcOptions()
{
return _pQGCOptions;
}
void QGCApplication::_scanAndLoadPlugins()
{
#if defined (QGC_DYNAMIC_PLUGIN)
//-- Look for plugins (Dynamic)
QString filter = "*.core.so";
QString path = QCoreApplication::applicationDirPath();
QDirIterator it(path, QStringList() << filter, QDir::Files);
while(it.hasNext()) {
QString pluginFile = it.next();
QPluginLoader loader(pluginFile);
QObject *plugin = loader.instance();
if(plugin) {
_pCorePlugin = qobject_cast<IQGCCorePlugin*>(plugin);
if(_pCorePlugin) {
_pQGCOptions = _pCorePlugin->uiOptions();
return;
}
} else {
qWarning() << "Plugin" << pluginFile << " not loaded:" << loader.errorString();
}
}
#elif defined (QGC_CUSTOM_BUILD)
//-- Create custom plugin (Static)
_pCorePlugin = (IQGCCorePlugin*) new CUSTOMCLASS(this);
if(_pCorePlugin) {
_pQGCOptions = _pCorePlugin->uiOptions();
return;
}
#endif
//-- No plugins found, use default options
_pQGCOptions = new IQGCOptions;
}
...@@ -35,12 +35,6 @@ ...@@ -35,12 +35,6 @@
#include "UASMessageHandler.h" #include "UASMessageHandler.h"
#include "FactSystem.h" #include "FactSystem.h"
//-- Plugin Architecture
#include "IQGCApplication.h"
#include "IQGCCorePlugin.h"
#include "IQGCOptions.h"
#include "IQGCQMLSource.h"
#ifdef QGC_RTLAB_ENABLED #ifdef QGC_RTLAB_ENABLED
#include "OpalLink.h" #include "OpalLink.h"
#endif #endif
...@@ -123,11 +117,6 @@ public: ...@@ -123,11 +117,6 @@ public:
QGeoCoordinate lastKnownHomePosition(void) { return _lastKnownHomePosition; } QGeoCoordinate lastKnownHomePosition(void) { return _lastKnownHomePosition; }
void setLastKnownHomePosition(QGeoCoordinate& lastKnownHomePosition); void setLastKnownHomePosition(QGeoCoordinate& lastKnownHomePosition);
/// Options (can be overwriten by a core plugin)
IQGCOptions* qgcOptions();
/// Custom core plugin (NULL if none)
IQGCCorePlugin* customCorePlugin() { return _pCorePlugin; }
public slots: public slots:
/// You can connect to this slot to show an information message box from a different thread. /// You can connect to this slot to show an information message box from a different thread.
void informationMessageBoxOnMainThread(const QString& title, const QString& msg); void informationMessageBoxOnMainThread(const QString& title, const QString& msg);
...@@ -179,7 +168,6 @@ private slots: ...@@ -179,7 +168,6 @@ private slots:
private: private:
void _loadCurrentStyle (); void _loadCurrentStyle ();
QObject* _rootQmlObject (); QObject* _rootQmlObject ();
void _scanAndLoadPlugins ();
#ifdef __mobile__ #ifdef __mobile__
QQmlApplicationEngine* _qmlAppEngine; QQmlApplicationEngine* _qmlAppEngine;
...@@ -218,9 +206,6 @@ private: ...@@ -218,9 +206,6 @@ private:
/// Unit Test have access to creating and destroying singletons /// Unit Test have access to creating and destroying singletons
friend class UnitTest; friend class UnitTest;
//-- Plugin Architecture
IQGCOptions* _pQGCOptions;
IQGCCorePlugin* _pCorePlugin;
}; };
/// @brief Returns the QGCApplication object singleton. /// @brief Returns the QGCApplication object singleton.
......
...@@ -28,6 +28,12 @@ ...@@ -28,6 +28,12 @@
#include "PositionManager.h" #include "PositionManager.h"
#include "VideoManager.h" #include "VideoManager.h"
#include "MAVLinkLogManager.h" #include "MAVLinkLogManager.h"
#include "QGCCorePlugin.h"
#include "QGCOptions.h"
#if defined(QGC_CUSTOM_BUILD)
#include CUSTOMHEADER
#endif
QGCToolbox::QGCToolbox(QGCApplication* app) QGCToolbox::QGCToolbox(QGCApplication* app)
: _audioOutput(NULL) : _audioOutput(NULL)
...@@ -50,7 +56,10 @@ QGCToolbox::QGCToolbox(QGCApplication* app) ...@@ -50,7 +56,10 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
, _qgcPositionManager(NULL) , _qgcPositionManager(NULL)
, _videoManager(NULL) , _videoManager(NULL)
, _mavlinkLogManager(NULL) , _mavlinkLogManager(NULL)
, _corePlugin(NULL)
{ {
//-- Scan and load plugins
_scanAndLoadPlugins(app);
_audioOutput = new GAudioOutput(app); _audioOutput = new GAudioOutput(app);
_factSystem = new FactSystem(app); _factSystem = new FactSystem(app);
_firmwarePluginManager = new FirmwarePluginManager(app); _firmwarePluginManager = new FirmwarePluginManager(app);
...@@ -75,6 +84,7 @@ QGCToolbox::QGCToolbox(QGCApplication* app) ...@@ -75,6 +84,7 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
void QGCToolbox::setChildToolboxes(void) void QGCToolbox::setChildToolboxes(void)
{ {
_corePlugin->setToolbox(this);
_audioOutput->setToolbox(this); _audioOutput->setToolbox(this);
_factSystem->setToolbox(this); _factSystem->setToolbox(this);
_firmwarePluginManager->setToolbox(this); _firmwarePluginManager->setToolbox(this);
...@@ -115,6 +125,20 @@ QGCToolbox::~QGCToolbox() ...@@ -115,6 +125,20 @@ QGCToolbox::~QGCToolbox()
delete _uasMessageHandler; delete _uasMessageHandler;
delete _followMe; delete _followMe;
delete _qgcPositionManager; delete _qgcPositionManager;
delete _corePlugin;
}
void QGCToolbox::_scanAndLoadPlugins(QGCApplication* app)
{
#if defined (QGC_CUSTOM_BUILD)
//-- Create custom plugin (Static)
_corePlugin = (QGCCorePlugin*) new CUSTOMCLASS(app);
if(_corePlugin) {
return;
}
#endif
//-- No plugins found, use default instance
_corePlugin = new QGCCorePlugin(app);
} }
QGCTool::QGCTool(QGCApplication* app) QGCTool::QGCTool(QGCApplication* app)
...@@ -122,7 +146,6 @@ QGCTool::QGCTool(QGCApplication* app) ...@@ -122,7 +146,6 @@ QGCTool::QGCTool(QGCApplication* app)
, _app(app) , _app(app)
, _toolbox(NULL) , _toolbox(NULL)
{ {
} }
void QGCTool::setToolbox(QGCToolbox* toolbox) void QGCTool::setToolbox(QGCToolbox* toolbox)
......
...@@ -32,6 +32,7 @@ class UASMessageHandler; ...@@ -32,6 +32,7 @@ class UASMessageHandler;
class QGCPositionManager; class QGCPositionManager;
class VideoManager; class VideoManager;
class MAVLinkLogManager; class MAVLinkLogManager;
class QGCCorePlugin;
/// This is used to manage all of our top level services/tools /// This is used to manage all of our top level services/tools
class QGCToolbox { class QGCToolbox {
...@@ -56,6 +57,7 @@ public: ...@@ -56,6 +57,7 @@ public:
QGCPositionManager* qgcPositionManager(void) { return _qgcPositionManager; } QGCPositionManager* qgcPositionManager(void) { return _qgcPositionManager; }
VideoManager* videoManager(void) { return _videoManager; } VideoManager* videoManager(void) { return _videoManager; }
MAVLinkLogManager* mavlinkLogManager(void) { return _mavlinkLogManager; } MAVLinkLogManager* mavlinkLogManager(void) { return _mavlinkLogManager; }
QGCCorePlugin* corePlugin(void) { return _corePlugin; }
#ifndef __mobile__ #ifndef __mobile__
GPSManager* gpsManager(void) { return _gpsManager; } GPSManager* gpsManager(void) { return _gpsManager; }
...@@ -63,6 +65,8 @@ public: ...@@ -63,6 +65,8 @@ public:
private: private:
void setChildToolboxes(void); void setChildToolboxes(void);
void _scanAndLoadPlugins(QGCApplication *app);
GAudioOutput* _audioOutput; GAudioOutput* _audioOutput;
FactSystem* _factSystem; FactSystem* _factSystem;
...@@ -84,6 +88,7 @@ private: ...@@ -84,6 +88,7 @@ private:
QGCPositionManager* _qgcPositionManager; QGCPositionManager* _qgcPositionManager;
VideoManager* _videoManager; VideoManager* _videoManager;
MAVLinkLogManager* _mavlinkLogManager; MAVLinkLogManager* _mavlinkLogManager;
QGCCorePlugin* _corePlugin;
friend class QGCApplication; friend class QGCApplication;
}; };
......
...@@ -45,6 +45,7 @@ QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app) ...@@ -45,6 +45,7 @@ QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app)
, _missionCommandTree(NULL) , _missionCommandTree(NULL)
, _videoManager(NULL) , _videoManager(NULL)
, _mavlinkLogManager(NULL) , _mavlinkLogManager(NULL)
, _corePlugin(NULL)
, _virtualTabletJoystick(false) , _virtualTabletJoystick(false)
, _baseFontPointSize(0.0) , _baseFontPointSize(0.0)
{ {
...@@ -73,6 +74,7 @@ void QGroundControlQmlGlobal::setToolbox(QGCToolbox* toolbox) ...@@ -73,6 +74,7 @@ void QGroundControlQmlGlobal::setToolbox(QGCToolbox* toolbox)
_missionCommandTree = toolbox->missionCommandTree(); _missionCommandTree = toolbox->missionCommandTree();
_videoManager = toolbox->videoManager(); _videoManager = toolbox->videoManager();
_mavlinkLogManager = toolbox->mavlinkLogManager(); _mavlinkLogManager = toolbox->mavlinkLogManager();
_corePlugin = toolbox->corePlugin();
} }
void QGroundControlQmlGlobal::saveGlobalSetting (const QString& key, const QString& value) void QGroundControlQmlGlobal::saveGlobalSetting (const QString& key, const QString& value)
......
...@@ -73,13 +73,13 @@ public: ...@@ -73,13 +73,13 @@ public:
Q_PROPERTY(MissionCommandTree* missionCommandTree READ missionCommandTree CONSTANT) Q_PROPERTY(MissionCommandTree* missionCommandTree READ missionCommandTree CONSTANT)
Q_PROPERTY(VideoManager* videoManager READ videoManager CONSTANT) Q_PROPERTY(VideoManager* videoManager READ videoManager CONSTANT)
Q_PROPERTY(MAVLinkLogManager* mavlinkLogManager READ mavlinkLogManager CONSTANT) Q_PROPERTY(MAVLinkLogManager* mavlinkLogManager READ mavlinkLogManager CONSTANT)
Q_PROPERTY(QGCCorePlugin* corePlugin READ corePlugin CONSTANT)
Q_PROPERTY(qreal zOrderTopMost READ zOrderTopMost CONSTANT) ///< z order for top most items, toolbar, main window sub view Q_PROPERTY(qreal zOrderTopMost READ zOrderTopMost CONSTANT) ///< z order for top most items, toolbar, main window sub view
Q_PROPERTY(qreal zOrderWidgets READ zOrderWidgets CONSTANT) ///< z order value to widgets, for example: zoom controls, hud widgetss Q_PROPERTY(qreal zOrderWidgets READ zOrderWidgets CONSTANT) ///< z order value to widgets, for example: zoom controls, hud widgetss
Q_PROPERTY(qreal zOrderMapItems READ zOrderMapItems CONSTANT) ///< z order value for map items, for example: mission item indicators Q_PROPERTY(qreal zOrderMapItems READ zOrderMapItems CONSTANT) ///< z order value for map items, for example: mission item indicators
// Various QGC settings exposed to Qml // Various QGC settings exposed to Qml
Q_PROPERTY(bool isAdvancedMode READ isAdvancedMode CONSTANT) ///< Global "Advance Mode" preference. Certain UI elements and features are different based on this.
Q_PROPERTY(bool isDarkStyle READ isDarkStyle WRITE setIsDarkStyle NOTIFY isDarkStyleChanged) // TODO: Should be in ScreenTools? Q_PROPERTY(bool isDarkStyle READ isDarkStyle WRITE setIsDarkStyle NOTIFY isDarkStyleChanged) // TODO: Should be in ScreenTools?
Q_PROPERTY(bool isAudioMuted READ isAudioMuted WRITE setIsAudioMuted NOTIFY isAudioMutedChanged) Q_PROPERTY(bool isAudioMuted READ isAudioMuted WRITE setIsAudioMuted NOTIFY isAudioMutedChanged)
Q_PROPERTY(bool isSaveLogPrompt READ isSaveLogPrompt WRITE setIsSaveLogPrompt NOTIFY isSaveLogPromptChanged) Q_PROPERTY(bool isSaveLogPrompt READ isSaveLogPrompt WRITE setIsSaveLogPrompt NOTIFY isSaveLogPromptChanged)
...@@ -87,6 +87,7 @@ public: ...@@ -87,6 +87,7 @@ public:
Q_PROPERTY(bool virtualTabletJoystick READ virtualTabletJoystick WRITE setVirtualTabletJoystick NOTIFY virtualTabletJoystickChanged) Q_PROPERTY(bool virtualTabletJoystick READ virtualTabletJoystick WRITE setVirtualTabletJoystick NOTIFY virtualTabletJoystickChanged)
Q_PROPERTY(qreal baseFontPointSize READ baseFontPointSize WRITE setBaseFontPointSize NOTIFY baseFontPointSizeChanged) Q_PROPERTY(qreal baseFontPointSize READ baseFontPointSize WRITE setBaseFontPointSize NOTIFY baseFontPointSizeChanged)
//-------------------------------------------------------------------------
// MavLink Protocol // MavLink Protocol
Q_PROPERTY(bool isVersionCheckEnabled READ isVersionCheckEnabled WRITE setIsVersionCheckEnabled NOTIFY isVersionCheckEnabledChanged) Q_PROPERTY(bool isVersionCheckEnabled READ isVersionCheckEnabled WRITE setIsVersionCheckEnabled NOTIFY isVersionCheckEnabledChanged)
Q_PROPERTY(int mavlinkSystemID READ mavlinkSystemID WRITE setMavlinkSystemID NOTIFY mavlinkSystemIDChanged) Q_PROPERTY(int mavlinkSystemID READ mavlinkSystemID WRITE setMavlinkSystemID NOTIFY mavlinkSystemIDChanged)
...@@ -170,6 +171,7 @@ public: ...@@ -170,6 +171,7 @@ public:
MissionCommandTree* missionCommandTree () { return _missionCommandTree; } MissionCommandTree* missionCommandTree () { return _missionCommandTree; }
VideoManager* videoManager () { return _videoManager; } VideoManager* videoManager () { return _videoManager; }
MAVLinkLogManager* mavlinkLogManager () { return _mavlinkLogManager; } MAVLinkLogManager* mavlinkLogManager () { return _mavlinkLogManager; }
QGCCorePlugin* corePlugin () { return _corePlugin; }
qreal zOrderTopMost () { return 1000; } qreal zOrderTopMost () { return 1000; }
qreal zOrderWidgets () { return 100; } qreal zOrderWidgets () { return 100; }
...@@ -196,9 +198,6 @@ public: ...@@ -196,9 +198,6 @@ public:
static Fact* speedUnits (void); static Fact* speedUnits (void);
static Fact* batteryPercentRemainingAnnounce(void); static Fact* batteryPercentRemainingAnnounce(void);
//-- TODO: Make this into an actual preference.
bool isAdvancedMode () { return false; }
void setIsDarkStyle (bool dark); void setIsDarkStyle (bool dark);
void setIsAudioMuted (bool muted); void setIsAudioMuted (bool muted);
void setIsSaveLogPrompt (bool prompt); void setIsSaveLogPrompt (bool prompt);
...@@ -244,6 +243,7 @@ private: ...@@ -244,6 +243,7 @@ private:
MissionCommandTree* _missionCommandTree; MissionCommandTree* _missionCommandTree;
VideoManager* _videoManager; VideoManager* _videoManager;
MAVLinkLogManager* _mavlinkLogManager; MAVLinkLogManager* _mavlinkLogManager;
QGCCorePlugin* _corePlugin;
bool _virtualTabletJoystick; bool _virtualTabletJoystick;
qreal _baseFontPointSize; qreal _baseFontPointSize;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "QGroundControlQmlGlobal.h" #include "QGroundControlQmlGlobal.h"
#include "ParameterManager.h" #include "ParameterManager.h"
#ifdef __mobile__ #if defined (__ios__) || defined(__android__)
#include "MobileScreenMgr.h" #include "MobileScreenMgr.h"
#endif #endif
...@@ -116,7 +116,7 @@ void MultiVehicleManager::_vehicleHeartbeatInfo(LinkInterface* link, int vehicle ...@@ -116,7 +116,7 @@ void MultiVehicleManager::_vehicleHeartbeatInfo(LinkInterface* link, int vehicle
// Mark link as active // Mark link as active
link->setActive(true); link->setActive(true);
#ifdef __mobile__ #if defined (__ios__) || defined(__android__)
if(_vehicles.count() == 1) { if(_vehicles.count() == 1) {
//-- Once a vehicle is connected, keep screen from going off //-- Once a vehicle is connected, keep screen from going off
qCDebug(MultiVehicleManagerLog) << "QAndroidJniObject::keepScreenOn"; qCDebug(MultiVehicleManagerLog) << "QAndroidJniObject::keepScreenOn";
...@@ -157,7 +157,7 @@ void MultiVehicleManager::_deleteVehiclePhase1(Vehicle* vehicle) ...@@ -157,7 +157,7 @@ void MultiVehicleManager::_deleteVehiclePhase1(Vehicle* vehicle)
emit parameterReadyVehicleAvailableChanged(false); emit parameterReadyVehicleAvailableChanged(false);
emit vehicleRemoved(vehicle); emit vehicleRemoved(vehicle);
#ifdef __mobile__ #if defined (__ios__) || defined(__android__)
if(_vehicles.count() == 0) { if(_vehicles.count() == 0) {
//-- Once no vehicles are connected, we no longer need to keep screen from going off //-- Once no vehicles are connected, we no longer need to keep screen from going off
qCDebug(MultiVehicleManagerLog) << "QAndroidJniObject::restoreScreenOn"; qCDebug(MultiVehicleManagerLog) << "QAndroidJniObject::restoreScreenOn";
......
...@@ -933,7 +933,7 @@ void Vehicle::_sendMessageOnLink(LinkInterface* link, mavlink_message_t message) ...@@ -933,7 +933,7 @@ void Vehicle::_sendMessageOnLink(LinkInterface* link, mavlink_message_t message)
/// @return Direct usb connection link to board if one, NULL if none /// @return Direct usb connection link to board if one, NULL if none
LinkInterface* Vehicle::priorityLink(void) LinkInterface* Vehicle::priorityLink(void)
{ {
#ifndef __ios__ #ifndef NO_SERIAL_LINK
foreach (LinkInterface* link, _links) { foreach (LinkInterface* link, _links) {
if (link->isConnected()) { if (link->isConnected()) {
SerialLink* pSerialLink = qobject_cast<SerialLink*>(link); SerialLink* pSerialLink = qobject_cast<SerialLink*>(link);
......
...@@ -256,6 +256,19 @@ Rectangle { ...@@ -256,6 +256,19 @@ Rectangle {
visible: !ScreenTools.isShortScreen visible: !ScreenTools.isShortScreen
} }
Repeater {
model: QGroundControl.corePlugin.settings
visible: QGroundControl.corePlugin.options.combineSettingsAndSetup
SubMenuButton {
imageResource: modelData.icon
setupIndicator: false
exclusiveGroup: setupButtonGroup
text: modelData.title
visible: QGroundControl.corePlugin.options.combineSettingsAndSetup
onClicked: panelLoader.setSource(modelData.url)
}
}
SubMenuButton { SubMenuButton {
id: summaryButton id: summaryButton
imageResource: "/qmlimages/VehicleSummaryIcon.png" imageResource: "/qmlimages/VehicleSummaryIcon.png"
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include "QGCCorePlugin.h"
#include "QGCOptions.h"
#include "QGCSettings.h"
#include <QtQml>
#include <QQmlEngine>
/// @file
/// @brief Core Plugin Interface for QGroundControl - Default Implementation
/// @author Gus Grubba <mavlink@grubba.com>
class QGCCorePlugin_p
{
public:
QGCCorePlugin_p()
: pGeneral(NULL)
, pCommLinks(NULL)
, pOfflineMaps(NULL)
, pMAVLink(NULL)
, pConsole(NULL)
#if defined(QT_DEBUG)
, pMockLink(NULL)
, pDebug(NULL)
#endif
, defaultOptions(NULL)
{
}
~QGCCorePlugin_p()
{
if(pGeneral)
delete pGeneral;
if(pCommLinks)
delete pCommLinks;
if(pOfflineMaps)
delete pOfflineMaps;
if(pMAVLink)
delete pMAVLink;
if(pConsole)
delete pConsole;
#if defined(QT_DEBUG)
if(pMockLink)
delete pMockLink;
if(pDebug)
delete pDebug;
#endif
if(defaultOptions)
delete defaultOptions;
}
QGCSettings* pGeneral;
QGCSettings* pCommLinks;
QGCSettings* pOfflineMaps;
QGCSettings* pMAVLink;
QGCSettings* pConsole;
#if defined(QT_DEBUG)
QGCSettings* pMockLink;
QGCSettings* pDebug;
#endif
QVariantList settingsList;
QGCOptions* defaultOptions;
};
QGCCorePlugin::~QGCCorePlugin()
{
if(_p) {
delete _p;
}
}
QGCCorePlugin::QGCCorePlugin(QGCApplication *app)
: QGCTool(app)
{
_p = new QGCCorePlugin_p;
}
void QGCCorePlugin::setToolbox(QGCToolbox *toolbox)
{
QGCTool::setToolbox(toolbox);
QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
qmlRegisterUncreatableType<QGCCorePlugin>("QGroundControl.QGCCorePlugin", 1, 0, "QGCCorePlugin", "Reference only");
qmlRegisterUncreatableType<QGCOptions>("QGroundControl.QGCOptions", 1, 0, "QGCOptions", "Reference only");
}
QVariantList &QGCCorePlugin::settings()
{
//-- If this hasn't been overridden, create default set of settings
if(!_p->pGeneral) {
//-- Default Settings
_p->pGeneral = new QGCSettings(tr("General"),
QUrl::fromUserInput("qrc:/qml/GeneralSettings.qml"),
QUrl::fromUserInput("qrc:/res/gear-white.svg"));
_p->settingsList.append(QVariant::fromValue((QGCSettings*)_p->pGeneral));
_p->pCommLinks = new QGCSettings(tr("Comm Links"),
QUrl::fromUserInput("qrc:/qml/LinkSettings.qml"),
QUrl::fromUserInput("qrc:/res/waves.svg"));
_p->settingsList.append(QVariant::fromValue((QGCSettings*)_p->pCommLinks));
_p->pOfflineMaps = new QGCSettings(tr("Offline Maps"),
QUrl::fromUserInput("qrc:/qml/OfflineMap.qml"),
QUrl::fromUserInput("qrc:/res/waves.svg"));
_p->settingsList.append(QVariant::fromValue((QGCSettings*)_p->pOfflineMaps));
_p->pMAVLink = new QGCSettings(tr("MAVLink"),
QUrl::fromUserInput("qrc:/qml/MavlinkSettings.qml"),
QUrl::fromUserInput("qrc:/res/waves.svg"));
_p->settingsList.append(QVariant::fromValue((QGCSettings*)_p->pMAVLink));
_p->pConsole = new QGCSettings(tr("Console"),
QUrl::fromUserInput("qrc:/qml/QGroundControl/Controls/AppMessages.qml"));
_p->settingsList.append(QVariant::fromValue((QGCSettings*)_p->pConsole));
#if defined(QT_DEBUG)
//-- These are always present on Debug builds
_p->pMockLink = new QGCSettings(tr("Mock Link"),
QUrl::fromUserInput("qrc:/qml/MockLink.qml"));
_p->settingsList.append(QVariant::fromValue((QGCSettings*)_p->pMockLink));
_p->pDebug = new QGCSettings(tr("Debug"),
QUrl::fromUserInput("qrc:/qml/DebugWindow.qml"));
_p->settingsList.append(QVariant::fromValue((QGCSettings*)_p->pDebug));
#endif
}
return _p->settingsList;
}
QGCOptions* QGCCorePlugin::options()
{
if(!_p->defaultOptions) {
_p->defaultOptions = new QGCOptions();
}
return _p->defaultOptions;
}
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#pragma once
#include "QGCToolbox.h"
#include <QObject>
#include <QVariantList>
/// @file
/// @brief Core Plugin Interface for QGroundControl
/// @author Gus Grubba <mavlink@grubba.com>
// Work In Progress
class QGCApplication;
class QGCOptions;
class QGCSettings;
class QGCCorePlugin_p;
class QGCCorePlugin : public QGCTool
{
Q_OBJECT
public:
QGCCorePlugin(QGCApplication* app);
~QGCCorePlugin();
Q_PROPERTY(QVariantList settings READ settings CONSTANT)
Q_PROPERTY(QGCOptions* options READ options CONSTANT)
//! The list of settings under the Settings Menu
/*!
@return A list of QGCSettings
*/
virtual QVariantList& settings ();
//! Global options
/*!
@return An instance of QGCOptions
*/
virtual QGCOptions* options ();
// Override from QGCTool
void setToolbox (QGCToolbox *toolbox);
private:
QGCCorePlugin_p* _p;
};
...@@ -7,18 +7,13 @@ ...@@ -7,18 +7,13 @@
* *
****************************************************************************/ ****************************************************************************/
#include "QGCOptions.h"
/** /// @file
* @brief QGC Main Application Interface (used for Dynamic Loaded plugins) /// @brief Core Plugin Interface for QGroundControl - Application Options
* @author Gus Grubba <mavlink@grubba.com> /// @author Gus Grubba <mavlink@grubba.com>
*/
#pragma once QGCOptions::QGCOptions(QObject* parent)
: QObject(parent)
class IQGCApplication
{ {
public: }
IQGCApplication() {}
virtual ~IQGCApplication() {}
//-- Not yet implemented
};
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#pragma once #pragma once
#include <QObject>
#include <QString>
/// @file /// @file
/// @brief Core Plugin Interface for QGroundControl /// @brief Core Plugin Interface for QGroundControl - Application Options
/// @author Gus Grubba <mavlink@grubba.com> /// @author Gus Grubba <mavlink@grubba.com>
class IQGCOptions class QGCOptions : public QObject
{ {
Q_OBJECT
public: public:
IQGCOptions() {} QGCOptions(QObject* parent = NULL);
virtual ~IQGCOptions() {}
//! Should QGC colapse its settings menu into one single menu (Settings and Vehicle Setup)? Q_PROPERTY(bool combineSettingsAndSetup READ combineSettingsAndSetup CONSTANT)
Q_PROPERTY(bool enableVirtualJoystick READ enableVirtualJoystick CONSTANT)
Q_PROPERTY(bool enableAutoConnectOptions READ enableAutoConnectOptions CONSTANT)
Q_PROPERTY(bool enableVideoSourceOptions READ enableVideoSourceOptions CONSTANT)
Q_PROPERTY(bool definesVideo READ definesVideo CONSTANT)
Q_PROPERTY(uint16_t videoUDPPort READ videoUDPPort CONSTANT)
Q_PROPERTY(QString videoRSTPUrl READ videoRSTPUrl CONSTANT)
//! Should QGC hide its settings menu and colapse it into one single menu (Settings and Vehicle Setup)?
/*! /*!
@return true if QGC should consolidate both menus into one. @return true if QGC should consolidate both menus into one.
*/ */
virtual bool colapseSettings () { return false; } virtual bool combineSettingsAndSetup () { return false; }
//! Should QGC use Maps as its default main view?
/*!
@return true if QGC should use Maps by default or false to show Video by default.
*/
virtual bool mainViewIsMap () { return true; }
//! Should QGC use virtual Joysticks? //! Should QGC use virtual Joysticks?
/*! /*!
@return false to disable Virtual Joysticks. @return false to disable Virtual Joysticks.
......
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#include "QGCSettings.h"
/// @file
/// @brief Core Plugin Interface for QGroundControl. Settings element.
/// @author Gus Grubba <mavlink@grubba.com>
QGCSettings::QGCSettings(QString title, QUrl url, QUrl icon)
: _title(title)
, _url(url)
, _icon(icon)
{
}
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
#pragma once
#include <QObject>
#include <QUrl>
/// @file
/// @brief Core Plugin Interface for QGroundControl. Settings element.
/// @author Gus Grubba <mavlink@grubba.com>
class QGCSettings : public QObject
{
Q_OBJECT
public:
QGCSettings(QString title, QUrl url, QUrl icon = QUrl());
Q_PROPERTY(QString title READ title CONSTANT)
Q_PROPERTY(QUrl url READ url CONSTANT)
Q_PROPERTY(QUrl icon READ icon CONSTANT)
virtual QString title () { return _title; }
virtual QUrl url () { return _url; }
virtual QUrl icon () { return _icon; }
protected:
QString _title;
QUrl _url;
QUrl _icon;
};
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
*/ */
#include "LinkConfiguration.h" #include "LinkConfiguration.h"
#ifndef __ios__ #ifndef NO_SERIAL_LINK
#include "SerialLink.h" #include "SerialLink.h"
#endif #endif
#include "UDPLink.h" #include "UDPLink.h"
#include "TCPLink.h" #include "TCPLink.h"
#ifndef __mobile__ #if !defined(__mobile__)
#include "LogReplayLink.h" #include "LogReplayLink.h"
#endif #endif
#ifdef QGC_ENABLE_BLUETOOTH #ifdef QGC_ENABLE_BLUETOOTH
...@@ -79,7 +79,7 @@ LinkConfiguration* LinkConfiguration::createSettings(int type, const QString& na ...@@ -79,7 +79,7 @@ LinkConfiguration* LinkConfiguration::createSettings(int type, const QString& na
{ {
LinkConfiguration* config = NULL; LinkConfiguration* config = NULL;
switch(type) { switch(type) {
#ifndef __ios__ #ifndef NO_SERIAL_LINK
case LinkConfiguration::TypeSerial: case LinkConfiguration::TypeSerial:
config = new SerialConfiguration(name); config = new SerialConfiguration(name);
break; break;
...@@ -117,7 +117,7 @@ LinkConfiguration* LinkConfiguration::duplicateSettings(LinkConfiguration* sourc ...@@ -117,7 +117,7 @@ LinkConfiguration* LinkConfiguration::duplicateSettings(LinkConfiguration* sourc
{ {
LinkConfiguration* dupe = NULL; LinkConfiguration* dupe = NULL;
switch(source->type()) { switch(source->type()) {
#ifndef __ios__ #ifndef NO_SERIAL_LINK
case TypeSerial: case TypeSerial:
dupe = new SerialConfiguration(dynamic_cast<SerialConfiguration*>(source)); dupe = new SerialConfiguration(dynamic_cast<SerialConfiguration*>(source));
break; break;
......
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
/// The link types supported by QGC /// The link types supported by QGC
/// Any changes here MUST be reflected in LinkManager::linkTypeStrings() /// Any changes here MUST be reflected in LinkManager::linkTypeStrings()
enum LinkType { enum LinkType {
#ifndef __ios__ #ifndef NO_SERIAL_LINK
TypeSerial, ///< Serial Link TypeSerial, ///< Serial Link
#endif #endif
TypeUdp, ///< UDP Link TypeUdp, ///< UDP Link
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <QDebug> #include <QDebug>
#include <QSignalSpy> #include <QSignalSpy>
#ifndef __ios__ #ifndef NO_SERIAL_LINK
#include "QGCSerialPortInfo.h" #include "QGCSerialPortInfo.h"
#endif #endif
...@@ -85,7 +85,7 @@ LinkManager::LinkManager(QGCApplication* app) ...@@ -85,7 +85,7 @@ LinkManager::LinkManager(QGCApplication* app)
_autoconnectRTKGPS = settings.value(_autoconnectRTKGPSKey, true).toBool(); _autoconnectRTKGPS = settings.value(_autoconnectRTKGPSKey, true).toBool();
_autoconnectLibrePilot = settings.value(_autoconnectLibrePilotKey, true).toBool(); _autoconnectLibrePilot = settings.value(_autoconnectLibrePilotKey, true).toBool();
#ifndef __ios__ #ifndef NO_SERIAL_LINK
_activeLinkCheckTimer.setInterval(_activeLinkCheckTimeoutMSecs); _activeLinkCheckTimer.setInterval(_activeLinkCheckTimeoutMSecs);
_activeLinkCheckTimer.setSingleShot(false); _activeLinkCheckTimer.setSingleShot(false);
connect(&_activeLinkCheckTimer, &QTimer::timeout, this, &LinkManager::_activeLinkCheck); connect(&_activeLinkCheckTimer, &QTimer::timeout, this, &LinkManager::_activeLinkCheck);
...@@ -113,7 +113,7 @@ LinkInterface* LinkManager::createConnectedLink(LinkConfiguration* config) ...@@ -113,7 +113,7 @@ LinkInterface* LinkManager::createConnectedLink(LinkConfiguration* config)
Q_ASSERT(config); Q_ASSERT(config);
LinkInterface* pLink = NULL; LinkInterface* pLink = NULL;
switch(config->type()) { switch(config->type()) {
#ifndef __ios__ #ifndef NO_SERIAL_LINK
case LinkConfiguration::TypeSerial: case LinkConfiguration::TypeSerial:
{ {
SerialConfiguration* serialConfig = dynamic_cast<SerialConfiguration*>(config); SerialConfiguration* serialConfig = dynamic_cast<SerialConfiguration*>(config);
...@@ -373,7 +373,7 @@ void LinkManager::loadLinkConfigurationList() ...@@ -373,7 +373,7 @@ void LinkManager::loadLinkConfigurationList()
LinkConfiguration* pLink = NULL; LinkConfiguration* pLink = NULL;
bool autoConnect = settings.value(root + "/auto").toBool(); bool autoConnect = settings.value(root + "/auto").toBool();
switch((LinkConfiguration::LinkType)type) { switch((LinkConfiguration::LinkType)type) {
#ifndef __ios__ #ifndef NO_SERIAL_LINK
case LinkConfiguration::TypeSerial: case LinkConfiguration::TypeSerial:
pLink = (LinkConfiguration*)new SerialConfiguration(name); pLink = (LinkConfiguration*)new SerialConfiguration(name);
break; break;
...@@ -443,7 +443,7 @@ void LinkManager::loadLinkConfigurationList() ...@@ -443,7 +443,7 @@ void LinkManager::loadLinkConfigurationList()
_configurationsLoaded = true; _configurationsLoaded = true;
} }
#ifndef __ios__ #ifndef NO_SERIAL_LINK
SerialConfiguration* LinkManager::_autoconnectConfigurationsContainsPort(const QString& portName) SerialConfiguration* LinkManager::_autoconnectConfigurationsContainsPort(const QString& portName)
{ {
QString searchPort = portName.trimmed(); QString searchPort = portName.trimmed();
...@@ -488,7 +488,7 @@ void LinkManager::_updateAutoConnectLinks(void) ...@@ -488,7 +488,7 @@ void LinkManager::_updateAutoConnectLinks(void)
emit linkConfigurationsChanged(); emit linkConfigurationsChanged();
} }
#ifndef __ios__ #ifndef NO_SERIAL_LINK
QStringList currentPorts; QStringList currentPorts;
QList<QGCSerialPortInfo> portList = QGCSerialPortInfo::availablePorts(); QList<QGCSerialPortInfo> portList = QGCSerialPortInfo::availablePorts();
...@@ -633,7 +633,7 @@ void LinkManager::_updateAutoConnectLinks(void) ...@@ -633,7 +633,7 @@ void LinkManager::_updateAutoConnectLinks(void)
} }
delete pDeleteConfig; delete pDeleteConfig;
} }
#endif // __ios__ #endif // NO_SERIAL_LINK
} }
void LinkManager::shutdown(void) void LinkManager::shutdown(void)
...@@ -704,7 +704,7 @@ QStringList LinkManager::linkTypeStrings(void) const ...@@ -704,7 +704,7 @@ QStringList LinkManager::linkTypeStrings(void) const
static QStringList list; static QStringList list;
if(!list.size()) if(!list.size())
{ {
#ifndef __ios__ #ifndef NO_SERIAL_LINK
list += "Serial"; list += "Serial";
#endif #endif
list += "UDP"; list += "UDP";
...@@ -727,7 +727,7 @@ void LinkManager::_updateSerialPorts() ...@@ -727,7 +727,7 @@ void LinkManager::_updateSerialPorts()
{ {
_commPortList.clear(); _commPortList.clear();
_commPortDisplayList.clear(); _commPortDisplayList.clear();
#ifndef __ios__ #ifndef NO_SERIAL_LINK
QList<QSerialPortInfo> portList = QSerialPortInfo::availablePorts(); QList<QSerialPortInfo> portList = QSerialPortInfo::availablePorts();
foreach (const QSerialPortInfo &info, portList) foreach (const QSerialPortInfo &info, portList)
{ {
...@@ -758,7 +758,7 @@ QStringList LinkManager::serialPorts(void) ...@@ -758,7 +758,7 @@ QStringList LinkManager::serialPorts(void)
QStringList LinkManager::serialBaudRates(void) QStringList LinkManager::serialBaudRates(void)
{ {
#ifdef __ios__ #ifdef NO_SERIAL_LINK
QStringList foo; QStringList foo;
return foo; return foo;
#else #else
...@@ -791,7 +791,7 @@ bool LinkManager::endCreateConfiguration(LinkConfiguration* config) ...@@ -791,7 +791,7 @@ bool LinkManager::endCreateConfiguration(LinkConfiguration* config)
LinkConfiguration* LinkManager::createConfiguration(int type, const QString& name) LinkConfiguration* LinkManager::createConfiguration(int type, const QString& name)
{ {
#ifndef __ios__ #ifndef NO_SERIAL_LINK
if((LinkConfiguration::LinkType)type == LinkConfiguration::TypeSerial) if((LinkConfiguration::LinkType)type == LinkConfiguration::TypeSerial)
_updateSerialPorts(); _updateSerialPorts();
#endif #endif
...@@ -801,7 +801,7 @@ LinkConfiguration* LinkManager::createConfiguration(int type, const QString& nam ...@@ -801,7 +801,7 @@ LinkConfiguration* LinkManager::createConfiguration(int type, const QString& nam
LinkConfiguration* LinkManager::startConfigurationEditing(LinkConfiguration* config) LinkConfiguration* LinkManager::startConfigurationEditing(LinkConfiguration* config)
{ {
Q_ASSERT(config != NULL); Q_ASSERT(config != NULL);
#ifndef __ios__ #ifndef NO_SERIAL_LINK
if(config->type() == LinkConfiguration::TypeSerial) if(config->type() == LinkConfiguration::TypeSerial)
_updateSerialPorts(); _updateSerialPorts();
#endif #endif
...@@ -815,7 +815,7 @@ void LinkManager::_fixUnnamed(LinkConfiguration* config) ...@@ -815,7 +815,7 @@ void LinkManager::_fixUnnamed(LinkConfiguration* config)
//-- Check for "Unnamed" //-- Check for "Unnamed"
if (config->name() == "Unnamed") { if (config->name() == "Unnamed") {
switch(config->type()) { switch(config->type()) {
#ifndef __ios__ #ifndef NO_SERIAL_LINK
case LinkConfiguration::TypeSerial: { case LinkConfiguration::TypeSerial: {
QString tname = dynamic_cast<SerialConfiguration*>(config)->portName(); QString tname = dynamic_cast<SerialConfiguration*>(config)->portName();
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
...@@ -895,7 +895,7 @@ bool LinkManager::isBluetoothAvailable(void) ...@@ -895,7 +895,7 @@ bool LinkManager::isBluetoothAvailable(void)
return qgcApp()->isBluetoothAvailable(); return qgcApp()->isBluetoothAvailable();
} }
#ifndef __ios__ #ifndef NO_SERIAL_LINK
void LinkManager::_activeLinkCheck(void) void LinkManager::_activeLinkCheck(void)
{ {
SerialLink* link = NULL; SerialLink* link = NULL;
......
...@@ -24,12 +24,12 @@ ...@@ -24,12 +24,12 @@
#include "QGCToolbox.h" #include "QGCToolbox.h"
#include "ProtocolInterface.h" #include "ProtocolInterface.h"
#include "MAVLinkProtocol.h" #include "MAVLinkProtocol.h"
#ifndef __mobile__ #if !defined(__mobile__)
#include "LogReplayLink.h" #include "LogReplayLink.h"
#endif #endif
#include "QmlObjectListModel.h" #include "QmlObjectListModel.h"
#ifndef __ios__ #ifndef NO_SERIAL_LINK
#include "SerialLink.h" #include "SerialLink.h"
#endif #endif
...@@ -199,7 +199,7 @@ private slots: ...@@ -199,7 +199,7 @@ private slots:
void _linkConnected(void); void _linkConnected(void);
void _linkDisconnected(void); void _linkDisconnected(void);
void _linkConnectionRemoved(LinkInterface* link); void _linkConnectionRemoved(LinkInterface* link);
#ifndef __ios__ #ifndef NO_SERIAL_LINK
void _activeLinkCheck(void); void _activeLinkCheck(void);
#endif #endif
...@@ -210,7 +210,7 @@ private: ...@@ -210,7 +210,7 @@ private:
void _fixUnnamed(LinkConfiguration* config); void _fixUnnamed(LinkConfiguration* config);
bool _setAutoconnectWorker(bool& currentAutoconnect, bool newAutoconnect, const char* autoconnectKey); bool _setAutoconnectWorker(bool& currentAutoconnect, bool newAutoconnect, const char* autoconnectKey);
#ifndef __ios__ #ifndef NO_SERIAL_LINK
SerialConfiguration* _autoconnectConfigurationsContainsPort(const QString& portName); SerialConfiguration* _autoconnectConfigurationsContainsPort(const QString& portName);
#endif #endif
...@@ -237,7 +237,7 @@ private: ...@@ -237,7 +237,7 @@ private:
bool _autoconnectPX4Flow; bool _autoconnectPX4Flow;
bool _autoconnectRTKGPS; bool _autoconnectRTKGPS;
bool _autoconnectLibrePilot; bool _autoconnectLibrePilot;
#ifndef __ios__ #ifndef NO_SERIAL_LINK
QTimer _activeLinkCheckTimer; ///< Timer which checks for a vehicle showing up on a usb direct link QTimer _activeLinkCheckTimer; ///< Timer which checks for a vehicle showing up on a usb direct link
QList<SerialLink*> _activeLinkCheckList; ///< List of links we are waiting for a vehicle to show up on QList<SerialLink*> _activeLinkCheckList; ///< List of links we are waiting for a vehicle to show up on
static const int _activeLinkCheckTimeoutMSecs = 15000; ///< Amount of time to wait for a heatbeat. Keep in mind ArduPilot stack heartbeat is slow to come. static const int _activeLinkCheckTimeoutMSecs = 15000; ///< Amount of time to wait for a heatbeat. Keep in mind ArduPilot stack heartbeat is slow to come.
......
...@@ -74,7 +74,7 @@ int WindowsCrtReportHook(int reportType, char* message, int* returnValue) ...@@ -74,7 +74,7 @@ int WindowsCrtReportHook(int reportType, char* message, int* returnValue)
#endif #endif
#ifdef __android__ #if defined(__android__) && !defined(NO_SERIAL_LINK)
#include <jni.h> #include <jni.h>
#include "qserialport.h" #include "qserialport.h"
...@@ -151,7 +151,7 @@ int main(int argc, char *argv[]) ...@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
// that we use these types in signals, and without calling qRegisterMetaType we can't queue // that we use these types in signals, and without calling qRegisterMetaType we can't queue
// these signals. In general we don't queue these signals, but we do what the warning says // these signals. In general we don't queue these signals, but we do what the warning says
// anyway to silence the debug output. // anyway to silence the debug output.
#ifndef __ios__ #ifndef NO_SERIAL_LINK
qRegisterMetaType<QSerialPort::SerialPortError>(); qRegisterMetaType<QSerialPort::SerialPortError>();
#endif #endif
#ifdef QGC_ENABLE_BLUETOOTH #ifdef QGC_ENABLE_BLUETOOTH
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "MAVLinkProtocol.h" #include "MAVLinkProtocol.h"
#include "QGCMAVLink.h" #include "QGCMAVLink.h"
#include "LinkManager.h" #include "LinkManager.h"
#ifndef __ios__ #ifndef NO_SERIAL_LINK
#include "SerialLink.h" #include "SerialLink.h"
#endif #endif
#include "FirmwarePluginManager.h" #include "FirmwarePluginManager.h"
......
...@@ -30,13 +30,13 @@ Rectangle { ...@@ -30,13 +30,13 @@ Rectangle {
readonly property real _buttonHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight * 2 readonly property real _buttonHeight: ScreenTools.isTinyScreen ? ScreenTools.defaultFontPixelHeight * 3 : ScreenTools.defaultFontPixelHeight * 2
readonly property real _buttonWidth: ScreenTools.defaultFontPixelWidth * 10 readonly property real _buttonWidth: ScreenTools.defaultFontPixelWidth * 10
property bool _first: true
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }
Component.onCompleted: { Component.onCompleted: {
//-- Default to General Settings //-- Default to General Settings
__rightPanel.source = "GeneralSettings.qml" __rightPanel.source = "GeneralSettings.qml"
_generalButton.checked = true
panelActionGroup.current = _generalButton
} }
QGCFlickable { QGCFlickable {
...@@ -81,90 +81,24 @@ Rectangle { ...@@ -81,90 +81,24 @@ Rectangle {
visible: !ScreenTools.isShortScreen visible: !ScreenTools.isShortScreen
} }
QGCButton { Repeater {
id: _generalButton model: QGroundControl.corePlugin.settings
height: _buttonHeight
text: qsTr("General")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "GeneralSettings.qml") {
__rightPanel.source = "GeneralSettings.qml"
}
checked = true
}
}
QGCButton { QGCButton {
height: _buttonHeight height: _buttonHeight
text: qsTr("Comm Links") text: modelData.title
exclusiveGroup: panelActionGroup exclusiveGroup: panelActionGroup
onClicked: { onClicked: {
if(__rightPanel.source != "LinkSettings.qml") { if(__rightPanel.source !== modelData.url) {
__rightPanel.source = "LinkSettings.qml" __rightPanel.source = modelData.url
} }
checked = true checked = true
} }
} Component.onCompleted: {
if(_first) {
QGCButton { _first = false
height: _buttonHeight
text: qsTr("Offline Maps")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "OfflineMap.qml") {
__rightPanel.source = "OfflineMap.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
text: qsTr("MAVLink")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "MavlinkSettings.qml") {
__rightPanel.source = "MavlinkSettings.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
text: qsTr("Console")
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "QGroundControl/Controls/AppMessages.qml") {
__rightPanel.source = "QGroundControl/Controls/AppMessages.qml"
}
checked = true
}
}
QGCButton {
height: _buttonHeight
text: qsTr("Mock Link")
visible: ScreenTools.isDebug
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "MockLink.qml") {
__rightPanel.source = "MockLink.qml"
}
checked = true checked = true
} }
} }
QGCButton {
height: _buttonHeight
text: qsTr("Debug")
visible: ScreenTools.isDebug
exclusiveGroup: panelActionGroup
onClicked: {
if(__rightPanel.source != "DebugWindow.qml") {
__rightPanel.source = "DebugWindow.qml"
}
checked = true
} }
} }
} }
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#include "AppMessages.h" #include "AppMessages.h"
#endif #endif
#ifndef __ios__ #ifndef NO_SERIAL_LINK
#include "SerialLink.h" #include "SerialLink.h"
#endif #endif
......
...@@ -33,9 +33,7 @@ ...@@ -33,9 +33,7 @@
#include "UASInterface.h" #include "UASInterface.h"
#include "LogCompressor.h" #include "LogCompressor.h"
#include "QGCMAVLinkInspector.h" #include "QGCMAVLinkInspector.h"
#ifndef __mobile__
#include "QGCMAVLinkLogPlayer.h" #include "QGCMAVLinkLogPlayer.h"
#endif
#include "MAVLinkDecoder.h" #include "MAVLinkDecoder.h"
#include "Vehicle.h" #include "Vehicle.h"
#include "QGCDockWidget.h" #include "QGCDockWidget.h"
...@@ -117,12 +115,10 @@ signals: ...@@ -117,12 +115,10 @@ signals:
#endif //QGC_MOUSE_ENABLED_LINUX #endif //QGC_MOUSE_ENABLED_LINUX
public: public:
#ifndef __mobile__
QGCMAVLinkLogPlayer* getLogPlayer() QGCMAVLinkLogPlayer* getLogPlayer()
{ {
return logPlayer; return logPlayer;
} }
#endif
protected: protected:
void connectCommonActions(); void connectCommonActions();
...@@ -133,9 +129,7 @@ protected: ...@@ -133,9 +129,7 @@ protected:
QSettings settings; QSettings settings;
QPointer<MAVLinkDecoder> mavlinkDecoder; QPointer<MAVLinkDecoder> mavlinkDecoder;
#ifndef __mobile__
QGCMAVLinkLogPlayer* logPlayer; QGCMAVLinkLogPlayer* logPlayer;
#endif
#ifdef QGC_MOUSE_ENABLED_WIN #ifdef QGC_MOUSE_ENABLED_WIN
/** @brief 3d Mouse support (WIN only) */ /** @brief 3d Mouse support (WIN only) */
Mouse3DInput* mouseInput; ///< 3dConnexion 3dMouse SDK Mouse3DInput* mouseInput; ///< 3dConnexion 3dMouse SDK
...@@ -164,10 +158,7 @@ protected: ...@@ -164,10 +158,7 @@ protected:
private slots: private slots:
void _closeWindow(void) { close(); } void _closeWindow(void) { close(); }
void _vehicleAdded(Vehicle* vehicle); void _vehicleAdded(Vehicle* vehicle);
#ifndef __mobile__
void _showDockWidgetAction(bool show); void _showDockWidgetAction(bool show);
#endif
#ifdef UNITTEST_BUILD #ifdef UNITTEST_BUILD
void _showQmlTestWidget(void); void _showQmlTestWidget(void);
...@@ -179,22 +170,17 @@ private: ...@@ -179,22 +170,17 @@ private:
void _openUrl(const QString& url, const QString& errorMessage); void _openUrl(const QString& url, const QString& errorMessage);
#ifndef __mobile__
QMap<QString, QGCDockWidget*> _mapName2DockWidget; QMap<QString, QGCDockWidget*> _mapName2DockWidget;
QMap<QString, QAction*> _mapName2Action; QMap<QString, QAction*> _mapName2Action;
#endif
void _storeCurrentViewState(void); void _storeCurrentViewState(void);
void _loadCurrentViewState(void); void _loadCurrentViewState(void);
#ifndef __mobile__
bool _createInnerDockWidget(const QString& widgetName); bool _createInnerDockWidget(const QString& widgetName);
void _buildCommonWidgets(void); void _buildCommonWidgets(void);
void _hideAllDockWidgets(void); void _hideAllDockWidgets(void);
void _showDockWidget(const QString &name, bool show); void _showDockWidget(const QString &name, bool show);
void _loadVisibleWidgetsSettings(void); void _loadVisibleWidgetsSettings(void);
void _storeVisibleWidgetsSettings(void); void _storeVisibleWidgetsSettings(void);
#endif
bool _lowPowerMode; ///< If enabled, QGC reduces the update rates of all widgets bool _lowPowerMode; ///< If enabled, QGC reduces the update rates of all widgets
bool _showStatusBar; bool _showStatusBar;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <QtEndian> #include <QtEndian>
#include "MainWindow.h" #include "MainWindow.h"
#ifndef __ios__ #ifndef NO_SERIAL_LINK
#include "SerialLink.h" #include "SerialLink.h"
#endif #endif
#include "QGCMAVLinkLogPlayer.h" #include "QGCMAVLinkLogPlayer.h"
......
...@@ -364,6 +364,7 @@ QGCView { ...@@ -364,6 +364,7 @@ QGCView {
text: qsTr("Virtual Joystick") text: qsTr("Virtual Joystick")
checked: QGroundControl.virtualTabletJoystick checked: QGroundControl.virtualTabletJoystick
onClicked: QGroundControl.virtualTabletJoystick = checked onClicked: QGroundControl.virtualTabletJoystick = checked
visible: QGroundControl.corePlugin.options.enableVirtualJoystick
} }
//----------------------------------------------------------------- //-----------------------------------------------------------------
//-- Map Providers //-- Map Providers
...@@ -433,6 +434,7 @@ QGCView { ...@@ -433,6 +434,7 @@ QGCView {
height: autoConnectLabel.height height: autoConnectLabel.height
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.corePlugin.options.enableAutoConnectOptions
QGCLabel { QGCLabel {
id: autoConnectLabel id: autoConnectLabel
text: qsTr("Autoconnect to the following devices:") text: qsTr("Autoconnect to the following devices:")
...@@ -443,6 +445,7 @@ QGCView { ...@@ -443,6 +445,7 @@ QGCView {
height: autoConnectCol.height + (ScreenTools.defaultFontPixelHeight * 2) height: autoConnectCol.height + (ScreenTools.defaultFontPixelHeight * 2)
width: qgcView.width * 0.8 width: qgcView.width * 0.8
color: qgcPal.windowShade color: qgcPal.windowShade
visible: QGroundControl.corePlugin.options.enableAutoConnectOptions
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Column { Column {
...@@ -494,6 +497,7 @@ QGCView { ...@@ -494,6 +497,7 @@ QGCView {
Item { Item {
width: qgcView.width * 0.8 width: qgcView.width * 0.8
height: videoLabel.height height: videoLabel.height
visible: QGroundControl.corePlugin.options.enableVideoSourceOptions
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
QGCLabel { QGCLabel {
...@@ -506,6 +510,7 @@ QGCView { ...@@ -506,6 +510,7 @@ QGCView {
height: videoCol.height + (ScreenTools.defaultFontPixelHeight * 2) height: videoCol.height + (ScreenTools.defaultFontPixelHeight * 2)
width: qgcView.width * 0.8 width: qgcView.width * 0.8
color: qgcPal.windowShade color: qgcPal.windowShade
visible: QGroundControl.corePlugin.options.enableVideoSourceOptions
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Column { Column {
......
...@@ -338,6 +338,7 @@ Rectangle { ...@@ -338,6 +338,7 @@ Rectangle {
source: "/res/QGCLogoWhite" source: "/res/QGCLogoWhite"
logo: true logo: true
onClicked: toolBar.showSettingsView() onClicked: toolBar.showSettingsView()
visible: !QGroundControl.corePlugin.options.combineSettingsAndSetup
} }
QGCToolBarButton { QGCToolBarButton {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment