From c1bc967f810d4bde7f0fda48bb51abf37be7f2b7 Mon Sep 17 00:00:00 2001 From: Mark Haslinghuis Date: Sat, 3 Aug 2024 19:52:20 +0200 Subject: [PATCH] Update GPS Positional DOP using polling timer (#4106) --- src/js/tabs/gps.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/tabs/gps.js b/src/js/tabs/gps.js index b6d8058eb7..129e875035 100644 --- a/src/js/tabs/gps.js +++ b/src/js/tabs/gps.js @@ -201,10 +201,7 @@ 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 { + if (semver.lt(FC.CONFIG.apiVersion, API_VERSION_1_46)) { $('.GPS_info td.positionalDop').parent().hide(); } @@ -346,6 +343,11 @@ gps.initialize = async function (callback) { $('.GPS_info td.sats').text(FC.GPS_DATA.numSat); $('.GPS_info td.distToHome').text(`${FC.GPS_DATA.distanceToHome} m`); + 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)}`); + } + updateSignalStrengths(); let gpsFoundPosition = false;