From 8d38fabb8e36ea619353d6fdb8aade1cb138f3a0 Mon Sep 17 00:00:00 2001 From: Holden Date: Fri, 30 May 2025 23:27:42 -0400 Subject: [PATCH] APM: Add Remaining QMLs to Module --- .../APM/APMSensorIdDecoder.qml | 0 .../APM/APMSensorParams.qml | 0 .../APM/APMSensorsComponent.qml | 1 - .../APM/APMSensorsComponentSummary.qml | 1 - src/AutoPilotPlugins/APM/CMakeLists.txt | 2 ++ src/FirmwarePlugin/APM/APMFirmwarePlugin.cc | 6 ++--- src/FirmwarePlugin/APM/APMResources.qrc | 13 +++------ .../APM/ArduPilot-Parameter-Repository | 2 +- src/FirmwarePlugin/APM/CMakeLists.txt | 27 ------------------- .../APM/QGroundControl.ArduPilot.qmldir | 4 --- .../toolbar}/APMBatteryIndicator.qml | 0 .../toolbar}/APMFlightModeIndicator.qml | 0 .../APMMainStatusIndicatorContentItem.qml | 0 src/UI/toolbar/CMakeLists.txt | 3 +++ 14 files changed, 12 insertions(+), 47 deletions(-) rename src/{FirmwarePlugin => AutoPilotPlugins}/APM/APMSensorIdDecoder.qml (100%) rename src/{FirmwarePlugin => AutoPilotPlugins}/APM/APMSensorParams.qml (100%) delete mode 100644 src/FirmwarePlugin/APM/QGroundControl.ArduPilot.qmldir rename src/{FirmwarePlugin/APM => UI/toolbar}/APMBatteryIndicator.qml (100%) rename src/{FirmwarePlugin/APM => UI/toolbar}/APMFlightModeIndicator.qml (100%) rename src/{FirmwarePlugin/APM => UI/toolbar}/APMMainStatusIndicatorContentItem.qml (100%) diff --git a/src/FirmwarePlugin/APM/APMSensorIdDecoder.qml b/src/AutoPilotPlugins/APM/APMSensorIdDecoder.qml similarity index 100% rename from src/FirmwarePlugin/APM/APMSensorIdDecoder.qml rename to src/AutoPilotPlugins/APM/APMSensorIdDecoder.qml diff --git a/src/FirmwarePlugin/APM/APMSensorParams.qml b/src/AutoPilotPlugins/APM/APMSensorParams.qml similarity index 100% rename from src/FirmwarePlugin/APM/APMSensorParams.qml rename to src/AutoPilotPlugins/APM/APMSensorParams.qml diff --git a/src/AutoPilotPlugins/APM/APMSensorsComponent.qml b/src/AutoPilotPlugins/APM/APMSensorsComponent.qml index 6335ab371ee0..bfd5fa45f08d 100644 --- a/src/AutoPilotPlugins/APM/APMSensorsComponent.qml +++ b/src/AutoPilotPlugins/APM/APMSensorsComponent.qml @@ -20,7 +20,6 @@ import QGroundControl.Palette import QGroundControl.Controls import QGroundControl.ScreenTools import QGroundControl.Controllers -import QGroundControl.ArduPilot import QGroundControl.QGCPositionManager import MAVLink diff --git a/src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml b/src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml index 4afc6e65f61c..fa3cb890770d 100644 --- a/src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml +++ b/src/AutoPilotPlugins/APM/APMSensorsComponentSummary.qml @@ -7,7 +7,6 @@ import QGroundControl.FactControls import QGroundControl.Controls import QGroundControl.Palette import QGroundControl.Controllers -import QGroundControl.ArduPilot /* IMPORTANT NOTE: Any changes made here must also be made to SensorsComponentSummary.qml */ diff --git a/src/AutoPilotPlugins/APM/CMakeLists.txt b/src/AutoPilotPlugins/APM/CMakeLists.txt index 754c6bea0e39..71d1f1a48001 100644 --- a/src/AutoPilotPlugins/APM/CMakeLists.txt +++ b/src/AutoPilotPlugins/APM/CMakeLists.txt @@ -81,6 +81,8 @@ qt_add_qml_module(AutoPilotPluginsAPMModule APMSafetyComponentSummarySub.qml APMSensorsComponent.qml APMSensorsComponentSummary.qml + APMSensorIdDecoder.qml + APMSensorParams.qml APMSubFrameComponent.qml APMSubFrameComponentSummary.qml APMSubMotorComponent.qml diff --git a/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc b/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc index ab53dafe690b..4eb8774e61d2 100644 --- a/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc +++ b/src/FirmwarePlugin/APM/APMFirmwarePlugin.cc @@ -637,7 +637,7 @@ const QVariantList &APMFirmwarePlugin::toolIndicators(const Vehicle *vehicle) // Find the generic flight mode indicator and replace with the custom one for (int i = 0; i < _toolIndicatorList.size(); i++) { if (_toolIndicatorList.at(i).toUrl().toString().contains("FlightModeIndicator.qml")) { - _toolIndicatorList[i] = QVariant::fromValue(QUrl::fromUserInput("qrc:/APM/Indicators/APMFlightModeIndicator.qml")); + _toolIndicatorList[i] = QVariant::fromValue(QUrl::fromUserInput("qrc:/qml/QGroundControl/Toolbar/APMFlightModeIndicator.qml")); break; } } @@ -645,7 +645,7 @@ const QVariantList &APMFirmwarePlugin::toolIndicators(const Vehicle *vehicle) // Find the generic battery indicator and replace with the custom one for (int i = 0; i < _toolIndicatorList.size(); i++) { if (_toolIndicatorList.at(i).toUrl().toString().contains("BatteryIndicator.qml")) { - _toolIndicatorList[i] = QVariant::fromValue(QUrl::fromUserInput("qrc:/APM/Indicators/APMBatteryIndicator.qml")); + _toolIndicatorList[i] = QVariant::fromValue(QUrl::fromUserInput("qrc:/qml/QGroundControl/Toolbar/APMBatteryIndicator.qml")); break; } } @@ -1255,7 +1255,7 @@ void APMFirmwarePlugin::guidedModeChangeEquivalentAirspeedMetersSecond(Vehicle * QVariant APMFirmwarePlugin::mainStatusIndicatorContentItem(const Vehicle*) const { - return QVariant::fromValue(QUrl::fromUserInput("qrc:/APM/Indicators/APMMainStatusIndicatorContentItem.qml")); + return QVariant::fromValue(QUrl::fromUserInput("qrc:/qml/QGroundControl/Toolbar/APMMainStatusIndicatorContentItem.qml")); } void APMFirmwarePlugin::_setBaroGndTemp(Vehicle* vehicle, qreal temp) diff --git a/src/FirmwarePlugin/APM/APMResources.qrc b/src/FirmwarePlugin/APM/APMResources.qrc index ac2c4dd9062d..7bae704e4e7b 100644 --- a/src/FirmwarePlugin/APM/APMResources.qrc +++ b/src/FirmwarePlugin/APM/APMResources.qrc @@ -1,14 +1,4 @@ - - APMSensorParams.qml - APMSensorIdDecoder.qml - QGroundControl.ArduPilot.qmldir - - - APMBatteryIndicator.qml - APMFlightModeIndicator.qml - APMMainStatusIndicatorContentItem.qml - APM-MavCmdInfoCommon.json APM-MavCmdInfoFixedWing.json @@ -28,6 +18,7 @@ ArduPilot-Parameter-Repository/Plane-4.3/apm.pdef.xml ArduPilot-Parameter-Repository/Plane-4.4/apm.pdef.xml ArduPilot-Parameter-Repository/Plane-4.5/apm.pdef.xml + ArduPilot-Parameter-Repository/Plane-4.6/apm.pdef.xml ArduPilot-Parameter-Repository/Copter-3.5/apm.pdef.xml ArduPilot-Parameter-Repository/Copter-3.6/apm.pdef.xml ArduPilot-Parameter-Repository/Copter-3.7/apm.pdef.xml @@ -37,6 +28,7 @@ ArduPilot-Parameter-Repository/Copter-4.3/apm.pdef.xml ArduPilot-Parameter-Repository/Copter-4.4/apm.pdef.xml ArduPilot-Parameter-Repository/Copter-4.5/apm.pdef.xml + ArduPilot-Parameter-Repository/Copter-4.6/apm.pdef.xml ArduPilot-Parameter-Repository/Rover-3.4/apm.pdef.xml ArduPilot-Parameter-Repository/Rover-3.5/apm.pdef.xml ArduPilot-Parameter-Repository/Rover-3.6/apm.pdef.xml @@ -45,6 +37,7 @@ ArduPilot-Parameter-Repository/Rover-4.2/apm.pdef.xml ArduPilot-Parameter-Repository/Rover-4.4/apm.pdef.xml ArduPilot-Parameter-Repository/Rover-4.5/apm.pdef.xml + ArduPilot-Parameter-Repository/Rover-4.6/apm.pdef.xml ArduPilot-Parameter-Repository/Sub-3.4/apm.pdef.xml ArduPilot-Parameter-Repository/Sub-3.5/apm.pdef.xml ArduPilot-Parameter-Repository/Sub-3.6/apm.pdef.xml diff --git a/src/FirmwarePlugin/APM/ArduPilot-Parameter-Repository b/src/FirmwarePlugin/APM/ArduPilot-Parameter-Repository index 0503ee59e567..a458e8e86a8f 160000 --- a/src/FirmwarePlugin/APM/ArduPilot-Parameter-Repository +++ b/src/FirmwarePlugin/APM/ArduPilot-Parameter-Repository @@ -1 +1 @@ -Subproject commit 0503ee59e567bf593e6054d061d2117e3fdb9ad0 +Subproject commit a458e8e86a8ffa3b7f52f4601adcdaaff0db5f42 diff --git a/src/FirmwarePlugin/APM/CMakeLists.txt b/src/FirmwarePlugin/APM/CMakeLists.txt index 50d2421cb2cb..521a4044c0cb 100644 --- a/src/FirmwarePlugin/APM/CMakeLists.txt +++ b/src/FirmwarePlugin/APM/CMakeLists.txt @@ -7,9 +7,6 @@ if(NOT QGC_DISABLE_APM_PLUGIN_FACTORY) endif() if(NOT QGC_DISABLE_APM_PLUGIN) - # set(APM_RESOURCES) - # qt_add_resources(APM_RESOURCES APMResources.qrc) - target_sources(${CMAKE_PROJECT_NAME} PRIVATE APM.h @@ -25,7 +22,6 @@ if(NOT QGC_DISABLE_APM_PLUGIN) ArduRoverFirmwarePlugin.h ArduSubFirmwarePlugin.cc ArduSubFirmwarePlugin.h - # ${APM_RESOURCES} ) endif() @@ -40,26 +36,3 @@ endif() # GITHUB_REPOSITORY ArduPilot/ParameterRepository # GIT_TAG main # ) - -# file(GLOB QML_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.qml) -# # file(GLOB QML_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/res/*/*.*) -# qt_add_qml_module(QGC -# URI QGroundControl.APMFirmwarePlugin -# VERSION 1.0 -# # RESOURCES ${QML_RESOURCES} -# QML_FILES ${QML_SOURCES} -# OUTPUT_TARGETS APMFirmwarePlugin_targets -# IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY} -# IMPORTS -# QtQuick -# QtQuick.Layouts - -# QGroundControl -# QGroundControl.Controls -# QGroundControl.MultiVehicleManager -# QGroundControl.ScreenTools -# QGroundControl.Palette -# QGroundControl.FactSystem -# QGroundControl.FactControls -# MAVLink -# ) diff --git a/src/FirmwarePlugin/APM/QGroundControl.ArduPilot.qmldir b/src/FirmwarePlugin/APM/QGroundControl.ArduPilot.qmldir deleted file mode 100644 index bb494a7c18c5..000000000000 --- a/src/FirmwarePlugin/APM/QGroundControl.ArduPilot.qmldir +++ /dev/null @@ -1,4 +0,0 @@ -Module QGroundControl.ArduPilot - -APMSensorParams 1.0 APMSensorParams.qml -APMSensorIdDecoder 1.0 APMSensorIdDecoder.qml diff --git a/src/FirmwarePlugin/APM/APMBatteryIndicator.qml b/src/UI/toolbar/APMBatteryIndicator.qml similarity index 100% rename from src/FirmwarePlugin/APM/APMBatteryIndicator.qml rename to src/UI/toolbar/APMBatteryIndicator.qml diff --git a/src/FirmwarePlugin/APM/APMFlightModeIndicator.qml b/src/UI/toolbar/APMFlightModeIndicator.qml similarity index 100% rename from src/FirmwarePlugin/APM/APMFlightModeIndicator.qml rename to src/UI/toolbar/APMFlightModeIndicator.qml diff --git a/src/FirmwarePlugin/APM/APMMainStatusIndicatorContentItem.qml b/src/UI/toolbar/APMMainStatusIndicatorContentItem.qml similarity index 100% rename from src/FirmwarePlugin/APM/APMMainStatusIndicatorContentItem.qml rename to src/UI/toolbar/APMMainStatusIndicatorContentItem.qml diff --git a/src/UI/toolbar/CMakeLists.txt b/src/UI/toolbar/CMakeLists.txt index 5f8f43318971..09795146f844 100644 --- a/src/UI/toolbar/CMakeLists.txt +++ b/src/UI/toolbar/CMakeLists.txt @@ -5,6 +5,9 @@ qt_add_qml_module(ToolbarModule VERSION 1.0 RESOURCE_PREFIX /qml QML_FILES + APMBatteryIndicator.qml + APMFlightModeIndicator.qml + APMMainStatusIndicatorContentItem.qml APMSupportForwardingIndicator.qml ArmedIndicator.qml GCSControlIndicator.qml