Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/FlyView/FlyView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ Item {
parentToolInsets: _toolInsets
mapControl: _mapControl
visible: !QGroundControl.videoManager.fullScreen
utmspActTrigger: utmspSendActTrigger
isViewer3DOpen: viewer3DWindow.isOpen
}

Expand Down Expand Up @@ -189,7 +188,9 @@ Item {
}

FlyViewToolBar {
id: toolbar
visible: !QGroundControl.videoManager.fullScreen
id: toolbar
guidedValueSlider: _guidedValueSlider
utmspSliderTrigger: utmspSendActTrigger
visible: !QGroundControl.videoManager.fullScreen
}
}
11 changes: 0 additions & 11 deletions src/FlyView/FlyViewWidgetLayer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ Item {
property bool _layoutSpacing: ScreenTools.defaultFontPixelWidth
property bool _showSingleVehicleUI: true

property bool utmspActTrigger

QGCToolInsets {
id: _totalToolInsets
leftEdgeTopInset: toolStrip.leftEdgeTopInset
Expand Down Expand Up @@ -105,15 +103,6 @@ Item {
rallyPointController: _rallyPointController
}

GuidedActionConfirm {
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
z: QGroundControl.zOrderTopMost
guidedController: _guidedController
guidedValueSlider: _guidedValueSlider
utmspSliderTrigger: utmspActTrigger
}

//-- Virtual Joystick
Loader {
id: virtualJoystickMultiTouch
Expand Down
83 changes: 37 additions & 46 deletions src/FlyView/GuidedActionConfirm.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,17 @@ import QtQuick.Controls
import QtQuick.Layouts

import QGroundControl

import QGroundControl.Controls

import QGroundControl.UTMSP

Rectangle {
Item {
id: control
width: mainLayout.width + (_margins * 2)
height: mainLayout.height + (_margins * 2)
radius: ScreenTools.defaultFontPixelWidth / 2
color: qgcPal.window
width: mainLayout.width
visible: _utmspEnabled === true ? utmspSliderTrigger: false

property var guidedController
property var guidedValueSlider
property var messageDisplay
property string title
property string message
property int action
Expand All @@ -36,7 +32,7 @@ Rectangle {
property alias optionText: optionCheckBox.text
property alias optionChecked: optionCheckBox.checked

property real _margins: ScreenTools.defaultFontPixelHeight / 2
property real _margins: 2
property bool _emergencyAction: action === guidedController.actionEmergencyStop

// Properties of UTM adapter
Expand All @@ -53,7 +49,7 @@ Rectangle {

function show(immediate) {
if (immediate) {
visible = true
_reallyShow()
} else {
// We delay showing the confirmation for a small amount in order for any other state
// changes to propogate through the system. This way only the final state shows up.
Expand All @@ -66,44 +62,37 @@ Rectangle {
visible = false
hideTrigger = false
visibleTimer.stop()
messageDisplay.opacity = 1.0
messageFadeTimer.stop()
messageOpacityAnimation.stop()
if (mapIndicator) {
mapIndicator.actionCancelled()
mapIndicator = undefined
}
}

function _reallyShow() {
visible = true
messageDisplay.opacity = 1.0
messageFadeTimer.start()
}

Timer {
id: visibleTimer
interval: 1000
repeat: false
onTriggered: visible = true
onTriggered: _reallyShow()
}

QGCPalette { id: qgcPal }

ColumnLayout {
RowLayout {
id: mainLayout
x: control._margins
y: control._margins
spacing: control._margins

QGCLabel {
Layout.fillWidth: true
Layout.leftMargin: closeButton.width + closeButton.anchors.rightMargin
Layout.rightMargin: Layout.leftMargin
text: control.message
horizontalAlignment: Text.AlignHCenter
}

QGCCheckBox {
id: optionCheckBox
Layout.alignment: Qt.AlignHCenter
text: ""
visible: text !== ""
}
y: 2
height: parent.height - 4
spacing: ScreenTools.defaultFontPixelWidth

QGCDelayButton {
Layout.fillWidth: true
text: control.title
enabled: _utmspEnabled === true? utmspSliderTrigger : true
opacity: if(_utmspEnabled){utmspSliderTrigger === true ? 1 : 0.5} else{1}
Expand All @@ -127,23 +116,25 @@ Rectangle {
UTMSPStateStorage.currentStateIndex = 3
}
}
}

QGCColoredImage {
id: closeButton
anchors.topMargin: _margins / 2
anchors.rightMargin: _margins / 2
anchors.top: parent.top
anchors.right: parent.right
height: ScreenTools.defaultFontPixelHeight * 0.5
width: height
source: "/res/XDelete.svg"
fillMode: Image.PreserveAspectFit
color: qgcPal.text

QGCMouseArea {
fillItem: parent
onClicked: confirmCancelled()
QGCCheckBox {
id: optionCheckBox
visible: text !== ""
}

QGCColoredImage {
id: closeButton
Layout.alignment: Qt.AlignTop
width: height
height: ScreenTools.defaultFontPixelHeight * 0.5
source: "/res/XDelete.svg"
fillMode: Image.PreserveAspectFit
color: qgcPal.text

QGCMouseArea {
fillItem: parent
onClicked: confirmCancelled()
}
}
}
}
40 changes: 20 additions & 20 deletions src/FlyView/GuidedActionsController.qml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Item {
readonly property string gotoTitle: qsTr("Go To Location")
readonly property string roiTitle: qsTr("ROI")
readonly property string setHomeTitle: qsTr("Set Home")
readonly property string setEstimatorOriginTitle: qsTr("Set Estimator origin")
readonly property string setEstimatorOriginTitle: qsTr("Set Estimator Origin")
readonly property string setFlightMode: qsTr("Set Flight Mode")
readonly property string changeHeadingTitle: qsTr("Change Heading")

Expand All @@ -67,28 +67,28 @@ Item {
readonly property string disarmMessage: qsTr("Disarm the vehicle")
readonly property string mvDisarmMessage: qsTr("Disarm selected vehicles.")
readonly property string emergencyStopMessage: qsTr("WARNING: THIS WILL STOP ALL MOTORS. IF VEHICLE IS CURRENTLY IN THE AIR IT WILL CRASH.")
readonly property string takeoffMessage: qsTr("Takeoff from ground and hold position.")
readonly property string startMissionMessage: qsTr("Takeoff from ground and start the current mission.")
readonly property string mvStartMissionMessage: qsTr("Takeoff from ground and start the current mission for selected vehicles.")
readonly property string continueMissionMessage: qsTr("Continue the mission from the current waypoint.")
readonly property string takeoffMessage: qsTr("Takeoff and hold position")
readonly property string startMissionMessage: qsTr("Takeoff and start the current mission")
readonly property string mvStartMissionMessage: qsTr("Takeoff and start the current mission for selected vehicles")
readonly property string continueMissionMessage: qsTr("Continue the mission from the current waypoint")
readonly property string resumeMissionUploadFailMessage: qsTr("Upload of resume mission failed. Confirm to retry upload")
readonly property string landMessage: qsTr("Land the vehicle at the current position.")
readonly property string rtlMessage: qsTr("Return to the launch position of the vehicle.")
readonly property string changeAltMessage: qsTr("Change the altitude of the vehicle up or down.")
readonly property string changeLoiterRadiusMessage: qsTr("Change the forward flight loiter radius.")
readonly property string changeCruiseSpeedMessage: qsTr("Change the maximum horizontal cruise speed.")
readonly property string changeAirspeedMessage: qsTr("Change the equivalent airspeed setpoint.")
readonly property string gotoMessage: qsTr("Move the vehicle to the specified location.")
property string setWaypointMessage: qsTr("Adjust current waypoint to %1.").arg(_actionData)
readonly property string orbitMessage: qsTr("Orbit the vehicle around the specified location.")
readonly property string landAbortMessage: qsTr("Abort the landing sequence.")
readonly property string pauseMessage: qsTr("Pause the vehicle at it's current position, adjusting altitude up or down as needed.")
readonly property string mvPauseMessage: qsTr("Pause selected vehicles at their current position.")
readonly property string roiMessage: qsTr("Make the specified location a Region Of Interest.")
readonly property string landMessage: qsTr("Land the vehicle at the current position")
readonly property string rtlMessage: qsTr("Return to the launch position of the vehicle")
readonly property string changeAltMessage: qsTr("Change the altitude of the vehicle up or down")
readonly property string changeLoiterRadiusMessage: qsTr("Change the forward flight loiter radius")
readonly property string changeCruiseSpeedMessage: qsTr("Change the maximum horizontal cruise speed")
readonly property string changeAirspeedMessage: qsTr("Change the equivalent airspeed setpoint")
readonly property string gotoMessage: qsTr("Move the vehicle to the specified location")
property string setWaypointMessage: qsTr("Adjust current waypoint to %1").arg(_actionData)
readonly property string orbitMessage: qsTr("Orbit the vehicle around the specified location")
readonly property string landAbortMessage: qsTr("Abort the landing sequence")
readonly property string pauseMessage: qsTr("Pause at current position")
readonly property string mvPauseMessage: qsTr("Pause selected vehicles at their current position")
readonly property string roiMessage: qsTr("Make the specified location a Region Of Interest")
readonly property string setHomeMessage: qsTr("Set vehicle home as the specified location. This will affect Return to Home position")
readonly property string setEstimatorOriginMessage: qsTr("Make the specified location the estimator origin.")
readonly property string setEstimatorOriginMessage: qsTr("Make the specified location the estimator origin")
readonly property string setFlightModeMessage: qsTr("Set the vehicle flight mode to %1").arg(_actionData)
readonly property string changeHeadingMessage: qsTr("Set the vehicle heading towards the specified location.")
readonly property string changeHeadingMessage: qsTr("Set the vehicle heading towards the specified location")

readonly property int actionRTL: 1
readonly property int actionLand: 2
Expand Down
Loading
Loading