diff --git a/libs/mavlink/include/mavlink/v2.0 b/libs/mavlink/include/mavlink/v2.0 index cd003f27415dcb7abd94867fd5c44cda2fc3bdf5..6a160785b46f14c31ec014517324f25d606066ce 160000 --- a/libs/mavlink/include/mavlink/v2.0 +++ b/libs/mavlink/include/mavlink/v2.0 @@ -1 +1 @@ -Subproject commit cd003f27415dcb7abd94867fd5c44cda2fc3bdf5 +Subproject commit 6a160785b46f14c31ec014517324f25d606066ce diff --git a/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml b/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml index 71c47d8daff6580bd36adbb0eda3123d8e6bfd4c..482a4d7632149b04f5d8a28f16da7388627f5bbe 100644 --- a/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml +++ b/src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml @@ -982,6 +982,13 @@ Set -1 to disable the check 2 0.5 + + Timeout value for disarming when kill switch is engaged + 0.0 + 30.0 + s + 0.1 + Battery failsafe mode Action the system takes at critical battery. See also BAT_CRIT_THR and BAT_EMERGEN_THR for definition of battery states. diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml index cc54bc7e661c1ad2d724b31f4eff236bc5bd3364..19c027e4e37a22106b88923403cad1bb52af6947 100644 --- a/src/FlightDisplay/FlightDisplayView.qml +++ b/src/FlightDisplay/FlightDisplayView.qml @@ -144,33 +144,31 @@ Item { } } - // The following code is used to track vehicle states such that we prompt to remove mission from vehicle when mission completes - - property bool vehicleArmed: activeVehicle ? activeVehicle.armed : true // true here prevents pop up from showing during shutdown - property bool vehicleWasArmed: false - property bool vehicleInMissionFlightMode: activeVehicle ? (activeVehicle.flightMode === activeVehicle.missionFlightMode) : false - property bool promptForMissionRemove: false + // The following code is used to track vehicle states for showing the mission complete dialog + property bool vehicleArmed: activeVehicle ? activeVehicle.armed : true // true here prevents pop up from showing during shutdown + property bool vehicleWasArmed: false + property bool vehicleInMissionFlightMode: activeVehicle ? (activeVehicle.flightMode === activeVehicle.missionFlightMode) : false + property bool vehicleWasInMissionFlightMode: false + property bool showMissionCompleteDialog: vehicleWasArmed && vehicleWasInMissionFlightMode && + (_missionController.containsItems || _geoFenceController.containsItems || _rallyPointController.containsItems || + (activeVehicle ? activeVehicle.cameraTriggerPoints.count !== 0 : false)) onVehicleArmedChanged: { if (vehicleArmed) { - if (!promptForMissionRemove) { - promptForMissionRemove = vehicleInMissionFlightMode - vehicleWasArmed = true - } + vehicleWasArmed = true + vehicleWasInMissionFlightMode = vehicleInMissionFlightMode } else { - if (promptForMissionRemove && (_missionController.containsItems || _geoFenceController.containsItems || _rallyPointController.containsItems)) { - // ArduPilot has a strange bug which prevents mission clear from working at certain times, so we can't show this dialog - if (!activeVehicle.apmFirmware) { - mainWindow.showComponentDialog(missionCompleteDialogComponent, qsTr("Flight Plan complete"), mainWindow.showDialogDefaultWidth, StandardButton.Close) - } + if (showMissionCompleteDialog) { + mainWindow.showComponentDialog(missionCompleteDialogComponent, qsTr("Flight Plan complete"), mainWindow.showDialogDefaultWidth, StandardButton.Close) } - promptForMissionRemove = false + vehicleWasArmed = false + vehicleWasInMissionFlightMode = false } } onVehicleInMissionFlightModeChanged: { - if (!promptForMissionRemove && vehicleArmed) { - promptForMissionRemove = true + if (vehicleInMissionFlightMode && vehicleArmed) { + vehicleWasInMissionFlightMode = true } } @@ -193,46 +191,47 @@ Item { anchors.margins: _margins anchors.left: parent.left anchors.right: parent.right + spacing: ScreenTools.defaultFontPixelHeight - ColumnLayout { - Layout.fillWidth: true - spacing: ScreenTools.defaultFontPixelHeight - visible: !activeVehicle.connectionLost || !_guidedController.showResumeMission + QGCLabel { + Layout.fillWidth: true + text: qsTr("%1 Images Taken").arg(activeVehicle.cameraTriggerPoints.count) + horizontalAlignment: Text.AlignHCenter + visible: activeVehicle.cameraTriggerPoints.count !== 0 + } - QGCLabel { - Layout.fillWidth: true - text: qsTr("%1 Images Taken").arg(activeVehicle.cameraTriggerPoints.count) - horizontalAlignment: Text.AlignHCenter - visible: activeVehicle.cameraTriggerPoints.count !== 0 + QGCButton { + Layout.fillWidth: true + text: qsTr("Remove plan from vehicle") + visible: !activeVehicle.connectionLost// && !activeVehicle.apmFirmware // ArduPilot has a bug somewhere with mission clear + onClicked: { + _planController.removeAllFromVehicle() + hideDialog() } + } - QGCButton { - Layout.fillWidth: true - text: qsTr("Remove plan from vehicle") - onClicked: { - _planController.removeAllFromVehicle() - hideDialog() - } - } + QGCButton { + Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + text: qsTr("Leave plan on vehicle") + onClicked: hideDialog() + } - QGCButton { - Layout.fillWidth: true - Layout.alignment: Qt.AlignHCenter - text: qsTr("Leave plan on vehicle") - onClicked: hideDialog() - } + Rectangle { + Layout.fillWidth: true + color: qgcPal.text + height: 1 + } - Rectangle { - Layout.fillWidth: true - color: qgcPal.text - height: 1 - } + ColumnLayout { + Layout.fillWidth: true + spacing: ScreenTools.defaultFontPixelHeight + visible: !activeVehicle.connectionLost && _guidedController.showResumeMission QGCButton { Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter text: qsTr("Resume Mission From Waypoint %1").arg(_guidedController._resumeMissionIndex) - visible: _guidedController.showResumeMission onClicked: { guidedController.executeAction(_guidedController.actionResumeMission, null, null) @@ -244,29 +243,15 @@ Item { Layout.fillWidth: true wrapMode: Text.WordWrap text: qsTr("Resume Mission will rebuild the current mission from the last flown waypoint and upload it to the vehicle for the next flight.") - visible: _guidedController.showResumeMission - } - - QGCLabel { - Layout.fillWidth: true - wrapMode: Text.WordWrap - color: qgcPal.warningText - text: qsTr("If you are changing batteries for Resume Mission do not disconnect from the vehicle when communication is lost.") - visible: _guidedController.showResumeMission } } - ColumnLayout { + QGCLabel { Layout.fillWidth: true - spacing: ScreenTools.defaultFontPixelHeight - visible: activeVehicle.connectionLost && _guidedController.showResumeMission - - QGCLabel { - Layout.fillWidth: true - wrapMode: Text.WordWrap - color: qgcPal.warningText - text: qsTr("If you are changing batteries for Resume Mission do not disconnect from the vehicle.") - } + wrapMode: Text.WordWrap + color: qgcPal.warningText + text: qsTr("If you are changing batteries for Resume Mission do not disconnect from the vehicle.") + visible: _guidedController.showResumeMission } } } diff --git a/src/FlightDisplay/FlightDisplayViewWidgets.qml b/src/FlightDisplay/FlightDisplayViewWidgets.qml index 13b7d54db63604217045809733e7c50a82fc6a47..305d41943b36b352778a102e4d848f708a28d76b 100644 --- a/src/FlightDisplay/FlightDisplayViewWidgets.qml +++ b/src/FlightDisplay/FlightDisplayViewWidgets.qml @@ -134,7 +134,7 @@ Item { spacing: ScreenTools.defaultFontPixelHeight property bool noGPSLockVisible: activeVehicle && !activeVehicle.coordinate.isValid && mainIsMap - property bool prearmErrorVisible: activeVehicle && activeVehicle.prearmError + property bool prearmErrorVisible: activeVehicle && !activeVehicle.armed && activeVehicle.prearmError QGCLabel { anchors.horizontalCenter: parent.horizontalCenter diff --git a/src/MissionManager/QGCMapPolygonVisuals.qml b/src/MissionManager/QGCMapPolygonVisuals.qml index 7c51c0473585a5785199e53010cb37f05feab54f..c00fb1b95991c12da619b99d97a5a161e502f94e 100644 --- a/src/MissionManager/QGCMapPolygonVisuals.qml +++ b/src/MissionManager/QGCMapPolygonVisuals.qml @@ -516,10 +516,11 @@ Item { id: toolbarComponent PlanEditToolbar { - x: mapControl.centerViewport.left - y: mapControl.centerViewport.top - width: mapControl.centerViewport.width - z: QGroundControl.zOrderMapItems + 2 + anchors.horizontalCenter: mapControl.left + anchors.horizontalCenterOffset: mapControl.centerViewport.left + (mapControl.centerViewport.width / 2) + y: mapControl.centerViewport.top + z: QGroundControl.zOrderMapItems + 2 + availableWidth: mapControl.centerViewport.width QGCButton { _horizontalPadding: 0 diff --git a/src/MissionManager/QGCMapPolylineVisuals.qml b/src/MissionManager/QGCMapPolylineVisuals.qml index fbd9a816a617e97cac2772a965671e8993fd697f..ab88a61c9a24a8869348c95978fa9cc472ac556a 100644 --- a/src/MissionManager/QGCMapPolylineVisuals.qml +++ b/src/MissionManager/QGCMapPolylineVisuals.qml @@ -314,10 +314,11 @@ Item { id: toolbarComponent PlanEditToolbar { - x: mapControl.centerViewport.left - y: mapControl.centerViewport.top - width: mapControl.centerViewport.width - z: QGroundControl.zOrderMapItems + 2 + anchors.horizontalCenter: mapControl.left + anchors.horizontalCenterOffset: mapControl.centerViewport.left + (mapControl.centerViewport.width / 2) + y: mapControl.centerViewport.top + z: QGroundControl.zOrderMapItems + 2 + availableWidth: mapControl.centerViewport.width QGCButton { _horizontalPadding: 0 diff --git a/src/PlanView/MissionItemEditor.qml b/src/PlanView/MissionItemEditor.qml index 8b8a577c6c5dca5862c09bd5862bae77345b5168..5a1ec4936356561016360eaa788a985ee7cea7d8 100644 --- a/src/PlanView/MissionItemEditor.qml +++ b/src/PlanView/MissionItemEditor.qml @@ -14,11 +14,13 @@ import QGroundControl.Palette 1.0 /// Mission item edit control Rectangle { - id: _root - height: editorLoader.visible ? (editorLoader.y + editorLoader.height + (_margin * 2)) : (commandPicker.y + commandPicker.height + _margin / 2) - color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade - radius: _radius - opacity: _currentItem ? 1.0 : 0.7 + id: _root + height: editorLoader.visible ? (editorLoader.y + editorLoader.height + (_margin * 2)) : (commandPicker.y + commandPicker.height + _margin / 2) + color: _currentItem ? qgcPal.missionItemEditor : qgcPal.windowShade + radius: _radius + opacity: _currentItem ? 1.0 : 0.7 + border.width: _readyForSave ? 0 : 1 + border.color: qgcPal.warningText property var map ///< Map control property var masterController @@ -38,6 +40,7 @@ Rectangle { property bool _noMissionItemsAdded: ListView.view.model.count === 1 property real _sectionSpacer: ScreenTools.defaultFontPixelWidth / 2 // spacing between section headings property bool _singleComplexItem: _missionController.complexMissionItemNames.length === 1 + property bool _readyForSave: missionItem.readyForSaveState === VisualMissionItem.ReadyForSave readonly property real _editFieldWidth: Math.min(width - _margin * 2, ScreenTools.defaultFontPixelWidth * 12) readonly property real _margin: ScreenTools.defaultFontPixelWidth / 2 @@ -73,27 +76,43 @@ Rectangle { } Rectangle { - anchors.verticalCenter: commandPicker.verticalCenter + id: notReadyForSaveIndicator + anchors.verticalCenter: notReadyForSaveLabel.visible ? notReadyForSaveLabel.verticalCenter : commandPicker.verticalCenter anchors.leftMargin: _margin anchors.left: parent.left width: readyForSaveLabel.contentHeight height: width border.width: 1 - border.color: "red" + border.color: qgcPal.warningText color: "white" radius: width / 2 - visible: missionItem.readyForSaveState !== VisualMissionItem.ReadyForSave + visible: !_readyForSave QGCLabel { id: readyForSaveLabel anchors.centerIn: parent //: Indicator in Plan view to show mission item is not ready for save/send text: qsTr("?") - color: "red" + color: qgcPal.warningText font.pointSize: ScreenTools.smallFontPointSize } } + QGCLabel { + id: notReadyForSaveLabel + anchors.margins: _margin + anchors.left: notReadyForSaveIndicator.right + anchors.right: parent.right + anchors.top: commandPicker.bottom + visible: _currentItem && !_readyForSave + text: missionItem.readyForSaveState === VisualMissionItem.NotReadyForSaveTerrain ? + qsTr("Incomplete: Waiting on terrain data.") : + qsTr("Incomplete: Item not fully specified.") + wrapMode: Text.WordWrap + horizontalAlignment: Text.AlignHCenter + color: qgcPal.warningText + } + QGCColoredImage { id: hamburger anchors.rightMargin: ScreenTools.defaultFontPixelWidth @@ -197,18 +216,10 @@ Rectangle { QGCButton { id: commandPicker - anchors.topMargin: _margin / 2 + anchors.topMargin: _margin anchors.rightMargin: ScreenTools.defaultFontPixelWidth - anchors.leftMargin: _margin anchors.left: parent.left - - /* - Trying no sequence numbers in ui - anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2 - anchors.left: label.right - */ - anchors.top: parent.top visible: !commandLabel.visible text: missionItem.commandName @@ -237,10 +248,9 @@ Rectangle { Loader { id: editorLoader - anchors.leftMargin: _margin - anchors.topMargin: _margin + anchors.margins: _margin anchors.left: parent.left - anchors.top: commandPicker.bottom + anchors.top: _readyForSave ? commandPicker.bottom : notReadyForSaveLabel.bottom source: missionItem.editorQml visible: _currentItem diff --git a/src/PlanView/PlanEditToolbar.qml b/src/PlanView/PlanEditToolbar.qml index 7822e41a583435b81cafcecc7a1a110b448592f4..9601945662eae0de2922718e5508586cab955631 100644 --- a/src/PlanView/PlanEditToolbar.qml +++ b/src/PlanView/PlanEditToolbar.qml @@ -14,14 +14,18 @@ import QtQuick.Layouts 1.2 import QGroundControl 1.0 import QGroundControl.ScreenTools 1.0 import QGroundControl.Controls 1.0 +import QGroundControl.Palette 1.0 /// Toolbar used for things like Polygon editing tools Item { + width: Math.min(toolsRowLayout.width + (_margins * 2), availableWidth) height: toolsFlickable.y + toolsFlickable.height + _margins z: QGroundControl.zOrderMapItems + 2 - property real _radius: ScreenTools.defaultFontPixelWidth / 2 - property real _margins: ScreenTools.defaultFontPixelWidth / 2 + property real availableWidth + + property real _radius: ScreenTools.defaultFontPixelWidth / 2 + property real _margins: ScreenTools.defaultFontPixelWidth / 2 Component.onCompleted: { // Move the child controls from consumer into the layout control @@ -39,8 +43,7 @@ Item { Rectangle { anchors.fill: parent radius: _radius - color: "white" - opacity: 0.75 + color: qgcPal.globalTheme === QGCPalette.Light ? QGroundControl.corePlugin.options.toolbarBackgroundLight : QGroundControl.corePlugin.options.toolbarBackgroundDark } QGCFlickable { @@ -64,10 +67,8 @@ Item { id: instructionComponent QGCLabel { - id: instructionLabel - color: "black" - text: _instructionText - Layout.fillWidth: true + id: instructionLabel + text: _instructionText } } } diff --git a/src/ui/MainRootWindow.qml b/src/ui/MainRootWindow.qml index e37fc8352ef423c76d60de4313168575b65ff3a8..8111f221af6b367701ccc3bd1715ce5843bdfa69 100644 --- a/src/ui/MainRootWindow.qml +++ b/src/ui/MainRootWindow.qml @@ -153,6 +153,9 @@ ApplicationWindow { mainWindowDialog.dialogButtons = buttons mainWindowDialog.open() if(buttons & StandardButton.Cancel || buttons & StandardButton.Close || buttons & StandardButton.Discard || buttons & StandardButton.Abort || buttons & StandardButton.Ignore) { + mainWindowDialog.closePolicy = Popup.NoAutoClose; + mainWindowDialog.interactive = false; + } else { mainWindowDialog.closePolicy = Popup.CloseOnEscape | Popup.CloseOnPressOutside; mainWindowDialog.interactive = true; }