From 62407de6460e67d39de54f31acd9632b136d5a61 Mon Sep 17 00:00:00 2001 From: Gus Grubba Date: Tue, 24 Jul 2018 14:12:08 -0400 Subject: [PATCH] Adding a slider to set the mission path angle This is in addition to the existing text edit control. --- src/FactSystem/FactControls/FactTextField.qml | 4 ++++ src/PlanView/SurveyItemEditor.qml | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/FactSystem/FactControls/FactTextField.qml b/src/FactSystem/FactControls/FactTextField.qml index ab66d9f2d..34ed20e83 100644 --- a/src/FactSystem/FactControls/FactTextField.qml +++ b/src/FactSystem/FactControls/FactTextField.qml @@ -16,6 +16,8 @@ QGCTextField { showUnits: true showHelp: true + signal updated() + property Fact fact: null property string _validateString @@ -29,6 +31,7 @@ QGCTextField { var errorString = fact.validate(text, false /* convertOnly */) if (errorString === "") { fact.value = text + _textField.updated() } else { _validateString = text qgcView.showDialog(validationErrorDialogComponent, qsTr("Invalid Value"), qgcView.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel) @@ -36,6 +39,7 @@ QGCTextField { } else { fact.value = text fact.valueChanged(fact.value) + _textField.updated() } } diff --git a/src/PlanView/SurveyItemEditor.qml b/src/PlanView/SurveyItemEditor.qml index 5e01474e4..dadabc6a7 100644 --- a/src/PlanView/SurveyItemEditor.qml +++ b/src/PlanView/SurveyItemEditor.qml @@ -90,6 +90,20 @@ Rectangle { FactTextField { fact: missionItem.gridAngle 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") } -- 2.22.0