QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
UdpSettings.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.Controls
7
8ColumnLayout {
9 spacing: _rowSpacing
10
11 function saveSettings() {
12 // No need
13 }
14
15 QGCLabel {
16 Layout.preferredWidth: _secondColumnWidth
17 Layout.fillWidth: true
18 font.pointSize: ScreenTools.smallFontPointSize
19 wrapMode: Text.WordWrap
20 text: qsTr("Note: For best perfomance, please disable AutoConnect to UDP devices on the General page.")
21 }
22
23 RowLayout {
24 spacing: _colSpacing
25
26 QGCLabel { text: qsTr("Port") }
27 QGCTextField {
28 id: portField
29 text: subEditConfig.localPort.toString()
30 focus: true
31 Layout.preferredWidth: _secondColumnWidth
32 inputMethodHints: Qt.ImhFormattedNumbersOnly
33 onTextChanged: subEditConfig.localPort = parseInt(portField.text)
34 }
35 }
36
37 QGCLabel { text: qsTr("Server Addresses (optional)") }
38
39 Repeater {
40 model: subEditConfig.hostList
41
42 delegate: RowLayout {
43 spacing: _colSpacing
44
45 QGCLabel {
46 Layout.preferredWidth: _secondColumnWidth
47 text: modelData
48 }
49
50 QGCButton {
51 text: qsTr("Remove")
52 onClicked: subEditConfig.removeHost(modelData)
53 }
54 }
55 }
56
57 RowLayout {
58 spacing: _colSpacing
59
60 QGCTextField {
61 id: hostField
62 Layout.preferredWidth: _secondColumnWidth
63 placeholderText: qsTr("Example: 127.0.0.1:14550")
64 }
65 QGCButton {
66 text: qsTr("Add Server")
67 enabled: hostField.text !== ""
68 onClicked: {
69 subEditConfig.addHost(hostField.text)
70 hostField.text = ""
71 }
72 }
73 }
74}