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.windowShadeDark
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("Waypoints Altitude")
89 fact: QGroundControl.settingsManager.appSettings.defaultMissionItemAltitude
93 Layout.fillWidth: true
94 label: qsTr("Flight Speed")
95 fact: _root._settingsItem ? _root._settingsItem.speedSection.flightSpeed : null
96 showEnableCheckbox: true
97 enableCheckBoxChecked: _root._settingsItem ? _root._settingsItem.speedSection.specifyFlightSpeed : false
98 visible: _root._settingsItem ? _root._settingsItem.speedSection.available : false
100 onEnableCheckboxClicked: {
101 if (_root._settingsItem) {
102 _root._settingsItem.speedSection.specifyFlightSpeed = enableCheckBoxChecked
107 // ── Vehicle Speeds ──
109 id: vehicleSpeedsSectionHeader
110 Layout.fillWidth: true
111 text: qsTr("Expected Vehicle Speeds")
112 visible: _root._showCruiseSpeed || _root._showHoverSpeed || _root._showAscentDescentSpeed
116 Layout.fillWidth: true
117 spacing: ScreenTools.defaultFontPixelHeight * 0.5
118 visible: vehicleSpeedsSectionHeader.visible && vehicleSpeedsSectionHeader.checked
121 Layout.fillWidth: true
122 wrapMode: Text.WordWrap
123 font.pointSize: ScreenTools.smallFontPointSize
124 text: qsTr("The following speed values are used to calculate total mission time. They do not affect the flight speed for the mission.")
127 FactTextFieldSlider {
128 Layout.fillWidth: true
129 label: _root._isVtol ? qsTr("FW - Flight speed") : qsTr("Flight speed")
130 fact: QGroundControl.settingsManager.appSettings.offlineEditingCruiseSpeed
131 visible: _root._showCruiseSpeed
132 enabled: !_root._flightSpeedSpecified
135 FactTextFieldSlider {
136 Layout.fillWidth: true
137 label: _root._isVtol ? qsTr("MR - Flight speed") : qsTr("Flight speed")
138 fact: QGroundControl.settingsManager.appSettings.offlineEditingHoverSpeed
139 visible: _root._showHoverSpeed
140 enabled: !_root._flightSpeedSpecified
143 FactTextFieldSlider {
144 Layout.fillWidth: true
145 label: _root._isVtol ? qsTr("MR - Ascent speed") : qsTr("Ascent speed")
146 fact: QGroundControl.settingsManager.appSettings.offlineEditingAscentSpeed
147 visible: _root._showAscentDescentSpeed
150 FactTextFieldSlider {
151 Layout.fillWidth: true
152 label: _root._isVtol ? qsTr("MR - Descent speed") : qsTr("Descent speed")
153 fact: QGroundControl.settingsManager.appSettings.offlineEditingDescentSpeed
154 visible: _root._showAscentDescentSpeed