QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
LoggingSetupPage.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.Controls
7import QGroundControl.FactControls
8
9AnalyzePage {
10 id: loggingSetupPage
11 pageComponent: pageComponent
12 pageDescription: qsTr("Configure ArduPilot logging parameters, then follow download and troubleshooting guidance.")
13
14 FactPanelController {
15 id: controller
16 }
17
18 Component {
19 id: pageComponent
20
21 QGCFlickable {
22 width: availableWidth
23 height: availableHeight
24 contentHeight: contentColumn.height
25 contentWidth: contentColumn.width
26
27 ColumnLayout {
28 id: contentColumn
29 width: availableWidth
30 spacing: ScreenTools.defaultFontPixelHeight
31
32 Repeater {
33 model: [
34 { param: "LOG_BACKEND_TYPE", desc: qsTr("Where logs are stored (SD, MAVLink stream, onboard flash).") },
35 { param: "LOG_BITMASK", desc: qsTr("What data groups are included in the log.") },
36 { param: "LOG_DISARMED", desc: qsTr("Enable disarmed logging for pre-arm and replay diagnostics.") },
37 { param: "LOG_FILE_DSRMROT", desc: qsTr("Rotate log file after disarm/rearm sequence.") },
38 { param: "LOG_FILE_MB_FREE", desc: qsTr("Minimum free space to keep available before logging.") },
39 { param: "LOG_FILE_RATEMAX", desc: qsTr("Limit file logging rate to control size.") },
40 { param: "LOG_BLK_RATEMAX", desc: qsTr("Limit block logging rate for constrained flash media.") },
41 { param: "LOG_MAV_RATEMAX", desc: qsTr("Limit MAVLink log stream rate.") },
42 { param: "LOG_MAX_FILES", desc: qsTr("Maximum retained log files before rotation.") },
43 { param: "LOG_REPLAY", desc: qsTr("Capture extra data needed for EKF replay analysis.") },
44 { param: "EK3_LOG_LEVEL", desc: qsTr("Controls EKF3 logging verbosity and log size.") }
45 ]
46
47 delegate: Rectangle {
48 id: paramCard
49 Layout.fillWidth: true
50 color: qgcPal.windowShade
51 radius: ScreenTools.defaultFontPixelWidth * 0.5
52 implicitHeight: paramColumn.implicitHeight + (ScreenTools.defaultFontPixelHeight * 0.8)
53
54 property string _paramName: modelData.param
55 property bool _available: controller.parameterExists(-1, _paramName)
56 property var _fact: _available ? controller.getParameterFact(-1, _paramName, false) : null
57
58 ColumnLayout {
59 id: paramColumn
60 anchors.fill: parent
61 anchors.margins: ScreenTools.defaultFontPixelHeight * 0.4
62 spacing: ScreenTools.defaultFontPixelHeight * 0.3
63
64 QGCLabel {
65 text: modelData.param
66 font.bold: true
67 }
68
69 QGCLabel {
70 wrapMode: Text.WordWrap
71 text: modelData.desc
72 }
73
74 RowLayout {
75 Layout.fillWidth: true
76
77 FactComboBox {
78 Layout.preferredWidth: ScreenTools.defaultFontPixelWidth * 38
79 Layout.maximumWidth: ScreenTools.defaultFontPixelWidth * 48
80 // Prefer bitmask over enum if both are non-empty to avoid showing both controls simultaneously.
81 visible: paramCard._available && paramCard._fact && (paramCard._fact.enumStrings.length > 0) && (paramCard._fact.bitmaskStrings.length === 0)
82 fact: paramCard._fact
83 }
84
85 ColumnLayout {
86 visible: paramCard._available && paramCard._fact && (paramCard._fact.bitmaskStrings.length > 0)
87 spacing: ScreenTools.defaultFontPixelHeight * 0.2
88
89 FactBitmask {
90 Layout.fillWidth: true
91 fact: paramCard._fact
92 }
93
94 QGCLabel {
95 text: qsTr("Combined value: %1").arg(paramCard._fact ? paramCard._fact.rawValue : 0)
96 color: qgcPal.text
97 }
98 }
99
100 FactTextField {
101 Layout.preferredWidth: ScreenTools.defaultFontPixelWidth * 18
102 visible: paramCard._available
103 && paramCard._fact
104 && (paramCard._fact.enumStrings.length === 0)
105 && (paramCard._fact.bitmaskStrings.length === 0)
106 fact: paramCard._fact
107 }
108
109 QGCLabel {
110 visible: !paramCard._available
111 text: qsTr("Parameter not available on this firmware/vehicle")
112 }
113 }
114 }
115 }
116 }
117
118 Rectangle {
119 Layout.fillWidth: true
120 color: qgcPal.windowShade
121 radius: ScreenTools.defaultFontPixelWidth * 0.5
122 implicitHeight: guidanceText.implicitHeight + (ScreenTools.defaultFontPixelHeight * 1.2)
123
124 QGCLabel {
125 id: guidanceText
126 anchors.fill: parent
127 anchors.margins: ScreenTools.defaultFontPixelHeight * 0.6
128 wrapMode: Text.WordWrap
129 text: qsTr("Workflow: connect vehicle, review logging parameters, download logs from Onboard Logs page, open .bin/.tlog in Log Viewer, and use lower rate limits if SD/dataflash cannot keep up.")
130 }
131 }
132 }
133 }
134 }
135}