Commit 71c503e4 authored by Don Gagne's avatar Don Gagne

Allow set position/heading from vehicle

parent 8584c7af
......@@ -33,6 +33,10 @@ Rectangle {
property real _margin: ScreenTools.defaultFontPixelWidth / 2
property real _spacer: ScreenTools.defaultFontPixelWidth / 2
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property string _setToVehicleHeadingStr: qsTr("Set to vehicle heading")
property string _setToVehicleLocationStr: qsTr("Set to vehicle location")
ExclusiveGroup { id: distanceGlideGroup }
......@@ -45,9 +49,16 @@ Rectangle {
visible: missionItem.landingCoordSet
SectionHeader {
id: loiterPointSection
text: qsTr("Loiter point")
}
Column {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
visible: loiterPointSection.checked
Item { width: 1; height: _spacer }
FactTextFieldGrid {
......@@ -65,7 +76,23 @@ Rectangle {
onClicked: missionItem.loiterClockwise = checked
}
SectionHeader { text: qsTr("Landing point") }
QGCButton {
text: _setToVehicleHeadingStr
visible: _activeVehicle
onClicked: missionItem.landingHeading.rawValue = _activeVehicle.heading.rawValue
}
}
SectionHeader {
id: landingPointSection
text: qsTr("Landing point")
}
Column {
anchors.left: parent.left
anchors.right: parent.right
spacing: _margin
visible: landingPointSection.checked
Item { width: 1; height: _spacer }
......@@ -117,6 +144,14 @@ Rectangle {
enabled: specifyGlideSlope.checked
Layout.fillWidth: true
}
QGCButton {
text: _setToVehicleLocationStr
visible: _activeVehicle
Layout.columnSpan: 2
onClicked: missionItem.landingCoordinate = _activeVehicle.coordinate
}
}
}
Item { width: 1; height: _spacer }
......@@ -143,7 +178,27 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
text: qsTr("Click in map to set landing point.")
}
QGCLabel {
anchors.left: parent.left
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter
text: qsTr("- or -")
visible: _activeVehicle
}
QGCButton {
anchors.horizontalCenter: parent.horizontalCenter
text: _setToVehicleLocationStr
visible: _activeVehicle
onClicked: {
missionItem.landingCoordinate = _activeVehicle.coordinate
missionItem.landingHeading.rawValue = _activeVehicle.heading.rawValue
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment