5import QGroundControl.Controls
6import QGroundControl.FactControls
9 heading: qsTr("NMEA External GPS")
10 Layout.fillWidth: true
11 visible: !ScreenTools.isMobile
12 && QGroundControl.settingsManager.autoConnectSettings.nmeaSource.userVisible
13 && QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.userVisible
14 && _locationType !== RemoteIDSettings.LocationType.TAKEOFF
16 property int _locationType: QGroundControl.settingsManager.remoteIDSettings.locationType.value
18 readonly property var _autoConnectSettings: QGroundControl.settingsManager.autoConnectSettings
19 readonly property bool _serialSource: _autoConnectSettings.nmeaSource.rawValue === AutoConnectSettings.NmeaSourceSerial
21 LabelledFactComboBox {
23 fact: _autoConnectSettings.nmeaSource
24 Layout.fillWidth: true
30 Layout.fillWidth: true
31 visible: _serialSource
35 onActivated: (index) => {
36 if (index !== -1 && QGroundControl.linkManager.serialPorts.length !== 0) {
37 _autoConnectSettings.autoConnectNmeaPort.value = comboBox.textAt(index);
40 Component.onCompleted: {
41 if (QGroundControl.linkManager.serialPorts.length === 0) {
42 nmeaPortCombo.model.append({text: qsTr("<none available>")})
44 for (var i in QGroundControl.linkManager.serialPorts) {
45 nmeaPortCombo.model.append({text: QGroundControl.linkManager.serialPorts[i]})
48 var index = nmeaPortCombo.comboBox.find(_autoConnectSettings.autoConnectNmeaPort.valueString);
49 nmeaPortCombo.currentIndex = index;
55 label: qsTr("Baudrate")
56 Layout.fillWidth: true
57 visible: _serialSource
58 model: QGroundControl.linkManager.serialBaudRates
60 onActivated: (index) => {
62 QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.value = parseInt(comboBox.textAt(index));
65 Component.onCompleted: {
66 var index = nmeaBaudCombo.comboBox.find(QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaBaud.valueString);
67 nmeaBaudCombo.currentIndex = index;
71 LabelledFactTextField {
72 label: qsTr("UDP Port")
73 fact: QGroundControl.settingsManager.autoConnectSettings.nmeaUdpPort
74 Layout.fillWidth: true
75 visible: _autoConnectSettings.nmeaSource.rawValue === AutoConnectSettings.NmeaSourceUdp