Browse Source

Adding a slider to set the mission path angle

This is in addition to the existing text edit control.
QGC4.4
Gus Grubba 7 years ago
parent
commit
8d251ffc82
  1. 4
      src/FactSystem/FactControls/FactTextField.qml
  2. 14
      src/PlanView/SurveyItemEditor.qml

4
src/FactSystem/FactControls/FactTextField.qml

@ -16,6 +16,8 @@ QGCTextField {
showUnits: true showUnits: true
showHelp: true showHelp: true
signal updated()
property Fact fact: null property Fact fact: null
property string _validateString property string _validateString
@ -29,6 +31,7 @@ QGCTextField {
var errorString = fact.validate(text, false /* convertOnly */) var errorString = fact.validate(text, false /* convertOnly */)
if (errorString === "") { if (errorString === "") {
fact.value = text fact.value = text
_textField.updated()
} else { } else {
_validateString = text _validateString = text
qgcView.showDialog(validationErrorDialogComponent, qsTr("Invalid Value"), qgcView.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel) qgcView.showDialog(validationErrorDialogComponent, qsTr("Invalid Value"), qgcView.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel)
@ -36,6 +39,7 @@ QGCTextField {
} else { } else {
fact.value = text fact.value = text
fact.valueChanged(fact.value) fact.valueChanged(fact.value)
_textField.updated()
} }
} }

14
src/PlanView/SurveyItemEditor.qml

@ -90,6 +90,20 @@ Rectangle {
FactTextField { FactTextField {
fact: missionItem.gridAngle fact: missionItem.gridAngle
Layout.fillWidth: true Layout.fillWidth: true
onUpdated: angleSlider.value = missionItem.gridAngle.value
}
QGCSlider {
id: angleSlider
minimumValue: 0
maximumValue: 359
stepSize: 1
tickmarksEnabled: false
Layout.fillWidth: true
Layout.columnSpan: 2
Layout.preferredHeight: ScreenTools.defaultFontPixelHeight * 1.5
onValueChanged: missionItem.gridAngle.value = value
Component.onCompleted: value = missionItem.gridAngle.value
updateValueWhileDragging: true
} }
QGCLabel { text: qsTr("Turnaround dist") } QGCLabel { text: qsTr("Turnaround dist") }

Loading…
Cancel
Save