Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct NO_SERIAL_LINK Checks #11413

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ if(QGC_DEBUG_QML)
add_compile_definitions(QT_QML_DEBUG)
endif()

cmake_dependent_option(QGC_NO_SERIAL_LINK "Build QGroundControl without Serial Support Support." OFF "NOT IOS" ON)

#######################################################
# QGroundControl Resources
#######################################################
Expand Down
2 changes: 1 addition & 1 deletion android/src/AndroidInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "AndroidInterface.h"

#include <QJniObject>
#include <QtCore/QJniObject>
#include <QtCore/private/qandroidextras_p.h>

bool AndroidInterface::checkStoragePermissions()
Expand Down
2 changes: 1 addition & 1 deletion src/FactSystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ target_link_libraries(FactSystem
Qt6::Qml
api
AutoPilotPlugins
comm
FactControls
FirmwarePlugin
Settings
Expand All @@ -33,6 +32,7 @@ target_link_libraries(FactSystem
VehicleComponents
PUBLIC
Qt6::Core
comm
qgc
)

Expand Down
107 changes: 56 additions & 51 deletions src/GPS/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,56 +1,61 @@
find_package(Qt6 REQUIRED COMPONENTS Core)

# include(FetchContent)
# FetchContent_Declare(gps_drivers
# GIT_REPOSITORY https://github.com/PX4/PX4-GPSDrivers.git
# GIT_TAG main
# GIT_SHALLOW TRUE
# )
# FetchContent_GetProperties(gps_drivers)
# if(NOT gps_drivers_POPULATED)
# FetchContent_Populate(gps_drivers)
# add_subdirectory(${gps_drivers_SOURCE_DIR} ${gps_drivers_BINARY_DIR} EXCLUDE_FROM_ALL)
# endif()
qt_add_library(gps STATIC)

qt_add_library(gps STATIC
definitions.h
Drivers/src/ashtech.cpp
Drivers/src/ashtech.h
Drivers/src/gps_helper.cpp
Drivers/src/gps_helper.h
Drivers/src/mtk.cpp
Drivers/src/mtk.h
Drivers/src/rtcm.cpp
Drivers/src/rtcm.h
Drivers/src/sbf.cpp
Drivers/src/sbf.h
Drivers/src/ubx.cpp
Drivers/src/ubx.h
GPSManager.cc
GPSManager.h
GPSPositionMessage.h
GPSProvider.cc
GPSProvider.h
RTCMMavlink.cc
RTCMMavlink.h
satellite_info.h
sensor_gnss_relative.h
sensor_gps.h
)
if(NOT QGC_NO_SERIAL_LINK)
# include(FetchContent)
# FetchContent_Declare(gps_drivers
# GIT_REPOSITORY https://github.com/PX4/PX4-GPSDrivers.git
# GIT_TAG main
# GIT_SHALLOW TRUE
# )
# FetchContent_GetProperties(gps_drivers)
# if(NOT gps_drivers_POPULATED)
# FetchContent_Populate(gps_drivers)
# add_subdirectory(${gps_drivers_SOURCE_DIR} ${gps_drivers_BINARY_DIR} EXCLUDE_FROM_ALL)
# endif()

target_link_libraries(gps
PRIVATE
comm
Settings
Utilities
Vehicle
PUBLIC
Qt6::Core
qgc
)
target_sources(gps
PRIVATE
definitions.h
Drivers/src/ashtech.cpp
Drivers/src/ashtech.h
Drivers/src/gps_helper.cpp
Drivers/src/gps_helper.h
Drivers/src/mtk.cpp
Drivers/src/mtk.h
Drivers/src/rtcm.cpp
Drivers/src/rtcm.h
Drivers/src/sbf.cpp
Drivers/src/sbf.h
Drivers/src/ubx.cpp
Drivers/src/ubx.h
GPSManager.cc
GPSManager.h
GPSPositionMessage.h
GPSProvider.cc
GPSProvider.h
RTCMMavlink.cc
RTCMMavlink.h
satellite_info.h
sensor_gnss_relative.h
sensor_gps.h
)

target_include_directories(gps
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
Drivers/src
)
target_link_libraries(gps
PRIVATE
Settings
Utilities
Vehicle
PUBLIC
Qt6::Core
comm
qgc
)

target_include_directories(gps
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
Drivers/src
)
endif()
2 changes: 1 addition & 1 deletion src/Joystick/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ target_link_libraries(Joystick
AutoPilotPlugins
Camera
FirmwarePlugin
qgc
Settings
Utilities
Vehicle
VideoManager
PUBLIC
Qt6::Core
comm
qgc
QmlControls
)

Expand Down
1 change: 1 addition & 0 deletions src/MissionManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ target_link_libraries(MissionManager
Geo
PUBLIC
Qt6::Xml
comm
qgc
Settings
UTMSP
Expand Down
1 change: 0 additions & 1 deletion src/MissionManager/VisualMissionItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "QGCMAVLink.h"
#include "QmlObjectListModel.h"
#include "QmlObjectListModel.h"
#include "Vehicle.h"
#include "MissionController.h"

Expand Down
1 change: 1 addition & 0 deletions src/PositionManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ qt_add_library(PositionManager STATIC

target_link_libraries(PositionManager
PRIVATE
Qt6::PositioningPrivate
api
Vehicle
PUBLIC
Expand Down
13 changes: 4 additions & 9 deletions src/QGCApplication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,13 @@
#include "Viewer3DTerrainTexture.h"
#include "LinkConfiguration.h"

#ifndef __mobile__
#include "FirmwareUpgradeController.h"
#endif

#ifndef NO_SERIAL_LINK
#include "FirmwareUpgradeController.h"
#include "SerialLink.h"
#endif

#ifdef Q_OS_LINUX
#ifndef __mobile__
#ifndef Q_OS_ANDROID
#include <unistd.h>
#include <sys/types.h>
#endif
Expand Down Expand Up @@ -185,7 +182,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
_msecsElapsedTime.start();

#ifdef Q_OS_LINUX
#ifndef __mobile__
#ifndef Q_OS_ANDROID
if (!_runningUnitTests) {
if (getuid() == 0) {
_exitWithError(QString(
Expand Down Expand Up @@ -486,10 +483,8 @@ void QGCApplication::_initCommon()
qmlRegisterType<ToolStripAction> ("QGroundControl.Controls", 1, 0, "ToolStripAction");
qmlRegisterType<ToolStripActionList> ("QGroundControl.Controls", 1, 0, "ToolStripActionList");

#ifndef __mobile__
#ifndef NO_SERIAL_LINK
qmlRegisterType<FirmwareUpgradeController> (kQGCControllers, 1, 0, "FirmwareUpgradeController");
#endif
#endif
qmlRegisterType<GeoTagController> (kQGCControllers, 1, 0, "GeoTagController");
qmlRegisterType<MavlinkConsoleController> (kQGCControllers, 1, 0, "MavlinkConsoleController");
Expand Down Expand Up @@ -543,7 +538,7 @@ bool QGCApplication::_initForNormalAppBoot()
}

#ifdef Q_OS_LINUX
#ifndef __mobile__
#ifndef Q_OS_ANDROID
#ifndef NO_SERIAL_LINK
if (!_runningUnitTests) {
// Determine if we have the correct permissions to access USB serial devices
Expand Down
6 changes: 3 additions & 3 deletions src/QGCToolbox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "FactSystem.h"
#include "FirmwarePluginManager.h"
#ifndef __mobile__
#ifndef NO_SERIAL_LINK
#include "GPSManager.h"
#endif
#include "JoystickManager.h"
Expand Down Expand Up @@ -64,7 +64,7 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
_scanAndLoadPlugins(app);
_factSystem = new FactSystem (app, this);
_firmwarePluginManager = new FirmwarePluginManager (app, this);
#ifndef __mobile__
#ifndef NO_SERIAL_LINK
_gpsManager = new GPSManager (app, this);
#endif
_imageProvider = new QGCImageProvider (app, this);
Expand Down Expand Up @@ -99,7 +99,7 @@ void QGCToolbox::setChildToolboxes(void)
_corePlugin->setToolbox(this);
_factSystem->setToolbox(this);
_firmwarePluginManager->setToolbox(this);
#ifndef __mobile__
#ifndef NO_SERIAL_LINK
_gpsManager->setToolbox(this);
#endif
_imageProvider->setToolbox(this);
Expand Down
4 changes: 2 additions & 2 deletions src/QGCToolbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class QGCToolbox : public QObject {
QGCCorePlugin* corePlugin () { return _corePlugin; }
SettingsManager* settingsManager () { return _settingsManager; }
ADSBVehicleManager* adsbVehicleManager () { return _adsbVehicleManager; }
#ifndef __mobile__
#ifndef NO_SERIAL_LINK
GPSManager* gpsManager () { return _gpsManager; }
#endif
#ifndef QGC_AIRLINK_DISABLED
Expand All @@ -79,7 +79,7 @@ class QGCToolbox : public QObject {

FactSystem* _factSystem = nullptr;
FirmwarePluginManager* _firmwarePluginManager = nullptr;
#ifndef __mobile__
#ifndef NO_SERIAL_LINK
GPSManager* _gpsManager = nullptr;
#endif
QGCImageProvider* _imageProvider = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions src/QmlControls/QGroundControlQmlGlobal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "QGCMapUrlEngine.h"
#include "FirmwarePluginManager.h"
#include "AppSettings.h"
#ifndef __mobile__
#ifndef NO_SERIAL_LINK
#include "GPSManager.h"
#endif
#include "QGCPalette.h"
Expand Down Expand Up @@ -86,7 +86,7 @@ void QGroundControlQmlGlobal::setToolbox(QGCToolbox* toolbox)
_corePlugin = toolbox->corePlugin();
_firmwarePluginManager = toolbox->firmwarePluginManager();
_settingsManager = toolbox->settingsManager();
#ifndef __mobile__
#ifndef NO_SERIAL_LINK
_gpsRtkFactGroup = toolbox->gpsManager()->gpsRtkFactGroup();
#endif
_adsbVehicleManager = toolbox->adsbVehicleManager();
Expand Down
6 changes: 6 additions & 0 deletions src/QmlControls/QGroundControlQmlGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ class QGroundControlQmlGlobal : public QGCTool
Q_PROPERTY(ADSBVehicleManager* adsbVehicleManager READ adsbVehicleManager CONSTANT)
Q_PROPERTY(QGCCorePlugin* corePlugin READ corePlugin CONSTANT)
Q_PROPERTY(MissionCommandTree* missionCommandTree READ missionCommandTree CONSTANT)
#ifndef NO_SERIAL_LINK
Q_PROPERTY(FactGroup* gpsRtk READ gpsRtkFactGroup CONSTANT)
#endif
#ifndef QGC_AIRLINK_DISABLED
Q_PROPERTY(AirLinkManager* airlinkManager READ airlinkManager CONSTANT)
#endif
Expand Down Expand Up @@ -173,7 +175,9 @@ class QGroundControlQmlGlobal : public QGCTool
MAVLinkLogManager* mavlinkLogManager () { return _mavlinkLogManager; }
QGCCorePlugin* corePlugin () { return _corePlugin; }
SettingsManager* settingsManager () { return _settingsManager; }
#ifndef NO_SERIAL_LINK
FactGroup* gpsRtkFactGroup () { return _gpsRtkFactGroup; }
#endif
ADSBVehicleManager* adsbVehicleManager () { return _adsbVehicleManager; }
QmlUnitsConversion* unitsConversion () { return &_unitsConversion; }
static QGeoCoordinate flightMapPosition () { return _coord; }
Expand Down Expand Up @@ -262,7 +266,9 @@ class QGroundControlQmlGlobal : public QGCTool
QGCCorePlugin* _corePlugin = nullptr;
FirmwarePluginManager* _firmwarePluginManager = nullptr;
SettingsManager* _settingsManager = nullptr;
#ifndef NO_SERIAL_LINK
FactGroup* _gpsRtkFactGroup = nullptr;
#endif
AirLinkManager* _airlinkManager = nullptr;
ADSBVehicleManager* _adsbVehicleManager = nullptr;
QGCPalette* _globalPalette = nullptr;
Expand Down
30 changes: 21 additions & 9 deletions src/VehicleSetup/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)

qt_add_library(VehicleSetup STATIC
Bootloader.cc
Bootloader.h
FirmwareImage.cc
FirmwareImage.h
FirmwareUpgradeController.cc
FirmwareUpgradeController.h
JoystickConfigController.cc
JoystickConfigController.h
PX4FirmwareUpgradeThread.cc
PX4FirmwareUpgradeThread.h
VehicleComponent.cc
VehicleComponent.h
)

add_custom_target(VehicleSetupQml
SOURCES
FirmwareUpgrade.qml
JoystickConfig.qml
JoystickConfigAdvanced.qml
JoystickConfigButtons.qml
Expand Down Expand Up @@ -51,3 +42,24 @@ target_link_libraries(VehicleSetup
)

target_include_directories(VehicleSetup PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

if(NOT QGC_NO_SERIAL_LINK)
target_sources(VehicleSetup
PRIVATE
Bootloader.cc
Bootloader.h
FirmwareImage.cc
FirmwareImage.h
FirmwareUpgradeController.cc
FirmwareUpgradeController.h
PX4FirmwareUpgradeThread.cc
PX4FirmwareUpgradeThread.h
)

target_link_libraries(VehicleSetup PUBLIC comm)

target_sources(VehicleSetupQml
PRIVATE
FirmwareUpgrade.qml
)
endif()
Loading