Commit 0920b979 authored by Gus Grubba's avatar Gus Grubba

Custom plugin work

parent 92bf4bd5
...@@ -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
......
...@@ -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">
......
...@@ -503,7 +503,7 @@ contains(DEFINES, QGC_ENABLE_BLUETOOTH) { ...@@ -503,7 +503,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 +651,7 @@ SOURCES += \ ...@@ -651,7 +651,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>
...@@ -34,7 +34,7 @@ QGCView { ...@@ -34,7 +34,7 @@ QGCView {
QGCPalette { id: qgcPal; colorGroupEnabled: enabled } QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _mainIsMap: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, true) : true property bool _mainIsMap: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, QGroundControl.mainViewIsMap) : true
property bool _isPipVisible: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_PIPVisibleKey, true) : false property bool _isPipVisible: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_PIPVisibleKey, true) : false
property real _roll: _activeVehicle ? _activeVehicle.roll.value : _defaultRoll property real _roll: _activeVehicle ? _activeVehicle.roll.value : _defaultRoll
......
...@@ -140,10 +140,10 @@ Item { ...@@ -140,10 +140,10 @@ Item {
} }
QGCLabel { QGCLabel {
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
......
...@@ -43,9 +43,24 @@ VideoManager::VideoManager(QGCApplication* app) ...@@ -43,9 +43,24 @@ VideoManager::VideoManager(QGCApplication* app)
{ {
//-- Get saved settings //-- Get saved settings
QSettings settings; QSettings settings;
#if defined(NO_UDP_VIDEO) && defined(QGC_GST_STREAMING)
setVideoSource(settings.value(kVideoSourceKey, kRTSPStream).toString());
#else
setVideoSource(settings.value(kVideoSourceKey, kUDPStream).toString()); setVideoSource(settings.value(kVideoSourceKey, kUDPStream).toString());
setUdpPort(settings.value(kVideoUDPPortKey, 5600).toUInt()); #endif
setRtspURL(settings.value(kVideoRTSPUrlKey, "rtsp://192.168.42.1:554/live").toString()); //-- Example RTSP URL //-- Check if core plugin defines its own video requirements
if(qgcApp()->qgcOptions()->definesVideo()) {
if(qgcApp()->qgcOptions()->videoUDPPort()) {
setUdpPort(qgcApp()->qgcOptions()->videoUDPPort());
setVideoSource(kUDPStream);
} else {
setVideoSource(kRTSPStream);
setRtspURL(qgcApp()->qgcOptions()->videoRSTPUrl());
}
} else {
setUdpPort(settings.value(kVideoUDPPortKey, 5600).toUInt());
setRtspURL(settings.value(kVideoRTSPUrlKey, "rtsp://192.168.42.1:554/live").toString()); //-- Example RTSP URL
}
_init = true; _init = true;
#if defined(QGC_GST_STREAMING) #if defined(QGC_GST_STREAMING)
_updateVideo(); _updateVideo();
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
#include CUSTOMHEADER #include CUSTOMHEADER
#endif #endif
#ifndef __ios__ #ifndef NO_SERIAL_LINK
#include "SerialLink.h" #include "SerialLink.h"
#endif #endif
......
...@@ -353,3 +353,68 @@ QMap<QString, FactMetaData*>& QGroundControlQmlGlobal::nameToMetaDataMap(void) { ...@@ -353,3 +353,68 @@ QMap<QString, FactMetaData*>& QGroundControlQmlGlobal::nameToMetaDataMap(void) {
return map; return map;
} }
bool QGroundControlQmlGlobal::colapseSettings()
{
return qgcApp()->qgcOptions()->colapseSettings();
}
bool QGroundControlQmlGlobal::mainViewIsMap()
{
return qgcApp()->qgcOptions()->mainViewIsMap();
}
bool QGroundControlQmlGlobal::enableVirtualJoystick()
{
return qgcApp()->qgcOptions()->enableVirtualJoystick();
}
bool QGroundControlQmlGlobal::enableAutoConnectOptions()
{
return qgcApp()->qgcOptions()->enableAutoConnectOptions();
}
bool QGroundControlQmlGlobal::enableVideoSourceOptions()
{
return qgcApp()->qgcOptions()->enableVideoSourceOptions();
}
bool QGroundControlQmlGlobal::hasCustomSettings()
{
if(qgcApp()->customCorePlugin()) {
if(qgcApp()->customCorePlugin()->settingsQML()) {
return !qgcApp()->customCorePlugin()->settingsQML()->pageUrl().isEmpty();
}
}
return false;
}
QString QGroundControlQmlGlobal::customSettingsURL()
{
if(qgcApp()->customCorePlugin()) {
if(qgcApp()->customCorePlugin()->settingsQML()) {
return qgcApp()->customCorePlugin()->settingsQML()->pageUrl();
}
}
return QString();
}
QString QGroundControlQmlGlobal::customSettingsTitle()
{
if(qgcApp()->customCorePlugin()) {
if(qgcApp()->customCorePlugin()->settingsQML()) {
return qgcApp()->customCorePlugin()->settingsQML()->pageTitle();
}
}
return QString();
}
QString QGroundControlQmlGlobal::customSettingsLogoUrl()
{
if(qgcApp()->customCorePlugin()) {
if(qgcApp()->customCorePlugin()->settingsQML()) {
return qgcApp()->customCorePlugin()->settingsQML()->pageIconUrl();
}
}
return QString();
}
...@@ -79,7 +79,6 @@ public: ...@@ -79,7 +79,6 @@ public:
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 +86,20 @@ public: ...@@ -87,6 +86,20 @@ 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)
//-------------------------------------------------------------------------
//-- Options that can be set by plugins
Q_PROPERTY(bool colapseSettings READ colapseSettings CONSTANT)
Q_PROPERTY(bool mainViewIsMap READ mainViewIsMap 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 hasCustomSettings READ hasCustomSettings CONSTANT)
Q_PROPERTY(QString customSettingsURL READ customSettingsURL CONSTANT)
Q_PROPERTY(QString customSettingsTitle READ customSettingsTitle CONSTANT)
Q_PROPERTY(QString customSettingsLogoUrl READ customSettingsLogoUrl CONSTANT)
//-------------------------------------------------------------------------
// 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)
...@@ -185,6 +198,16 @@ public: ...@@ -185,6 +198,16 @@ public:
bool isVersionCheckEnabled () { return _toolbox->mavlinkProtocol()->versionCheckEnabled(); } bool isVersionCheckEnabled () { return _toolbox->mavlinkProtocol()->versionCheckEnabled(); }
int mavlinkSystemID () { return _toolbox->mavlinkProtocol()->getSystemId(); } int mavlinkSystemID () { return _toolbox->mavlinkProtocol()->getSystemId(); }
bool colapseSettings ();
bool mainViewIsMap ();
bool enableVirtualJoystick ();
bool enableAutoConnectOptions();
bool enableVideoSourceOptions();
bool hasCustomSettings ();
QString customSettingsTitle ();
QString customSettingsURL ();
QString customSettingsLogoUrl ();
QGeoCoordinate lastKnownHomePosition() { return qgcApp()->lastKnownHomePosition(); } QGeoCoordinate lastKnownHomePosition() { return qgcApp()->lastKnownHomePosition(); }
static Fact* offlineEditingFirmwareType (void); static Fact* offlineEditingFirmwareType (void);
...@@ -196,9 +219,6 @@ public: ...@@ -196,9 +219,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);
......
...@@ -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,33 @@ Rectangle { ...@@ -256,6 +256,33 @@ Rectangle {
visible: !ScreenTools.isShortScreen visible: !ScreenTools.isShortScreen
} }
SubMenuButton {
imageResource: "/res/gear-white.svg"
setupIndicator: false
exclusiveGroup: setupButtonGroup
text: "General"
visible: QGroundControl.colapseSettings
onClicked: panelLoader.setSource("GeneralSettings.qml")
}
SubMenuButton {
imageResource: QGroundControl.customSettingsLogoUrl
setupIndicator: false
exclusiveGroup: setupButtonGroup
text: QGroundControl.customSettingsTitle
visible: QGroundControl.colapseSettings && QGroundControl.hasCustomSettings
onClicked: panelLoader.setSource(QGroundControl.customSettingsURL)
}
SubMenuButton {
imageResource: "/res/waves.svg"
setupIndicator: false
exclusiveGroup: setupButtonGroup
text: "MAVLink"
visible: QGroundControl.colapseSettings
onClicked: panelLoader.setSource("MavlinkSettings.qml")
}
SubMenuButton { SubMenuButton {
id: summaryButton id: summaryButton
imageResource: "/qmlimages/VehicleSummaryIcon.png" imageResource: "/qmlimages/VehicleSummaryIcon.png"
......
...@@ -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"
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#include "AppMessages.h"