Commit 5be07f48 authored by Gus Grubba's avatar Gus Grubba Committed by Gus Grubba

CP - Skip serial related code if serial links are disabled.

parent 2c6f5625
......@@ -922,13 +922,13 @@ HEADERS+= \
src/Vehicle/Vehicle.h \
src/VehicleSetup/VehicleComponent.h \
!MobileBuild {
!MobileBuild { !NoSerialBuild {
HEADERS += \
src/VehicleSetup/Bootloader.h \
src/VehicleSetup/FirmwareImage.h \
src/VehicleSetup/FirmwareUpgradeController.h \
src/VehicleSetup/PX4FirmwareUpgradeThread.h \
}
}}
SOURCES += \
src/AutoPilotPlugins/AutoPilotPlugin.cc \
......@@ -948,13 +948,13 @@ SOURCES += \
src/Vehicle/Vehicle.cc \
src/VehicleSetup/VehicleComponent.cc \
!MobileBuild {
!MobileBuild { !NoSerialBuild {
SOURCES += \
src/VehicleSetup/Bootloader.cc \
src/VehicleSetup/FirmwareImage.cc \
src/VehicleSetup/FirmwareUpgradeController.cc \
src/VehicleSetup/PX4FirmwareUpgradeThread.cc \
}
}}
# ArduPilot FirmwarePlugin
......
......@@ -440,7 +440,9 @@ void QGCApplication::_initCommon(void)
#ifndef __mobile__
qmlRegisterType<ViewWidgetController> (kQGCControllers, 1, 0, "ViewWidgetController");
qmlRegisterType<CustomCommandWidgetController> (kQGCControllers, 1, 0, "CustomCommandWidgetController");
#ifndef NO_SERIAL_LINK
qmlRegisterType<FirmwareUpgradeController> (kQGCControllers, 1, 0, "FirmwareUpgradeController");
#endif
qmlRegisterType<GeoTagController> (kQGCControllers, 1, 0, "GeoTagController");
qmlRegisterType<MavlinkConsoleController> (kQGCControllers, 1, 0, "MavlinkConsoleController");
#endif
......
......@@ -52,8 +52,10 @@ LinkManager::LinkManager(QGCApplication* app, QGCToolbox* toolbox)
, _autoConnectSettings(NULL)
, _mavlinkProtocol(NULL)
#ifndef __mobile__
#ifndef NO_SERIAL_LINK
, _nmeaPort(NULL)
#endif
#endif
{
qmlRegisterUncreatableType<LinkManager> ("QGroundControl", 1, 0, "LinkManager", "Reference only");
qmlRegisterUncreatableType<LinkConfiguration> ("QGroundControl", 1, 0, "LinkConfiguration", "Reference only");
......@@ -69,8 +71,10 @@ LinkManager::LinkManager(QGCApplication* app, QGCToolbox* toolbox)
LinkManager::~LinkManager()
{
#ifndef __mobile__
#ifndef NO_SERIAL_LINK
delete _nmeaPort;
#endif
#endif
}
void LinkManager::setToolbox(QGCToolbox *toolbox)
......@@ -513,6 +517,7 @@ void LinkManager::_updateAutoConnectLinks(void)
QGCSerialPortInfo::BoardType_t boardType;
QString boardName;
#ifndef NO_SERIAL_LINK
#ifndef __mobile__
if (portInfo.systemLocation().trimmed() == _autoConnectSettings->autoConnectNmeaPort()->cookedValueString()) {
if (portInfo.systemLocation().trimmed() != _nmeaDeviceName) {
......@@ -538,6 +543,7 @@ void LinkManager::_updateAutoConnectLinks(void)
qCDebug(LinkManagerLog) << "Configuring nmea baudrate" << _nmeaBaud;
}
} else
#endif
#endif
if (portInfo.getBoardInfo(boardType, boardName)) {
if (portInfo.isBootloader()) {
......
......@@ -237,9 +237,11 @@ private:
// NMEA GPS device for GCS position
#ifndef __mobile__
#ifndef NO_SERIAL_LINK
QString _nmeaDeviceName;
QSerialPort* _nmeaPort;
uint32_t _nmeaBaud;
#endif
#endif
};
......@@ -56,8 +56,10 @@
#endif
#ifndef __mobile__
#ifndef NO_SERIAL_LINK
Q_DECLARE_METATYPE(QGCSerialPortInfo)
#endif
#endif
#ifdef Q_OS_WIN
......@@ -159,7 +161,9 @@ int main(int argc, char *argv[])
#endif
qRegisterMetaType<QAbstractSocket::SocketError>();
#ifndef __mobile__
#ifndef NO_SERIAL_LINK
qRegisterMetaType<QGCSerialPortInfo>();
#endif
#endif
// We statically link our own QtLocation plugin
......
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