7import QGroundControl.Controls
8import QGroundControl.FactControls
11 property var _settingsManager: QGroundControl.settingsManager
12 property var _flyViewSettings: _settingsManager.flyViewSettings
13 property var _mavlinkActionsSettings: _settingsManager.mavlinkActionsSettings
14 property Fact _virtualJoystick: _settingsManager.appSettings.virtualJoystick
15 property Fact _virtualJoystickAutoCenterThrottle: _settingsManager.appSettings.virtualJoystickAutoCenterThrottle
16 property Fact _virtualJoystickLeftHandedMode: _settingsManager.appSettings.virtualJoystickLeftHandedMode
17 property Fact _enableMultiVehiclePanel: _settingsManager.appSettings.enableMultiVehiclePanel
18 property Fact _showAdditionalIndicatorsCompass: _flyViewSettings.showAdditionalIndicatorsCompass
19 property Fact _lockNoseUpCompass: _flyViewSettings.lockNoseUpCompass
20 property Fact _guidedMinimumAltitude: _flyViewSettings.guidedMinimumAltitude
21 property Fact _guidedMaximumAltitude: _flyViewSettings.guidedMaximumAltitude
22 property Fact _maxGoToLocationDistance: _flyViewSettings.maxGoToLocationDistance
23 property Fact _forwardFlightGoToLocationLoiterRad: _flyViewSettings.forwardFlightGoToLocationLoiterRad
24 property Fact _goToLocationRequiresConfirmInGuided: _flyViewSettings.goToLocationRequiresConfirmInGuided
26 function mavlinkActionList() {
27 var fileModel = QGCFileDialogController.getFiles(_settingsManager.appSettings.mavlinkActionsSavePath, "*.json")
28 fileModel.unshift(qsTr("<None>"))
33 Layout.fillWidth: true
34 heading: qsTr("General")
38 Layout.fillWidth: true
39 text: qsTr("Use Preflight Checklist")
41 visible: _useChecklist.visible && QGroundControl.corePlugin.options.preFlightChecklistUrl.toString().length
42 property Fact _useChecklist: _settingsManager.appSettings.useChecklist
46 Layout.fillWidth: true
47 text: qsTr("Enforce Preflight Checklist")
48 fact: _enforceChecklist
49 enabled: _settingsManager.appSettings.useChecklist.value
50 visible: useCheckList.visible && _enforceChecklist.visible
51 property Fact _enforceChecklist: _settingsManager.appSettings.enforceChecklist
55 Layout.fillWidth: true
56 text: qsTr("Enable Multi-Vehicle Panel")
57 fact: _enableMultiVehiclePanel
58 visible: _enableMultiVehiclePanel.visible
62 Layout.fillWidth: true
63 text: qsTr("Keep Map Centered On Vehicle")
64 fact: _keepMapCenteredOnVehicle
65 visible: _keepMapCenteredOnVehicle.visible
66 property Fact _keepMapCenteredOnVehicle: _flyViewSettings.keepMapCenteredOnVehicle
70 Layout.fillWidth: true
71 text: qsTr("Show Telemetry Log Replay Status Bar")
72 fact: _showLogReplayStatusBar
73 visible: _showLogReplayStatusBar.visible
74 property Fact _showLogReplayStatusBar: _flyViewSettings.showLogReplayStatusBar
78 Layout.fillWidth: true
79 text: qsTr("Show simple camera controls (DIGICAM_CONTROL)")
80 visible: _showDumbCameraControl.visible
81 fact: _showDumbCameraControl
83 property Fact _showDumbCameraControl: _flyViewSettings.showSimpleCameraControl
87 Layout.fillWidth: true
88 text: qsTr("Update return to home position based on device location.")
89 fact: _updateHomePosition
90 visible: _updateHomePosition.visible
91 property Fact _updateHomePosition: _flyViewSettings.updateHomePosition
97 Layout.fillWidth: true
98 heading: qsTr("Guided Commands")
99 visible: _guidedMinimumAltitude.visible || _guidedMaximumAltitude.visible ||
100 _maxGoToLocationDistance.visible || _forwardFlightGoToLocationLoiterRad.visible ||
101 _goToLocationRequiresConfirmInGuided.visible
103 LabelledFactTextField {
104 Layout.fillWidth: true
105 label: qsTr("Minimum Altitude")
106 fact: _guidedMinimumAltitude
107 visible: fact.visible
110 LabelledFactTextField {
111 Layout.fillWidth: true
112 label: qsTr("Maximum Altitude")
113 fact: _guidedMaximumAltitude
114 visible: fact.visible
117 LabelledFactTextField {
118 Layout.fillWidth: true
119 label: qsTr("Go To Location Max Distance")
120 fact: _maxGoToLocationDistance
121 visible: fact.visible
124 LabelledFactTextField {
125 Layout.fillWidth: true
126 label: qsTr("Loiter Radius in Forward Flight Guided Mode")
127 fact: _forwardFlightGoToLocationLoiterRad
128 visible: fact.visible
132 Layout.fillWidth: true
133 text: qsTr("Require Confirmation for Go To Location in Guided Mode")
134 fact: _goToLocationRequiresConfirmInGuided
135 visible: fact.visible
139 SettingsGroupLayout {
140 Layout.fillWidth: true
141 Layout.preferredWidth: ScreenTools.defaultFontPixelWidth * 35
142 heading: qsTr("MAVLink Actions")
143 headingDescription: qsTr("Action JSON files should be created in the '%1' folder.").arg(QGroundControl.settingsManager.appSettings.mavlinkActionsSavePath)
146 Layout.fillWidth: true
147 label: qsTr("Fly View Actions")
148 model: mavlinkActionList()
149 onActivated: (index) => index == 0 ? _mavlinkActionsSettings.flyViewActionsFile.rawValue = "" : _mavlinkActionsSettings.flyViewActionsFile.rawValue = comboBox.currentText
150 enabled: model.length > 1
152 Component.onCompleted: {
153 var index = comboBox.find(_mavlinkActionsSettings.flyViewActionsFile.valueString)
154 comboBox.currentIndex = index == -1 ? 0 : index
159 Layout.fillWidth: true
160 label: qsTr("Joystick Actions")
161 model: mavlinkActionList()
162 onActivated: (index) => index == 0 ? _mavlinkActionsSettings.joystickActionsFile.rawValue = "" : _mavlinkActionsSettings.joystickActionsFile.rawValue = comboBox.currentText
163 enabled: model.length > 1
165 Component.onCompleted: {
166 var index = comboBox.find(_mavlinkActionsSettings.joystickActionsFile.valueString)
167 comboBox.currentIndex = index == -1 ? 0 : index
172 SettingsGroupLayout {
173 Layout.fillWidth: true
174 heading: qsTr("Virtual Joystick")
175 visible: _virtualJoystick.visible || _virtualJoystickAutoCenterThrottle.visible || _virtualJoystickLeftHandedMode.visible
178 Layout.fillWidth: true
179 text: qsTr("Enabled")
180 visible: _virtualJoystick.visible
181 fact: _virtualJoystick
185 Layout.fillWidth: true
186 text: qsTr("Auto-Center Throttle")
187 visible: _virtualJoystickAutoCenterThrottle.visible
188 enabled: _virtualJoystick.rawValue
189 fact: _virtualJoystickAutoCenterThrottle
193 Layout.fillWidth: true
194 text: qsTr("Left-Handed Mode (swap sticks)")
195 visible: _virtualJoystickLeftHandedMode.visible
196 enabled: _virtualJoystick.rawValue
197 fact: _virtualJoystickLeftHandedMode
201 SettingsGroupLayout {
202 Layout.fillWidth: true
203 heading: qsTr("Instrument Panel")
204 visible: _showAdditionalIndicatorsCompass.visible || _lockNoseUpCompass.visible
207 Layout.fillWidth: true
208 text: qsTr("Show additional heading indicators on Compass")
209 visible: _showAdditionalIndicatorsCompass.visible
210 fact: _showAdditionalIndicatorsCompass
214 Layout.fillWidth: true
215 text: qsTr("Lock Compass Nose-Up")
216 visible: _lockNoseUpCompass.visible
217 fact: _lockNoseUpCompass