diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml index 2a906c2cc44f64d193a255b512126ac86226936a..b4b18fa45c7a16236f19573ef1967bd4b9dbadc1 100644 --- a/src/ui/preferences/GeneralSettings.qml +++ b/src/ui/preferences/GeneralSettings.qml @@ -53,6 +53,9 @@ QGCView { property bool _isTCP: _isGst && _videoSource === QGroundControl.settingsManager.videoSettings.tcpVideoSource property bool _isMPEGTS: _isGst && _videoSource === QGroundControl.settingsManager.videoSettings.mpegtsVideoSource + property string gpsDisabled: "Disabled" + property string gpsUdpPort: "UDP Port" + readonly property real _internalWidthRatio: 0.8 QGCPalette { id: qgcPal } @@ -505,7 +508,6 @@ QGCView { Layout.preferredWidth: _comboFieldWidth model: ListModel { - ListElement { text: "disabled" } } onActivated: { @@ -514,18 +516,26 @@ QGCView { } } Component.onCompleted: { + model.append({text: gpsDisabled}) + model.append({text: gpsUdpPort}) + for (var i in QGroundControl.linkManager.serialPorts) { nmeaPortCombo.model.append({text:QGroundControl.linkManager.serialPorts[i]}) } var index = nmeaPortCombo.find(QGroundControl.settingsManager.autoConnectSettings.autoConnectNmeaPort.valueString); nmeaPortCombo.currentIndex = index; + if (QGroundControl.linkManager.serialPorts.length === 0) { + nmeaPortCombo.model.append({text: "Serial "}) + } } } QGCLabel { + visible: nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled text: qsTr("NMEA GPS Baudrate") } QGCComboBox { + visible: nmeaPortCombo.currentText !== gpsUdpPort && nmeaPortCombo.currentText !== gpsDisabled id: nmeaBaudCombo Layout.preferredWidth: _comboFieldWidth model: [4800, 9600, 19200, 38400, 57600, 115200] @@ -540,6 +550,16 @@ QGCView { nmeaBaudCombo.currentIndex = index; } } + + QGCLabel { + text: qsTr("NMEA stream UDP port") + visible: nmeaPortCombo.currentText === gpsUdpPort + } + FactTextField { + visible: nmeaPortCombo.currentText === gpsUdpPort + Layout.preferredWidth: _valueFieldWidth + fact: QGroundControl.settingsManager.autoConnectSettings.nmeaUdpPort + } } } }