QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
NTRIPMountpointBrowser.qml
Go to the documentation of this file.
1pragma ComponentBehavior: Bound
2
3import QtQuick
4import QtQuick.Layouts
5
6import QGroundControl
7import QGroundControl.Controls
8import QGroundControl.FactControls
9import QGroundControl.GPS
10
11SettingsGroupLayout {
12 id: root
13
14 readonly property NTRIPSettings _ntrip: QGroundControl.settingsManager.ntripSettings
15 readonly property NTRIPManager _ntripMgr: QGroundControl.gpsManager.ntrip
16 readonly property NTRIPSourceTableController _sourceTable: root._ntripMgr.sourceTableController
17 readonly property Vehicle _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
18 property bool _isActive: root._ntrip.ntripServerConnectEnabled.rawValue
19 readonly property bool _hasHost: root._ntrip.ntripServerHostAddress.rawValue !== ""
20 readonly property bool _fetching: root._sourceTable.fetchStatus === NTRIPSourceTableController.InProgress
21
22 Layout.fillWidth: true
23 heading: qsTr("NTRIP Mountpoint")
24 visible: root._ntrip.userVisible && (root._ntrip.ntripMountpoint as SettingsFact).userVisible
25
26 RowLayout {
27 Layout.fillWidth: true
28 spacing: ScreenTools.defaultFontPixelWidth
29
30 LabelledFactTextField {
31 objectName: "ntripMountpointField"
32 Layout.fillWidth: true
33 textFieldPreferredWidth: ScreenTools.defaultFontPixelWidth * 30
34 fact: root._ntrip.ntripMountpoint
35 enabled: !root._isActive
36 }
37
38 QGCButton {
39 objectName: "ntripBrowseButton"
40 text: qsTr("Browse")
41 enabled: !root._isActive && root._hasHost && !root._fetching
42 onClicked: root._activeVehicle ? root._ntripMgr.fetchMountpoints(root._activeVehicle.coordinate)
43 : root._ntripMgr.fetchMountpoints()
44 }
45 }
46
47 GPSNoteLabel {
48 visible: root._fetching
49 text: qsTr("Fetching mountpoints…")
50 }
51
52 GPSNoteLabel {
53 objectName: "ntripSourceTableSecurityWarning"
54 visible: text !== ""
55 text: root._sourceTable.securityWarning
56 warning: true
57 }
58
59 GPSNoteLabel {
60 visible: root._sourceTable.fetchStatus === NTRIPSourceTableController.Error
61 text: root._sourceTable.fetchError
62 warning: true
63 }
64
65 NTRIPMountpointList {
66 objectName: "ntripMountpointList"
67 Layout.fillWidth: true
68 enabled: !root._isActive
69 visible: count > 0
70 model: root._sourceTable.mountpointModel
71 selectedMountpoint: root._ntrip.ntripMountpoint.rawValue
72 onMountpointSelected: (mountpoint) => { root._ntrip.ntripMountpoint.rawValue = mountpoint }
73 }
74}