diff --git a/locales/en/messages.json b/locales/en/messages.json index 85232d012c..459cc92ead 100755 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -2839,6 +2839,9 @@ "gpsDistToHome": { "message": "Dist to Home:" }, + "gpsPositionalDop": { + "message": "Positional DOP:" + }, "gpsSignalStrHead": { "message": "GPS Signal Strength" }, diff --git a/src/js/VirtualFC.js b/src/js/VirtualFC.js index 43621a652d..6d19b185d3 100644 --- a/src/js/VirtualFC.js +++ b/src/js/VirtualFC.js @@ -260,6 +260,7 @@ const sampleGpsData = { "alt": 0, "speed": 0, "ground_course": 1337, + "positionalDop": 0, "distanceToHome": 0, "directionToHome": 0, "update": 0, diff --git a/src/js/fc.js b/src/js/fc.js index 5417164c8f..21c34a97c8 100644 --- a/src/js/fc.js +++ b/src/js/fc.js @@ -306,6 +306,7 @@ const FC = { alt: 0, speed: 0, ground_course: 0, + positionalDop: 0, distanceToHome: 0, directionToHome: 0, update: 0, diff --git a/src/js/msp/MSPHelper.js b/src/js/msp/MSPHelper.js index 12e64f1ff0..47784f9f92 100644 --- a/src/js/msp/MSPHelper.js +++ b/src/js/msp/MSPHelper.js @@ -295,6 +295,9 @@ MspHelper.prototype.process_data = function(dataHandler) { FC.GPS_DATA.alt = data.readU16(); FC.GPS_DATA.speed = data.readU16(); FC.GPS_DATA.ground_course = data.readU16(); + if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_46)) { + FC.GPS_DATA.positionalDop = data.readU16(); + } break; case MSPCodes.MSP_COMP_GPS: FC.GPS_DATA.distanceToHome = data.readU16(); diff --git a/src/js/tabs/gps.js b/src/js/tabs/gps.js index f7343f2f51..4932fd8161 100644 --- a/src/js/tabs/gps.js +++ b/src/js/tabs/gps.js @@ -242,6 +242,13 @@ 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)}`); + } else { + $('.GPS_info td.positionalDop').parent().hide(); + } + // Update GPS Signal Strengths const eSsTable = $('div.GPS_signal_strength table'); diff --git a/src/tabs/gps.html b/src/tabs/gps.html index 645cc9b020..1c43d347db 100755 --- a/src/tabs/gps.html +++ b/src/tabs/gps.html @@ -118,6 +118,10 @@ + + + +