From f388bad99ea04e975639a5fc6c616cfecd96d3c6 Mon Sep 17 00:00:00 2001 From: Raphael <68374617+raphaelscholle@users.noreply.github.com> Date: Mon, 13 May 2024 19:11:20 +0200 Subject: [PATCH] write logs --- app/util/qopenhd.cpp | 10 ++++++++++ app/util/qopenhd.h | 1 + .../configpopup/dev/AppDeveloperStatsPanel.qml | 16 ++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/app/util/qopenhd.cpp b/app/util/qopenhd.cpp index 1d4a635bf..9f8628325 100644 --- a/app/util/qopenhd.cpp +++ b/app/util/qopenhd.cpp @@ -234,6 +234,16 @@ QString QOpenHD::show_local_ip() #else return QString("Only works on linux"); #endif +} + +QString QOpenHD::write_local_log() +{ +#ifdef __linux__ + auto res=OHDUtil::run_command_out("journalctl > /boot/openhd/openhd.log"); + return QString("Groundstation Log written !"); +#else + return QString("Only works on linux"); +#endif } diff --git a/app/util/qopenhd.h b/app/util/qopenhd.h index 96fa55c9f..72c0562a8 100644 --- a/app/util/qopenhd.h +++ b/app/util/qopenhd.h @@ -50,6 +50,7 @@ class QOpenHD : public QObject Q_INVOKABLE bool reset_settings(); // only works on linux, dirty helper to get local IP address Q_INVOKABLE QString show_local_ip(); + Q_INVOKABLE QString write_local_log(); // returns true if the platform qopenhd is running on is linux (embedded or x86) // some settings an stuff depend on that, called from .qml // NOTE: android is not linux in this definition ! diff --git a/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml b/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml index d3dbdc9ab..13f7386a9 100644 --- a/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml +++ b/qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml @@ -97,6 +97,22 @@ Rectangle { local_ip_button.text = text } } + Button { + id: write_local_log + text: "Write GND log to SD" + onClicked: { + var text = _qopenhd.write_local_log() + write_local_log.text = text + } + } + Button { + id: write_air_log + text: "Write AIR log to SD" + onClicked: { + var text = "Not implemented yet" + write_air_log.text = text + } + } Button { text: "Set Tele rates" onClicked: {