QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
SyslinkComponent.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Dialogs
4import QtQuick.Layouts
5
6import QGroundControl
7import QGroundControl.FactControls
8import QGroundControl.Controls
9
10SetupPage {
11 id: syslinkPage
12 pageComponent: pageComponent
13
14 Component {
15 id: pageComponent
16
17 Column {
18 id: innerColumn
19 width: availableWidth
20 spacing: ScreenTools.defaultFontPixelHeight * 0.5
21
22 property int textEditWidth: ScreenTools.defaultFontPixelWidth * 12
23
24
25 SyslinkComponentController {
26 id: controller
27 }
28
29 QGCLabel {
30 text: qsTr("Radio Settings")
31 font.bold: true
32 }
33
34 Rectangle {
35 width: parent.width
36 height: radioGrid.height + ScreenTools.defaultFontPixelHeight
37 color: qgcPal.windowShade
38
39 GridLayout {
40 id: radioGrid
41 anchors.margins: ScreenTools.defaultFontPixelHeight / 2
42 anchors.left: parent.left
43 anchors.top: parent.top
44 columns: 2
45 columnSpacing: ScreenTools.defaultFontPixelWidth
46
47 QGCLabel {
48 text: qsTr("Channel")
49 }
50
51 QGCTextField {
52 id: channelField
53 width: textEditWidth
54 text: controller.radioChannel
55 validator: IntValidator {bottom: 0; top: 125;}
56 inputMethodHints: Qt.ImhDigitsOnly
57 onEditingFinished: {
58 controller.radioChannel = text
59 }
60 }
61
62 QGCLabel {
63 id: channelHelp
64 Layout.columnSpan: radioGrid.columns
65 Layout.fillWidth: true
66 font.pointSize: ScreenTools.smallFontPointSize
67 wrapMode: Text.WordWrap
68 text: "Channel can be between 0 and 125"
69 }
70
71 QGCLabel {
72 id: addressLabel
73 text: qsTr("Address")
74 }
75
76 QGCTextField {
77 id: addressField
78 width: textEditWidth
79 text: controller.radioAddress
80 maximumLength: 10
81 validator: RegExpValidator { regExp: /^[0-9A-Fa-f]*$/ }
82 onEditingFinished: {
83 controller.radioAddress = text
84 }
85 }
86
87 QGCLabel {
88 id: addressHelp
89 Layout.columnSpan: radioGrid.columns
90 Layout.fillWidth: true
91 font.pointSize: ScreenTools.smallFontPointSize
92 wrapMode: Text.WordWrap
93 text: qsTr("Address in hex. Default is E7E7E7E7E7.")
94 }
95
96
97 QGCLabel {
98 id: rateLabel
99 text: qsTr("Data Rate")
100 }
101
102 QGCComboBox {
103 id: rateField
104 Layout.fillWidth: true
105 model: controller.radioRates
106 currentIndex: controller.radioRate
107 onActivated: (index) => {
108 controller.radioRate = index
109 }
110 }
111
112 QGCButton {
113 text: qsTr("Restore Defaults")
114 width: textEditWidth
115 onClicked: {
116 controller.resetDefaults()
117 }
118 }
119
120 } // Grid
121 } // Rectangle - Radio Settings
122
123
124 }
125 }
126}