Skip to content
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
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,18 @@ elseif(ANDROID)
include(Android)
endif()

qt_add_qml_module(${CMAKE_PROJECT_NAME}
URI QGC
VERSION 1.0
RESOURCE_PREFIX /qml
)

add_subdirectory(src)
if(QGC_BUILD_TESTING)
add_subdirectory(test)
set_property(DIRECTORY test PROPERTY QT_EXCLUDE_FROM_TRANSLATION ON)
endif()

qt_add_qml_module(${CMAKE_PROJECT_NAME}
URI QGroundControl
VERSION 1.0
RESOURCE_PREFIX /qml
)

file(GLOB TS_SOURCES ${CMAKE_SOURCE_DIR}/translations/qgc_*.ts)
set_source_files_properties(${TS_SOURCES} PROPERTIES OUTPUT_LOCATION "${CMAKE_BINARY_DIR}/i18n")

Expand Down
2 changes: 0 additions & 2 deletions src/API/QGCCorePlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "HorizontalFactValueGrid.h"
#include "InstrumentValueData.h"
#include "JoystickManager.h"
#include "LogDownloadController.h"
#include "MAVLinkLib.h"
#include "QGCLoggingCategory.h"
#include "QGCOptions.h"
Expand Down Expand Up @@ -269,7 +268,6 @@ QQmlApplicationEngine *QGCCorePlugin::createQmlApplicationEngine(QObject *parent
qmlEngine->addImportPath(QStringLiteral("qrc:/qml"));
qmlEngine->rootContext()->setContextProperty(QStringLiteral("joystickManager"), JoystickManager::instance());
qmlEngine->rootContext()->setContextProperty(QStringLiteral("debugMessageModel"), QGCLogging::instance());
qmlEngine->rootContext()->setContextProperty(QStringLiteral("logDownloadController"), LogDownloadController::instance());
return qmlEngine;
}

Expand Down
11 changes: 2 additions & 9 deletions src/AnalyzeView/LogDownloadController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@

QGC_LOGGING_CATEGORY(LogDownloadControllerLog, "qgc.analyzeview.logdownloadcontroller")

Q_APPLICATION_STATIC(LogDownloadController, _logDownloadControllerInstance);

