From 1cd352efe2c46406e55a34241b2d68c6d8ac9473 Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Thu, 4 Apr 2024 13:24:59 +0200 Subject: [PATCH] Update message --- locales/en/messages.json | 2 +- src/js/tabs/gps.js | 65 ++++++++++++++++++++++------------------ 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/locales/en/messages.json b/locales/en/messages.json index 64976435a6d..9c48caf3f17 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -2853,7 +2853,7 @@ "message": "Signal Strength" }, "gpsSignalLost": { - "message": "It takes a few seconds for the GNSS unit to be recognized by the flight controller. The GPS icon will appear in red color when it is recognized and in yellow color when we have established a GPS fix.
If the icon does not light up, please check your wiring and configuration. Some units must power the device using a battery and in that case the flight controller must be restarted after power is applied to be recognized." + "message": "Connecting...

The GPS icon lights up when Betaflight is connected to a GPS module. This usually takes a couple of seconds.
It will be red at first, then change to yellow when it gets a 3D fix.
If the GPS icon does not light up, check your wiring and configuration, and confirm that the GPS module is receiving power.
The CLI 'status' command provides more information about the state of the GPS connection." }, "gpsSignalGnssId": { "message": "Gnss ID" diff --git a/src/js/tabs/gps.js b/src/js/tabs/gps.js index 9aaf28375ff..a2c4366a2ed 100644 --- a/src/js/tabs/gps.js +++ b/src/js/tabs/gps.js @@ -203,6 +203,13 @@ gps.initialize = async function (callback) { $('div.mag_declination').hide(); } + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) { + const positionalDop = FC.GPS_DATA.positionalDop / 100; + $('.GPS_info td.positionalDop').text(`${positionalDop.toFixed(2)}`); + } else { + $('.GPS_info td.positionalDop').parent().hide(); + } + const { mapView, iconStyleMag, @@ -214,6 +221,10 @@ gps.initialize = async function (callback) { // End GPS Configuration + const gnssArray = ['GPS', 'SBAS', 'Galileo', 'BeiDou', 'IMES', 'QZSS', 'Glonass']; + const qualityArray = ['gnssQualityNoSignal', 'gnssQualitySearching', 'gnssQualityAcquired', 'gnssQualityUnusable', 'gnssQualityLocked', 'gnssQualityFullyLocked', 'gnssQualityFullyLocked', 'gnssQualityFullyLocked']; + const usedArray = ['gnssUsedUnused', 'gnssUsedUsed']; + // GPS Signal Strengths function updateSignalStrengths() { const eSsTable = $('div.GPS_signal_strength table'); @@ -237,37 +248,9 @@ gps.initialize = async function (callback) { `); - if (FC.GPS_DATA.chn.length <= 16) { - // Legacy code path: old BF firmware or old ublox module - for (let i = 0; i < FC.GPS_DATA.chn.length; i++) { - eSsTable.append(` - - - - ${FC.GPS_DATA.svid[i]} - - ${FC.GPS_DATA.quality[i]} - - `); - } - // Cleanup the rest of the table - for (let i = FC.GPS_DATA.chn.length; i < 32; i++) { - eSsTable.append(` - - - - - - - - - `); - } - } else { + if (FC.GPS_DATA.chn.length > 16) { // M8N/M9N on newer firmware - const gnssArray = ['GPS', 'SBAS', 'Galileo', 'BeiDou', 'IMES', 'QZSS', 'Glonass']; - const qualityArray = ['gnssQualityNoSignal', 'gnssQualitySearching', 'gnssQualityAcquired', 'gnssQualityUnusable', 'gnssQualityLocked', - 'gnssQualityFullyLocked', 'gnssQualityFullyLocked', 'gnssQualityFullyLocked']; - const usedArray = ['gnssUsedUnused', 'gnssUsedUsed']; - const maxUIChannels = 32; //the list in html can only show 32 channels but future firmware could send more let channels = Math.min(maxUIChannels, FC.GPS_DATA.chn.length) || 32; @@ -315,6 +298,30 @@ gps.initialize = async function (callback) { } eSsTable.append(`${rowContent}`); } + } else { + // Legacy code path: old BF firmware or old ublox module + for (let i = 0; i < FC.GPS_DATA.chn.length; i++) { + eSsTable.append(` + + - + ${FC.GPS_DATA.svid[i]} + + ${FC.GPS_DATA.quality[i]} + + `); + } + + // Cleanup the rest of the table + for (let i = FC.GPS_DATA.chn.length; i < 32; i++) { + eSsTable.append(` + + - + - + + + + `); + } } }