Skip to content

Commit

Permalink
write logs
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelscholle committed May 13, 2024
1 parent d3a3bb1 commit f388bad
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/util/qopenhd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

Expand Down
1 change: 1 addition & 0 deletions app/util/qopenhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 !
Expand Down
16 changes: 16 additions & 0 deletions qml/ui/configpopup/dev/AppDeveloperStatsPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit f388bad

Please sign in to comment.