Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,18 @@

- name: Install apt packages (Linux)
if: runner.os == 'Linux'
shell: bash
# Retry: a slow apt mirror can stall the download past the job timeout; fast-fail and retry.
uses: nick-fields/retry@v4

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow or composite action Medium

Unpinned 3rd party Action 'action.yml' step
Uses Step
uses 'nick-fields/retry' with ref 'v4', not a pinned commit hash
env:
APT_PACKAGES: ${{ steps.linux-deps.outputs.packages }}
run: |
sudo apt-get -o Acquire::Retries=3 update -qq
# shellcheck disable=SC2086
sudo apt-get -o Acquire::Retries=3 install -y --no-install-recommends $APT_PACKAGES
with:
timeout_minutes: 20
max_attempts: 3
shell: bash
command: |
sudo apt-get -o Acquire::Retries=3 update -qq
# shellcheck disable=SC2086
sudo apt-get -o Acquire::Retries=3 install -y --no-install-recommends $APT_PACKAGES

- name: Fix apt alternatives (Linux)
if: runner.os == 'Linux'
Expand Down
2 changes: 1 addition & 1 deletion src/AppSettings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ qt_add_qml_module(AppSettingsModule
MockLink.qml
MockLinkSettings.qml
NmeaGpsSettings.qml
NtripConnectionStatus.qml
NtripConnectionSettings.qml
NtripMountpointBrowser.qml
NtripServerSettings.qml
OfflineMapEditor.qml
Expand Down
33 changes: 33 additions & 0 deletions src/AppSettings/NtripConnectionSettings.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import QtQuick
import QtQuick.Layouts

import QGroundControl
import QGroundControl.Controls
import QGroundControl.FactControls
import QGroundControl.GPS.NTRIP

SettingsGroupLayout {
id: root

Layout.fillWidth: true
heading: qsTr("Connection")
visible: _ntrip.userVisible

property var _ntrip: QGroundControl.settingsManager.ntripSettings
property Fact _enabled: _ntrip.ntripServerConnectEnabled
property var _ntripMgr: QGroundControl.ntripManager
property bool _isActive: _enabled.rawValue
property bool _hasHost: _ntrip.ntripServerHostAddress.rawValue !== ""

NTRIPConnectionStatusRow {
Layout.fillWidth: true
ntripManager: root._ntripMgr
canConnect: root._isActive || root._hasHost
onClicked: root._enabled.rawValue = !root._isActive
}

NTRIPConnectionStatus {
Layout.fillWidth: true
rtcmMavlink: root._ntripMgr ? root._ntripMgr.rtcmMavlink : null
}
}
99 changes: 0 additions & 99 deletions src/AppSettings/NtripConnectionStatus.qml

This file was deleted.

97 changes: 17 additions & 80 deletions src/AppSettings/NtripMountpointBrowser.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import QtQuick.Layouts
import QGroundControl
import QGroundControl.Controls
import QGroundControl.FactControls
import QGroundControl.GPS.NTRIP

SettingsGroupLayout {
id: root

Layout.fillWidth: true
heading: qsTr("Mountpoint")
visible: _ntrip.ntripMountpoint.userVisible
Expand All @@ -25,106 +28,40 @@ SettingsGroupLayout {

LabelledFactTextField {
Layout.fillWidth: true
textFieldPreferredWidth: _textFieldWidth
textFieldPreferredWidth: root._textFieldWidth
label: fact.shortDescription
fact: _ntrip.ntripMountpoint
enabled: !_isActive
fact: root._ntrip.ntripMountpoint
enabled: !root._isActive
}

QGCButton {
text: qsTr("Browse")
enabled: !_isActive && _hasHost &&
_ntripMgr.mountpointFetchStatus !== NTRIPManager.FetchInProgress
onClicked: _ntripMgr.fetchMountpoints()
enabled: !root._isActive && root._hasHost &&
root._ntripMgr.sourceTableController.fetchStatus !== NTRIPSourceTableController.InProgress
onClicked: root._ntripMgr.fetchMountpoints()
}
}

QGCLabel {
Layout.fillWidth: true
visible: _ntripMgr.mountpointFetchStatus === NTRIPManager.FetchInProgress
visible: root._ntripMgr.sourceTableController.fetchStatus === NTRIPSourceTableController.InProgress
text: qsTr("Fetching mountpoints…")
color: qgcPal.colorOrange
}

QGCLabel {
Layout.fillWidth: true
visible: _ntripMgr.mountpointFetchStatus === NTRIPManager.FetchError
text: _ntripMgr.mountpointFetchError
visible: root._ntripMgr.sourceTableController.fetchStatus === NTRIPSourceTableController.Error
text: root._ntripMgr.sourceTableController.fetchError
color: qgcPal.colorRed
wrapMode: Text.WordWrap
}

QGCListView {
NTRIPMountpointList {
Layout.fillWidth: true
Layout.preferredHeight: Math.min(contentHeight, ScreenTools.defaultFontPixelHeight * 20)
visible: _ntripMgr.mountpointModel && _ntripMgr.mountpointModel.count > 0
model: _ntripMgr.mountpointModel
spacing: ScreenTools.defaultFontPixelHeight * 0.25

delegate: Rectangle {
required property int index
required property var object

width: ListView.view.width
height: mountRow.height + ScreenTools.defaultFontPixelHeight * 0.5
radius: ScreenTools.defaultFontPixelHeight * 0.25
color: {
if (object.mountpoint === _ntrip.ntripMountpoint.rawValue)
return qgcPal.buttonHighlight
return index % 2 === 0 ? qgcPal.windowShade : qgcPal.window
}

RowLayout {
id: mountRow
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.margins: ScreenTools.defaultFontPixelWidth

ColumnLayout {
Layout.fillWidth: true
spacing: 0

RowLayout {
spacing: ScreenTools.defaultFontPixelWidth

QGCLabel {
text: object.mountpoint
font.bold: true
color: object.mountpoint === _ntrip.ntripMountpoint.rawValue
? qgcPal.buttonHighlightText : qgcPal.text
}
QGCLabel {
visible: object.mountpoint === _ntrip.ntripMountpoint.rawValue
text: qsTr("(selected)")
font.pointSize: ScreenTools.smallFontPointSize
color: qgcPal.buttonHighlightText
}
}

QGCLabel {
text: {
var parts = []
if (object.format) parts.push(object.format)
if (object.navSystem) parts.push(object.navSystem)
if (object.country) parts.push(object.country)
if (object.bitrate > 0) parts.push(object.bitrate + " bps")
if (object.distanceKm >= 0) parts.push(object.distanceKm.toFixed(1) + " km")
return parts.join(" · ")
}
font.pointSize: ScreenTools.smallFontPointSize
color: object.mountpoint === _ntrip.ntripMountpoint.rawValue
? qgcPal.buttonHighlightText : qgcPal.colorGrey
}
}

QGCButton {
text: object.mountpoint === _ntrip.ntripMountpoint.rawValue
? qsTr("Selected") : qsTr("Select")
enabled: object.mountpoint !== _ntrip.ntripMountpoint.rawValue
onClicked: _ntripMgr.selectMountpoint(object.mountpoint)
}
}
}
visible: root._ntripMgr.sourceTableController.mountpointModel && root._ntripMgr.sourceTableController.mountpointModel.count > 0
model: root._ntripMgr.sourceTableController.mountpointModel
selectedMountpoint: root._ntrip.ntripMountpoint.rawValue
onMountpointSelected: (mountpoint) => root._ntripMgr.selectMountpoint(mountpoint)
}
}
8 changes: 8 additions & 0 deletions src/AppSettings/NtripServerSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,12 @@ SettingsGroupLayout {
visible: fact.userVisible
enabled: !_isActive
}

FactCheckBoxSlider {
Layout.fillWidth: true
text: fact.shortDescription
fact: _ntrip.ntripAllowSelfSignedCerts
visible: fact.userVisible
enabled: !_isActive && _ntrip.ntripUseTls.rawValue
}
}
20 changes: 18 additions & 2 deletions src/AppSettings/pages/NTRIP.SettingsUI.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"fileType": "SettingsUI",
"groups": [
{
"component": "NtripConnectionStatus",
"sectionName": "Connection Status",
"component": "NtripConnectionSettings",
"sectionName": "Connection",
"keywords": [
"ntrip",
"rtk",
Expand Down Expand Up @@ -35,6 +35,18 @@
"stream"
]
},
{
"heading": "GGA Position Reporting",
"keywords": ["gga", "vrs", "nmea", "position", "network rtk", "ntrip"],
"controls": [
{
"setting": "ntripSettings.ntripGgaPositionSource"
},
{
"setting": "ntripSettings.ntripGgaIntervalSec"
}
]
},
{
"heading": "Options",
"keywords": ["rtcm", "whitelist", "message filter", "ntrip"],
Expand Down Expand Up @@ -72,6 +84,10 @@
{
"setting": "ntripSettings.rtcmUdpInputPort",
"enableWhen": "QGroundControl.settingsManager.ntripSettings.rtcmUdpInputEnabled.rawValue"
},
{
"setting": "ntripSettings.rtcmUdpValidate",
"enableWhen": "QGroundControl.settingsManager.ntripSettings.rtcmUdpInputEnabled.rawValue"
}
]
}
Expand Down
8 changes: 2 additions & 6 deletions src/GPS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
# GPS/GNSS positioning and RTK support
# ============================================================================

# NTRIP + RTCMMavlink are network/MAVLink-only — build even when QGC_NO_SERIAL_LINK skips the rest.
target_sources(${CMAKE_PROJECT_NAME}
PRIVATE
RTCMMavlink.cc
RTCMMavlink.h
)
# RTCM + NTRIP are network/MAVLink-only — build even when QGC_NO_SERIAL_LINK skips the rest.
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE Qt6::Core)
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

add_subdirectory(RTCM)
add_subdirectory(NTRIP)

# Everything below uses QSerialPort or spawns a serial-attached GPS process.
Expand Down
Loading
Loading