6import QGroundControl.Controls
7import QGroundControl.FactControls
8import QGroundControl.PlanView
13 required property var missionController
14 required property var planMasterController
16 property var _controllerVehicle: planMasterController.controllerVehicle
17 property var _visualItems: missionController.visualItems
18 property bool _noMissionItemsAdded: _visualItems ? _visualItems.count <= 1 : true
19 property var _settingsItem: _visualItems && _visualItems.count > 0 ? _visualItems.get(0) : null
20 property bool _flightSpeedSpecified: _settingsItem ? _settingsItem.speedSection.specifyFlightSpeed : false
21 property bool _showCruiseSpeed: _controllerVehicle ? !_controllerVehicle.multiRotor : false
22 property bool _showHoverSpeed: _controllerVehicle ? (_controllerVehicle.multiRotor || _controllerVehicle.vtol) : false
23 property bool _showAscentDescentSpeed: _controllerVehicle ? (_controllerVehicle.multiRotor || _controllerVehicle.vtol) : false
24 property bool _isVtol: _controllerVehicle ? _controllerVehicle.vtol : false
26 width: parent ? parent.width : 0
27 height: mainColumn.height + ScreenTools.defaultFontPixelHeight
28 color: qgcPal.windowPanel
30 QGCPalette { id: qgcPal; colorGroupEnabled: _root.enabled }
33 target: _root._controllerVehicle
34 function onFirmwareTypeChanged() {
35 if (!_root._controllerVehicle.supports.terrainFrame
36 && _root.missionController.globalAltitudeFrame === QGroundControl.AltitudeFrameTerrain) {
37 _root.missionController.globalAltitudeFrame = QGroundControl.AltitudeFrameCalcAboveTerrain
42 Component { id: altFrameDialogComponent; AltFrameDialog { } }
44 QGCPopupDialogFactory {
45 id: altFrameDialogFactory
46 dialogComponent: altFrameDialogComponent
51 anchors.left: parent.left
52 anchors.right: parent.right
53 anchors.verticalCenter: parent.verticalCenter
54 anchors.margins: ScreenTools.defaultFontPixelWidth
55 spacing: ScreenTools.defaultFontPixelHeight * 0.5
58 Layout.fillWidth: true
59 label: qsTr("Alt Frame")
60 buttonText: QGroundControl.altitudeFrameExtraUnits(_root.missionController.globalAltitudeFrame)
64 let updateFunction = function(altFrame) { _root.missionController.globalAltitudeFrame = altFrame }
65 if (!_root._controllerVehicle.supports.terrainFrame) {
66 removeModes.push(QGroundControl.AltitudeFrameTerrain)
68 if (!_root._noMissionItemsAdded) {
69 if (_root.missionController.globalAltitudeFrame !== QGroundControl.AltitudeFrameRelative) {
70 removeModes.push(QGroundControl.AltitudeFrameRelative)
72 if (_root.missionController.globalAltitudeFrame !== QGroundControl.AltitudeFrameAbsolute) {
73 removeModes.push(QGroundControl.AltitudeFrameAbsolute)
75 if (_root.missionController.globalAltitudeFrame !== QGroundControl.AltitudeFrameCalcAboveTerrain) {
76 removeModes.push(QGroundControl.AltitudeFrameCalcAboveTerrain)
78 if (_root.missionController.globalAltitudeFrame !== QGroundControl.AltitudeFrameTerrain) {
79 removeModes.push(QGroundControl.AltitudeFrameTerrain)
82 altFrameDialogFactory.open({ currentAltFrame: _root.missionController.globalAltitudeFrame, rgRemoveModes: removeModes, updateAltFrameFn: updateFunction })
87 Layout.fillWidth: true
88 label: qsTr("Altitude")
89 fact: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude
93 Layout.fillWidth: true
94 spacing: ScreenTools.defaultFontPixelWidth
95 visible: _root.missionController.applyDefaultMissionAltitudeAvailable
98 Layout.fillWidth: true
99 wrapMode: Text.WordWrap
100 font.pointSize: ScreenTools.smallFontPointSize
101 text: qsTr("Apply new altitude to all mission items?")
107 onClicked: _root.missionController.applyDefaultMissionAltitude()
111 FactTextFieldSlider {
112 Layout.fillWidth: true
113 label: qsTr("Flight Speed")
114 fact: _root._settingsItem ? _root._settingsItem.speedSection.flightSpeed : null
115 showEnableCheckbox: true
116 enableCheckBoxChecked: _root._settingsItem ? _root._settingsItem.speedSection.specifyFlightSpeed : false
117 visible: _root._settingsItem ? _root._settingsItem.speedSection.available : false
119 onEnableCheckboxClicked: {
120 if (_root._settingsItem) {
121 _root._settingsItem.speedSection.specifyFlightSpeed = enableCheckBoxChecked
126 // ── Vehicle Speeds ──
128 id: vehicleSpeedsSectionHeader
129 Layout.fillWidth: true
130 text: qsTr("Expected Vehicle Speeds")
131 visible: _root._showCruiseSpeed || _root._showHoverSpeed || _root._showAscentDescentSpeed
135 Layout.fillWidth: true
136 spacing: ScreenTools.defaultFontPixelHeight * 0.5
137 visible: vehicleSpeedsSectionHeader.visible && vehicleSpeedsSectionHeader.checked
140 Layout.fillWidth: true
141 wrapMode: Text.WordWrap
142 font.pointSize: ScreenTools.smallFontPointSize
143 text: qsTr("The following speed values are used to calculate total mission time. They do not affect the flight speed for the mission.")
146 FactTextFieldSlider {
147 Layout.fillWidth: true
148 label: _root._isVtol ? qsTr("FW - Flight speed") : qsTr("Flight speed")
149 fact: QGroundControl.settingsManager.appSettings.offlineEditingCruiseSpeed
150 visible: _root._showCruiseSpeed
151 enabled: !_root._flightSpeedSpecified
154 FactTextFieldSlider {
155 Layout.fillWidth: true
156 label: _root._isVtol ? qsTr("MR - Flight speed") : qsTr("Flight speed")
157 fact: QGroundControl.settingsManager.appSettings.offlineEditingHoverSpeed
158 visible: _root._showHoverSpeed
159 enabled: !_root._flightSpeedSpecified
162 FactTextFieldSlider {
163 Layout.fillWidth: true
164 label: _root._isVtol ? qsTr("MR - Ascent speed") : qsTr("Ascent speed")
165 fact: QGroundControl.settingsManager.appSettings.offlineEditingAscentSpeed
166 visible: _root._showAscentDescentSpeed
169 FactTextFieldSlider {
170 Layout.fillWidth: true
171 label: _root._isVtol ? qsTr("MR - Descent speed") : qsTr("Descent speed")
172 fact: QGroundControl.settingsManager.appSettings.offlineEditingDescentSpeed
173 visible: _root._showAscentDescentSpeed