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