LogDownloadController::LogDownloadController(QObject *parent)
: QObject(parent)
, _timer(new QTimer(this))
, _logEntriesModel(new QmlObjectListModel(this))
{
// qCDebug(LogDownloadControllerLog) << Q_FUNC_INFO << this;
qCDebug(LogDownloadControllerLog) << this;

(void) connect(MultiVehicleManager::instance(), &MultiVehicleManager::activeVehicleChanged, this, &LogDownloadController::_setActiveVehicle);
(void) connect(_timer, &QTimer::timeout, this, &LogDownloadController::_processDownload);
Expand All @@ -43,12 +41,7 @@ LogDownloadController::LogDownloadController(QObject *parent)

LogDownloadController::~LogDownloadController()
{
// qCDebug(LogDownloadControllerLog) << Q_FUNC_INFO << this;
}

LogDownloadController *LogDownloadController::instance()
{
return _logDownloadControllerInstance();
qCDebug(LogDownloadControllerLog) << this;
}

void LogDownloadController::download(const QString &path)
Expand Down
6 changes: 2 additions & 4 deletions src/AnalyzeView/LogDownloadController.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class LogDownloadTest;
class LogDownloadController : public QObject
{
Q_OBJECT
// QML_ELEMENT
// QML_SINGLETON
QML_ELEMENT
QML_SINGLETON
Q_MOC_INCLUDE("Vehicle.h")
Q_MOC_INCLUDE("QmlObjectListModel.h")
Q_PROPERTY(QmlObjectListModel *model READ _getModel CONSTANT)
Expand All @@ -40,8 +40,6 @@ class LogDownloadController : public QObject
explicit LogDownloadController(QObject *parent = nullptr);
~LogDownloadController();

static LogDownloadController *instance();

Q_INVOKABLE void refresh();
Q_INVOKABLE void download(const QString &path = QString());
Q_INVOKABLE void eraseAll();
Expand Down
34 changes: 17 additions & 17 deletions src/AnalyzeView/LogDownloadPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ AnalyzePage {

GridLayout {
id: gridLayout
rows: logDownloadController.model.count + 1
rows: LogDownloadController.model.count + 1
columns: 5
flow: GridLayout.TopToBottom
columnSpacing: ScreenTools.defaultFontPixelWidth
Expand All @@ -49,7 +49,7 @@ AnalyzePage {
}

Repeater {
model: logDownloadController.model
model: LogDownloadController.model

QGCCheckBox {
Binding on checkState {
Expand All @@ -63,15 +63,15 @@ AnalyzePage {
QGCLabel { text: qsTr("Id") }

Repeater {
model: logDownloadController.model
model: LogDownloadController.model

QGCLabel { text: object.id }
}

QGCLabel { text: qsTr("Date") }

Repeater {
model: logDownloadController.model
model: LogDownloadController.model

QGCLabel {
text: {
Expand All @@ -91,15 +91,15 @@ AnalyzePage {
QGCLabel { text: qsTr("Size") }

Repeater {
model: logDownloadController.model
model: LogDownloadController.model

QGCLabel { text: object.sizeStr }
}

QGCLabel { text: qsTr("Status") }

Repeater {
model: logDownloadController.model
model: LogDownloadController.model

QGCLabel { text: object.status }
}
Expand All @@ -113,7 +113,7 @@ AnalyzePage {

QGCButton {
Layout.fillWidth: true
enabled: !logDownloadController.requestingList && !logDownloadController.downloadingLogs
enabled: !LogDownloadController.requestingList && !LogDownloadController.downloadingLogs
text: qsTr("Refresh")

onClicked: {
Expand All @@ -122,19 +122,19 @@ AnalyzePage {
return
}

logDownloadController.refresh()
LogDownloadController.refresh()
}
}

QGCButton {
Layout.fillWidth: true
enabled: !logDownloadController.requestingList && !logDownloadController.downloadingLogs
enabled: !LogDownloadController.requestingList && !LogDownloadController.downloadingLogs
text: qsTr("Download")

onClicked: {
var logsSelected = false
for (var i = 0; i < logDownloadController.model.count; i++) {
if (logDownloadController.model.get(i).selected) {
for (var i = 0; i < LogDownloadController.model.count; i++) {
if (LogDownloadController.model.get(i).selected) {
logsSelected = true
break
}
Expand All @@ -146,7 +146,7 @@ AnalyzePage {
}

if (ScreenTools.isMobile) {
logDownloadController.download()
LogDownloadController.download()
return
}

Expand All @@ -159,29 +159,29 @@ AnalyzePage {
QGCFileDialog {
id: fileDialog
onAcceptedForLoad: (file) => {
logDownloadController.download(file)
LogDownloadController.download(file)
close()
}
}
}

QGCButton {
Layout.fillWidth: true
enabled: !logDownloadController.requestingList && !logDownloadController.downloadingLogs && (logDownloadController.model.count > 0)
enabled: !LogDownloadController.requestingList && !LogDownloadController.downloadingLogs && (LogDownloadController.model.count > 0)
text: qsTr("Erase All")
onClicked: mainWindow.showMessageDialog(
qsTr("Delete All Log Files"),
qsTr("All log files will be erased permanently. Is this really what you want?"),
Dialog.Yes | Dialog.No,
function() { logDownloadController.eraseAll() }
function() { LogDownloadController.eraseAll() }
)
}

QGCButton {
Layout.fillWidth: true
text: qsTr("Cancel")
enabled: logDownloadController.requestingList || logDownloadController.downloadingLogs
onClicked: logDownloadController.cancel()
enabled: LogDownloadController.requestingList || LogDownloadController.downloadingLogs
onClicked: LogDownloadController.cancel()
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/AnalyzeView/MAVLinkMessage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ QGCMAVLinkMessage::QGCMAVLinkMessage(const mavlink_message_t &message, QObject *
, _fields(new QmlObjectListModel(this))

{
// qCDebug(LogDownloadControllerLog) << Q_FUNC_INFO << this;
qCDebug(MAVLinkMessageLog) << this;
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logging category 'MAVLinkMessageLog' is used but may not be defined. The commented line above suggests this should use 'LogDownloadControllerLog' category instead.

Copilot uses AI. Check for mistakes.


const mavlink_message_info_t *const msgInfo = mavlink_get_message_info(&message);
if (!msgInfo) {
Expand Down Expand Up @@ -57,6 +57,8 @@ QGCMAVLinkMessage::QGCMAVLinkMessage(const mavlink_message_t &message, QObject *
QGCMAVLinkMessage::~QGCMAVLinkMessage()
{
_fields->clearAndDeleteContents();

qCDebug(MAVLinkMessageLog) << this;
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logging category 'MAVLinkMessageLog' is used but may not be defined. This appears to be inconsistent with the original logging approach.

Copilot uses AI. Check for mistakes.

}

void QGCMAVLinkMessage::updateFieldSelection()
Expand Down
1 change: 0 additions & 1 deletion src/AutoPilotPlugins/APM/APMSensorsComponent.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import QGroundControl.Controls
import QGroundControl.ScreenTools
import QGroundControl.Controllers
import QGroundControl.QGCPositionManager
import MAVLink

SetupPage {
id: sensorsPage
Expand Down
12 changes: 12 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
qt_add_library(QGroundControlModule STATIC)

qt_add_qml_module(QGroundControlModule
URI QGroundControl
VERSION 1.0
RESOURCE_PREFIX /qml
IMPORTS
QGC
NO_PLUGIN
)

add_subdirectory(ADSB)
add_subdirectory(AnalyzeView)
add_subdirectory(Android)
Expand Down Expand Up @@ -84,6 +95,7 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
FlightMapModule
MainWindowModule
QGroundControlControlsModule
QGroundControlModule
ScreenToolsModule
ToolbarModule
UTMSPModule
Expand Down
1 change: 0 additions & 1 deletion src/FirmwarePlugin/PX4/PX4BatteryIndicator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import QGroundControl.ScreenTools
import QGroundControl.Palette
import QGroundControl.FactSystem
import QGroundControl.FactControls
import MAVLink

BatteryIndicator {
waitForParameters: true
Expand Down
1 change: 0 additions & 1 deletion src/FlightMap/MapItems/QGCMapPolygonVisuals.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import QGroundControl.ScreenTools
import QGroundControl.Palette
import QGroundControl.Controls
import QGroundControl.FlightMap
import QGroundControl.ShapeFileHelper

/// QGCMapPolygon map visuals
Item {
Expand Down
1 change: 0 additions & 1 deletion src/FlightMap/MapItems/QGCMapPolylineVisuals.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import QGroundControl.ScreenTools
import QGroundControl.Palette
import QGroundControl.Controls
import QGroundControl.FlightMap
import QGroundControl.ShapeFileHelper

/// QGCMapPolyline map visuals
Item {
Expand Down
5 changes: 2 additions & 3 deletions src/MAVLink/QGCMAVLink.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ Q_DECLARE_LOGGING_CATEGORY(QGCMAVLinkLog)
Q_DECLARE_METATYPE(MAV_TYPE)
Q_DECLARE_METATYPE(MAV_AUTOPILOT)

// TODO: Q_NAMESPACE
class QGCMAVLink : public QObject
{
Q_OBJECT
// QML_ELEMENT
// QML_UNCREATABLE("")
QML_NAMED_ELEMENT(MAVLink)
QML_SINGLETON

public:
// Creating an instance of QGCMAVLink is only meant to be used for the Qml Singleton
Expand Down
14 changes: 0 additions & 14 deletions src/QGCApplication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
#include "JoystickManager.h"
#include "JsonHelper.h"
#include "LinkManager.h"
#include "LogDownloadController.h"
#include "MAVLinkChartController.h"
#include "MAVLinkConsoleController.h"
#include "MAVLinkProtocol.h"
Expand All @@ -63,7 +62,6 @@
#include "QGroundControlQmlGlobal.h"
#include "SettingsManager.h"
#include "AppSettings.h"
#include "ShapeFileHelper.h"
#include "SyslinkComponentController.h"
#include "UDPLink.h"
#include "Vehicle.h"
Expand All @@ -83,13 +81,6 @@

QGC_LOGGING_CATEGORY(QGCApplicationLog, "qgc.qgcapplication")

// Qml Singleton factories

static QObject *mavlinkSingletonFactory(QQmlEngine*, QJSEngine*)
{
return new QGCMAVLink();
}

QGCApplication::QGCApplication(int &argc, char *argv[], bool unitTesting, bool simpleBootTest)
: QApplication(argc, argv)
, _runningUnitTests(unitTesting)
Expand Down Expand Up @@ -283,7 +274,6 @@ void QGCApplication::init()
qmlRegisterType<MAVLinkInspectorController>("QGroundControl.Controllers", 1, 0, "MAVLinkInspectorController");
#endif
qmlRegisterType<GeoTagController>("QGroundControl.Controllers", 1, 0, "GeoTagController");
qmlRegisterType<LogDownloadController>("QGroundControl.Controllers", 1, 0, "LogDownloadController");
qmlRegisterType<MAVLinkConsoleController>("QGroundControl.Controllers", 1, 0, "MAVLinkConsoleController");


Expand All @@ -298,10 +288,6 @@ void QGCApplication::init()
#endif
qmlRegisterType<JoystickConfigController>("QGroundControl.Controllers", 1, 0, "JoystickConfigController");

(void) qmlRegisterSingletonType<ShapeFileHelper>("QGroundControl.ShapeFileHelper", 1, 0, "ShapeFileHelper", [](QQmlEngine *, QJSEngine *) { return new ShapeFileHelper(); });

qmlRegisterSingletonType<QGCMAVLink>("MAVLink", 1, 0, "MAVLink", mavlinkSingletonFactory);

// Although this should really be in _initForNormalAppBoot putting it here allowws us to create unit tests which pop up more easily
if(QFontDatabase::addApplicationFont(":/fonts/opensans") < 0) {
qCWarning(QGCApplicationLog) << "Could not load /fonts/opensans font";
Expand Down
1 change: 0 additions & 1 deletion src/QmlControls/BatteryIndicator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import QGroundControl.Palette
import QGroundControl.FactSystem
import QGroundControl.FactControls
import QGroundControl.AutoPilotPlugin
import MAVLink

//-------------------------------------------------------------------------
//-- Battery Indicator
Expand Down
1 change: 0 additions & 1 deletion src/QmlControls/KMLOrSHPFileDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import QtQuick

import QGroundControl
import QGroundControl.Controls
import QGroundControl.ShapeFileHelper

QGCFileDialog {
id: kmlOrSHPLoadDialog
Expand Down
1 change: 0 additions & 1 deletion src/QmlControls/PlanView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import QGroundControl.FactSystem
import QGroundControl.FactControls
import QGroundControl.Palette
import QGroundControl.Controllers
import QGroundControl.ShapeFileHelper
import QGroundControl.FlightDisplay
import QGroundControl.UTMSP

Expand Down
Loading
Loading