diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index c8ab9307f26..e1fbb386763 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -392,6 +392,7 @@ INCLUDEPATH += \ src/ui/toolbar \ src/ui/uas \ src/Viewer3D \ + src/Utilities # # Plugin API @@ -440,9 +441,9 @@ HEADERS += \ src/Joystick/Joystick.h \ src/Joystick/JoystickManager.h \ src/Joystick/JoystickMavCommand.h \ - src/JsonHelper.h \ - src/KMLDomDocument.h \ - src/KMLHelper.h \ + src/Utilities/JsonHelper.h \ + src/MissionManager/KMLDomDocument.h \ + src/MissionManager/KMLHelper.h \ src/MissionManager/CameraCalc.h \ src/MissionManager/CameraSection.h \ src/MissionManager/CameraSpec.h \ @@ -495,16 +496,16 @@ HEADERS += \ src/Geo/MGRS.hpp \ src/Geo/TransverseMercator.hpp \ src/Geo/PolarStereographic.hpp \ - src/QGC.h \ + src/Utilities/QGC.h \ src/QGCApplication.h \ - src/QGCCachedFileDownload.h \ + src/Utilities/QGCCachedFileDownload.h \ src/QGCConfig.h \ - src/QGCFileDownload.h \ - src/QGCLoggingCategory.h \ - src/QGCMapPalette.h \ - src/QGCPalette.h \ - src/QGCQGeoCoordinate.h \ - src/QGCTemporaryFile.h \ + src/Utilities/QGCFileDownload.h \ + src/Utilities/QGCLoggingCategory.h \ + src/QmlControls/QGCMapPalette.h \ + src/QmlControls/QGCPalette.h \ + src/Utilities/QGCQGeoCoordinate.h \ + src/Utilities/QGCTemporaryFile.h \ src/QGCToolbox.h \ src/QmlControls/AppMessages.h \ src/QmlControls/EditPositionDialogController.h \ @@ -543,10 +544,10 @@ HEADERS += \ src/Settings/SettingsManager.h \ src/Settings/UnitsSettings.h \ src/Settings/VideoSettings.h \ - src/ShapeFileHelper.h \ - src/SHPFileHelper.h \ + src/Utilities/ShapeFileHelper.h \ + src/Utilities/SHPFileHelper.h \ src/Terrain/TerrainQuery.h \ - src/TerrainTile.h \ + src/Terrain/TerrainTile.h \ src/Vehicle/Actuators/ActuatorActions.h \ src/Vehicle/Actuators/Actuators.h \ src/Vehicle/Actuators/ActuatorOutputs.h \ @@ -607,7 +608,7 @@ HEADERS += \ src/comm/TCPLink.h \ src/comm/UDPLink.h \ src/comm/UdpIODevice.h \ - src/uas/UASMessageHandler.h \ + src/Vehicle/UASMessageHandler.h \ src/AnalyzeView/GeoTagController.h \ src/AnalyzeView/ExifParser.h \ src/Viewer3D/CityMapGeometry.h \ @@ -670,13 +671,15 @@ HEADERS += \ iOSBuild { OBJECTIVE_SOURCES += \ - src/MobileScreenMgr.mm \ + src/Utilities/MobileScreenMgr.mm \ } AndroidBuild { SOURCES += \ - src/MobileScreenMgr.cc \ - src/Joystick/JoystickAndroid.cc \ + src/Utilities/MobileScreenMgr.cc \ + src/Joystick/JoystickAndroid.cc + + HEADERS += src/Utilities/MobileScreenMgr.h } SOURCES += \ @@ -700,9 +703,9 @@ SOURCES += \ src/Joystick/Joystick.cc \ src/Joystick/JoystickManager.cc \ src/Joystick/JoystickMavCommand.cc \ - src/JsonHelper.cc \ - src/KMLDomDocument.cc \ - src/KMLHelper.cc \ + src/Utilities/JsonHelper.cc \ + src/MissionManager/KMLDomDocument.cc \ + src/MissionManager/KMLHelper.cc \ src/MissionManager/CameraCalc.cc \ src/MissionManager/CameraSection.cc \ src/MissionManager/CameraSpec.cc \ @@ -753,15 +756,15 @@ SOURCES += \ src/Geo/MGRS.cpp \ src/Geo/TransverseMercator.cpp \ src/Geo/PolarStereographic.cpp \ - src/QGC.cc \ + src/Utilities/QGC.cc \ src/QGCApplication.cc \ - src/QGCCachedFileDownload.cc \ - src/QGCFileDownload.cc \ - src/QGCLoggingCategory.cc \ - src/QGCMapPalette.cc \ - src/QGCPalette.cc \ - src/QGCQGeoCoordinate.cc \ - src/QGCTemporaryFile.cc \ + src/Utilities/QGCCachedFileDownload.cc \ + src/Utilities/QGCFileDownload.cc \ + src/Utilities/QGCLoggingCategory.cc \ + src/QmlControls/QGCMapPalette.cc \ + src/QmlControls/QGCPalette.cc \ + src/Utilities/QGCQGeoCoordinate.cc \ + src/Utilities/QGCTemporaryFile.cc \ src/QGCToolbox.cc \ src/QmlControls/AppMessages.cc \ src/QmlControls/EditPositionDialogController.cc \ @@ -800,10 +803,10 @@ SOURCES += \ src/Settings/SettingsManager.cc \ src/Settings/UnitsSettings.cc \ src/Settings/VideoSettings.cc \ - src/ShapeFileHelper.cc \ - src/SHPFileHelper.cc \ + src/Utilities/ShapeFileHelper.cc \ + src/Utilities/SHPFileHelper.cc \ src/Terrain/TerrainQuery.cc \ - src/TerrainTile.cc\ + src/Terrain/TerrainTile.cc \ src/Vehicle/Actuators/ActuatorActions.cc \ src/Vehicle/Actuators/Actuators.cc \ src/Vehicle/Actuators/ActuatorOutputs.cc \ @@ -865,7 +868,7 @@ SOURCES += \ src/comm/UDPLink.cc \ src/comm/UdpIODevice.cc \ src/main.cc \ - src/uas/UASMessageHandler.cc \ + src/Vehicle/UASMessageHandler.cc \ src/AnalyzeView/GeoTagController.cc \ src/AnalyzeView/ExifParser.cc \ src/Viewer3D/CityMapGeometry.cc \ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 341a69b0a7d..2eb7b740879 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,62 +11,20 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) -####################################################### -# Mobile Specific Sources -####################################################### -set(EXTRA_SRC) - -if (MOBILE) - list(APPEND EXTRA_SRC - MobileScreenMgr.cc - MobileScreenMgr.h - ) -endif () - ####################################################### # Source Files ####################################################### qt_add_library(${PROJECT_NAME} STATIC - ${EXTRA_SRC} - CmdLineOptParser.cc CmdLineOptParser.h - JsonHelper.cc - JsonHelper.h - KMLDomDocument.cc - KMLDomDocument.h - KMLHelper.cc - KMLHelper.h main.cc - QGC.cc - QGC.h QGCApplication.cc QGCApplication.h - QGCCachedFileDownload.cc - QGCCachedFileDownload.h QGCConfig.h - QGCFileDownload.cc - QGCFileDownload.h - QGCLoggingCategory.cc - QGCLoggingCategory.h - QGCMapPalette.cc - QGCMapPalette.h - QGCPalette.cc - QGCPalette.h - QGCQGeoCoordinate.cc - QGCQGeoCoordinate.h - QGCTemporaryFile.cc - QGCTemporaryFile.h QGCToolbox.cc QGCToolbox.h RunGuard.cc RunGuard.h - ShapeFileHelper.cc - ShapeFileHelper.h - SHPFileHelper.cc - SHPFileHelper.h - TerrainTile.cc - TerrainTile.h ) target_precompile_headers(${PROJECT_NAME} PRIVATE pch.h) @@ -103,7 +61,7 @@ if (NOT ${QGC_AIRLINK_DISABLED}) add_subdirectory(AirLink) endif() add_subdirectory(Terrain) -add_subdirectory(uas) +add_subdirectory(Utilities) add_subdirectory(UTMSP) add_subdirectory(Vehicle) add_subdirectory(VehicleSetup) @@ -116,7 +74,6 @@ add_subdirectory(Viewer3D) ####################################################### target_link_libraries(${PROJECT_NAME} PRIVATE - shp Qt6::QuickControls2 PUBLIC Qt6::QuickWidgets @@ -145,7 +102,7 @@ target_link_libraries(${PROJECT_NAME} QGCLocation Settings Terrain - uas + Utilities UTMSP Vehicle VehicleSetup @@ -162,5 +119,4 @@ endif() target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/libs/shapelib ) diff --git a/src/MissionManager/CMakeLists.txt b/src/MissionManager/CMakeLists.txt index e429ff884e7..f0488927e2b 100644 --- a/src/MissionManager/CMakeLists.txt +++ b/src/MissionManager/CMakeLists.txt @@ -20,6 +20,10 @@ qt_add_library(MissionManager STATIC GeoFenceController.h GeoFenceManager.cc GeoFenceManager.h + KMLDomDocument.cc + KMLDomDocument.h + KMLHelper.cc + KMLHelper.h KMLPlanDomDocument.cc KMLPlanDomDocument.h LandingComplexItem.cc @@ -83,8 +87,6 @@ qt_add_library(MissionManager STATIC VisualMissionItem.h VTOLLandingComplexItem.cc VTOLLandingComplexItem.h - - Section.h # shouldn't be listed here, but isn't named properly for AUTOMOC ) add_custom_Target(MisionManagerQml @@ -101,4 +103,7 @@ target_link_libraries(MissionManager qgc ) -target_include_directories(MissionManager INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(MissionManager + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/src/KMLDomDocument.cc b/src/MissionManager/KMLDomDocument.cc similarity index 100% rename from src/KMLDomDocument.cc rename to src/MissionManager/KMLDomDocument.cc diff --git a/src/KMLDomDocument.h b/src/MissionManager/KMLDomDocument.h similarity index 100% rename from src/KMLDomDocument.h rename to src/MissionManager/KMLDomDocument.h diff --git a/src/KMLHelper.cc b/src/MissionManager/KMLHelper.cc similarity index 100% rename from src/KMLHelper.cc rename to src/MissionManager/KMLHelper.cc diff --git a/src/KMLHelper.h b/src/MissionManager/KMLHelper.h similarity index 100% rename from src/KMLHelper.h rename to src/MissionManager/KMLHelper.h diff --git a/src/PositionManager/CMakeLists.txt b/src/PositionManager/CMakeLists.txt index 216792fff8a..7d616046ade 100644 --- a/src/PositionManager/CMakeLists.txt +++ b/src/PositionManager/CMakeLists.txt @@ -1,7 +1,9 @@ qt_add_library(PositionManager STATIC PositionManager.cpp + PositionManager.h SimulatedPosition.cc + SimulatedPosition.h ) target_link_libraries(PositionManager diff --git a/src/QmlControls/CMakeLists.txt b/src/QmlControls/CMakeLists.txt index ecf4a3c647d..39250433461 100644 --- a/src/QmlControls/CMakeLists.txt +++ b/src/QmlControls/CMakeLists.txt @@ -11,6 +11,10 @@ qt_add_library(QmlControls STATIC HorizontalFactValueGrid.h InstrumentValueData.cc InstrumentValueData.h + QGCMapPalette.cc + QGCMapPalette.h + QGCPalette.cc + QGCPalette.h ParameterEditorController.cc ParameterEditorController.h QGCFileDialogController.cc diff --git a/src/QGCMapPalette.cc b/src/QmlControls/QGCMapPalette.cc similarity index 100% rename from src/QGCMapPalette.cc rename to src/QmlControls/QGCMapPalette.cc diff --git a/src/QGCMapPalette.h b/src/QmlControls/QGCMapPalette.h similarity index 100% rename from src/QGCMapPalette.h rename to src/QmlControls/QGCMapPalette.h diff --git a/src/QGCPalette.cc b/src/QmlControls/QGCPalette.cc similarity index 100% rename from src/QGCPalette.cc rename to src/QmlControls/QGCPalette.cc diff --git a/src/QGCPalette.h b/src/QmlControls/QGCPalette.h similarity index 100% rename from src/QGCPalette.h rename to src/QmlControls/QGCPalette.h diff --git a/src/Terrain/CMakeLists.txt b/src/Terrain/CMakeLists.txt index 108d2c68c32..b3d0549e5f5 100644 --- a/src/Terrain/CMakeLists.txt +++ b/src/Terrain/CMakeLists.txt @@ -1,6 +1,9 @@ qt_add_library(Terrain STATIC TerrainQuery.cc + TerrainQuery.h + TerrainTile.cc + TerrainTile.h ) target_link_libraries(Terrain diff --git a/src/TerrainTile.cc b/src/Terrain/TerrainTile.cc similarity index 100% rename from src/TerrainTile.cc rename to src/Terrain/TerrainTile.cc diff --git a/src/TerrainTile.h b/src/Terrain/TerrainTile.h similarity index 100% rename from src/TerrainTile.h rename to src/Terrain/TerrainTile.h diff --git a/src/Utilities/CMakeLists.txt b/src/Utilities/CMakeLists.txt new file mode 100644 index 00000000000..db172255ab1 --- /dev/null +++ b/src/Utilities/CMakeLists.txt @@ -0,0 +1,46 @@ +find_package(Qt6 REQUIRED COMPONENTS Core Positioning Qml) + +qt_add_library(Utilities STATIC + JsonHelper.cc + JsonHelper.h + QGC.cc + QGC.h + QGCCachedFileDownload.cc + QGCCachedFileDownload.h + QGCFileDownload.cc + QGCFileDownload.h + QGCLoggingCategory.cc + QGCLoggingCategory.h + QGCQGeoCoordinate.cc + QGCQGeoCoordinate.h + QGCTemporaryFile.cc + QGCTemporaryFile.h + ShapeFileHelper.cc + ShapeFileHelper.h + SHPFileHelper.cc + SHPFileHelper.h +) + +if(MOBILE) + target_sources(Utilities + PRIVATE + MobileScreenMgr.cc + MobileScreenMgr.h + ) +endif() + +target_link_libraries(Utilities + PRIVATE + Qt6::Qml + shp + PUBLIC + Qt6::Core + Qt6::Positioning + qgc +) + +target_include_directories(Utilities + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/libs/shapelib +) diff --git a/src/JsonHelper.cc b/src/Utilities/JsonHelper.cc similarity index 100% rename from src/JsonHelper.cc rename to src/Utilities/JsonHelper.cc diff --git a/src/JsonHelper.h b/src/Utilities/JsonHelper.h similarity index 100% rename from src/JsonHelper.h rename to src/Utilities/JsonHelper.h diff --git a/src/MobileScreenMgr.cc b/src/Utilities/MobileScreenMgr.cc similarity index 100% rename from src/MobileScreenMgr.cc rename to src/Utilities/MobileScreenMgr.cc diff --git a/src/MobileScreenMgr.h b/src/Utilities/MobileScreenMgr.h similarity index 100% rename from src/MobileScreenMgr.h rename to src/Utilities/MobileScreenMgr.h diff --git a/src/MobileScreenMgr.mm b/src/Utilities/MobileScreenMgr.mm similarity index 100% rename from src/MobileScreenMgr.mm rename to src/Utilities/MobileScreenMgr.mm diff --git a/src/QGC.cc b/src/Utilities/QGC.cc similarity index 100% rename from src/QGC.cc rename to src/Utilities/QGC.cc diff --git a/src/QGC.h b/src/Utilities/QGC.h similarity index 100% rename from src/QGC.h rename to src/Utilities/QGC.h diff --git a/src/QGCCachedFileDownload.cc b/src/Utilities/QGCCachedFileDownload.cc similarity index 100% rename from src/QGCCachedFileDownload.cc rename to src/Utilities/QGCCachedFileDownload.cc diff --git a/src/QGCCachedFileDownload.h b/src/Utilities/QGCCachedFileDownload.h similarity index 100% rename from src/QGCCachedFileDownload.h rename to src/Utilities/QGCCachedFileDownload.h diff --git a/src/QGCFileDownload.cc b/src/Utilities/QGCFileDownload.cc similarity index 100% rename from src/QGCFileDownload.cc rename to src/Utilities/QGCFileDownload.cc diff --git a/src/QGCFileDownload.h b/src/Utilities/QGCFileDownload.h similarity index 100% rename from src/QGCFileDownload.h rename to src/Utilities/QGCFileDownload.h diff --git a/src/QGCLoggingCategory.cc b/src/Utilities/QGCLoggingCategory.cc similarity index 100% rename from src/QGCLoggingCategory.cc rename to src/Utilities/QGCLoggingCategory.cc diff --git a/src/QGCLoggingCategory.h b/src/Utilities/QGCLoggingCategory.h similarity index 100% rename from src/QGCLoggingCategory.h rename to src/Utilities/QGCLoggingCategory.h diff --git a/src/QGCQGeoCoordinate.cc b/src/Utilities/QGCQGeoCoordinate.cc similarity index 100% rename from src/QGCQGeoCoordinate.cc rename to src/Utilities/QGCQGeoCoordinate.cc diff --git a/src/QGCQGeoCoordinate.h b/src/Utilities/QGCQGeoCoordinate.h similarity index 100% rename from src/QGCQGeoCoordinate.h rename to src/Utilities/QGCQGeoCoordinate.h diff --git a/src/QGCTemporaryFile.cc b/src/Utilities/QGCTemporaryFile.cc similarity index 100% rename from src/QGCTemporaryFile.cc rename to src/Utilities/QGCTemporaryFile.cc diff --git a/src/QGCTemporaryFile.h b/src/Utilities/QGCTemporaryFile.h similarity index 100% rename from src/QGCTemporaryFile.h rename to src/Utilities/QGCTemporaryFile.h diff --git a/src/SHPFileHelper.cc b/src/Utilities/SHPFileHelper.cc similarity index 100% rename from src/SHPFileHelper.cc rename to src/Utilities/SHPFileHelper.cc diff --git a/src/SHPFileHelper.h b/src/Utilities/SHPFileHelper.h similarity index 100% rename from src/SHPFileHelper.h rename to src/Utilities/SHPFileHelper.h diff --git a/src/ShapeFileHelper.cc b/src/Utilities/ShapeFileHelper.cc similarity index 100% rename from src/ShapeFileHelper.cc rename to src/Utilities/ShapeFileHelper.cc diff --git a/src/ShapeFileHelper.h b/src/Utilities/ShapeFileHelper.h similarity index 100% rename from src/ShapeFileHelper.h rename to src/Utilities/ShapeFileHelper.h diff --git a/src/Vehicle/CMakeLists.txt b/src/Vehicle/CMakeLists.txt index d6361176574..582a4f070db 100644 --- a/src/Vehicle/CMakeLists.txt +++ b/src/Vehicle/CMakeLists.txt @@ -50,6 +50,8 @@ qt_add_library(Vehicle STATIC TerrainProtocolHandler.h TrajectoryPoints.cc TrajectoryPoints.h + UASMessageHandler.cc + UASMessageHandler.h VehicleBatteryFactGroup.cc VehicleBatteryFactGroup.h Vehicle.cc diff --git a/src/uas/UASMessageHandler.cc b/src/Vehicle/UASMessageHandler.cc similarity index 100% rename from src/uas/UASMessageHandler.cc rename to src/Vehicle/UASMessageHandler.cc diff --git a/src/uas/UASMessageHandler.h b/src/Vehicle/UASMessageHandler.h similarity index 100% rename from src/uas/UASMessageHandler.h rename to src/Vehicle/UASMessageHandler.h diff --git a/src/VideoReceiver/CMakeLists.txt b/src/VideoReceiver/CMakeLists.txt index d043b806236..c280e6cdb3e 100644 --- a/src/VideoReceiver/CMakeLists.txt +++ b/src/VideoReceiver/CMakeLists.txt @@ -25,6 +25,7 @@ target_link_libraries(VideoReceiver Qt6::OpenGL Qt6::Quick ${EXTRA_LIBRARIES} + Utilities ) target_include_directories(VideoReceiver INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/uas/CMakeLists.txt b/src/uas/CMakeLists.txt deleted file mode 100644 index ee50a4dd5c8..00000000000 --- a/src/uas/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ - -add_library(uas - UASMessageHandler.cc - UASMessageHandler.h -) - -target_link_libraries(uas - PRIVATE - qgc -) - -target_include_directories(uas INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -