5import QGroundControl.FactControls
6import QGroundControl.Controls
7import QGroundControl.NTRIP 1.0
10 property var _settingsManager: QGroundControl.settingsManager
11 property var _ntrip: _settingsManager.ntripSettings
12 property Fact _enabled: _ntrip.ntripServerConnectEnabled
15 Layout.fillWidth: true
16 heading: qsTr("NTRIP / RTK")
17 visible: _ntrip.visible
20 Layout.fillWidth: true
21 text: _enabled.shortDescription
23 visible: _enabled.visible
28 Layout.fillWidth: true
29 visible: _ntrip.ntripServerHostAddress.visible || _ntrip.ntripServerPort.visible ||
30 _ntrip.ntripUsername.visible || _ntrip.ntripPassword.visible ||
31 _ntrip.ntripMountpoint.visible || _ntrip.ntripWhitelist.visible ||
32 _ntrip.ntripUseSpartn.visible
33 enabled: _enabled.rawValue
37 Layout.fillWidth: true
38 Layout.minimumHeight: 30
42 return NTRIPManager ? (NTRIPManager.ntripStatus || "Disconnected") : "NTRIP Manager not available"
47 wrapMode: Text.WordWrap
50 if (!NTRIPManager) return qgcPal.text
51 var status = NTRIPManager.ntripStatus || ""
52 if (status.toLowerCase().includes("connected")) return qgcPal.colorGreen
53 if (status.toLowerCase().includes("connecting")) return qgcPal.colorOrange
54 if (status.toLowerCase().includes("error") || status.toLowerCase().includes("failed")) return qgcPal.colorRed
62 LabelledFactTextField {
63 Layout.fillWidth: true
64 label: _ntrip.ntripServerHostAddress.shortDescription
65 fact: _ntrip.ntripServerHostAddress
66 visible: _ntrip.ntripServerHostAddress.visible
67 textFieldPreferredWidth: ScreenTools.defaultFontPixelWidth * 60
70 LabelledFactTextField {
71 Layout.fillWidth: true
72 label: _ntrip.ntripServerPort.shortDescription
73 fact: _ntrip.ntripServerPort
74 visible: _ntrip.ntripServerPort.visible
75 textFieldPreferredWidth: ScreenTools.defaultFontPixelWidth * 20
78 LabelledFactTextField {
79 Layout.fillWidth: true
80 label: _ntrip.ntripUsername.shortDescription
81 fact: _ntrip.ntripUsername
82 visible: _ntrip.ntripUsername.visible
83 textFieldPreferredWidth: ScreenTools.defaultFontPixelWidth * 60
86 LabelledFactTextField {
87 Layout.fillWidth: true
88 label: _ntrip.ntripPassword.shortDescription
89 fact: _ntrip.ntripPassword
90 visible: _ntrip.ntripPassword.visible
91 textField.echoMode: TextInput.Password
92 textFieldPreferredWidth: ScreenTools.defaultFontPixelWidth * 60
95 LabelledFactTextField {
96 Layout.fillWidth: true
97 label: _ntrip.ntripMountpoint.shortDescription
98 fact: _ntrip.ntripMountpoint
99 visible: _ntrip.ntripMountpoint.visible
100 textFieldPreferredWidth: ScreenTools.defaultFontPixelWidth * 40
103 LabelledFactTextField {
104 Layout.fillWidth: true
105 label: _ntrip.ntripWhitelist.shortDescription
106 fact: _ntrip.ntripWhitelist
107 visible: _ntrip.ntripWhitelist.visible
108 textFieldPreferredWidth: ScreenTools.defaultFontPixelWidth * 40
112 Layout.fillWidth: true
113 text: _ntrip.ntripUseSpartn.shortDescription
114 fact: _ntrip.ntripUseSpartn
115 visible: _ntrip.ntripUseSpartn.visible