QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
RCToParamDialog.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3import QtQuick.Controls
4import QtQuick.Dialogs
5
6import QGroundControl
7import QGroundControl.Controls
8import QGroundControl.FactControls
9
10QGCPopupDialog {
11 title: qsTr("RC To Param")
12 buttons: Dialog.Cancel | Dialog.Ok
13
14 property alias tuningFact: controller.tuningFact
15
16 onAccepted: QGroundControl.multiVehicleManager.activeVehicle.sendParamMapRC(tuningFact.name, scale.text, centerValue.text, tuningID.currentIndex, minValue.text, maxValue.text)
17
18 RCToParamDialogController {
19 id: controller
20 }
21
22 ColumnLayout {
23 spacing: ScreenTools.defaultDialogControlSpacing
24
25 QGCLabel {
26 Layout.preferredWidth: mainGrid.width
27 Layout.fillWidth: true
28 wrapMode: Text.WordWrap
29 text: qsTr("Bind an RC Channel to a parameter value. Tuning IDs can be mapped to an RC Channel from Radio Setup page.")
30 }
31
32 QGCLabel {
33 Layout.preferredWidth: mainGrid.width
34 Layout.fillWidth: true
35 text: qsTr("Waiting on parameter update from Vehicle.")
36 visible: !controller.ready
37 }
38
39 GridLayout {
40 id: mainGrid
41 columns: 2
42 rowSpacing: ScreenTools.defaultDialogControlSpacing
43 columnSpacing: ScreenTools.defaultDialogControlSpacing
44 enabled: controller.ready
45
46 QGCLabel { text: qsTr("Parameter") }
47 QGCLabel { text: tuningFact.name }
48
49 QGCLabel { text: qsTr("Tuning ID") }
50 QGCComboBox {
51 id: tuningID
52 Layout.fillWidth: true
53 currentIndex: 0
54 model: [ 1, 2, 3 ]
55 }
56
57 QGCLabel { text: qsTr("Scale") }
58 QGCTextField {
59 id: scale
60 text: controller.scale.valueString
61 }
62
63 QGCLabel { text: qsTr("Center Value") }
64 QGCTextField {
65 id: centerValue
66 text: controller.center.valueString
67 }
68
69 QGCLabel { text: qsTr("Min Value") }
70 QGCTextField {
71 id: minValue
72 text: controller.min.valueString
73 }
74
75 QGCLabel { text: qsTr("Max Value") }
76 QGCTextField {
77 id: maxValue
78 text: controller.max.valueString
79 }
80 }
81
82 QGCLabel {
83 Layout.preferredWidth: mainGrid.width
84 Layout.fillWidth: true
85 wrapMode: Text.WordWrap
86 text: qsTr("Double check that all values are correct prior to confirming dialog.")
87 }
88 }
89}