1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 16:25:22 +03:00

Dynamic “return altitude” field in GPS Rescue tab (#4308)

Dynamic GPS Rescue 'return altitude' field + removed unnecessary warning
This commit is contained in:
hntirgeam 2025-01-20 21:27:49 +01:00 committed by GitHub
parent 8f73ccc6d4
commit 00e10be226
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View file

@ -4794,7 +4794,7 @@
"message": "The distance the aircraft will climb, above the current altitude, when a rescue is initiated and the altitude mode is set to CURRENT Altitude; also added when in MAX Altitude mode."
},
"failsafeGpsRescueItemReturnAltitude": {
"message": "Return altitude (meters) - <strong>only applies in Fixed Altitude mode</strong>"
"message": "Return altitude (meters)"
},
"failsafeGpsRescueItemAscendRate": {
"message": "Ascend rate (meters/second)"

View file

@ -314,6 +314,18 @@ failsafe.initialize = function (callback) {
// Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
$("#failsafeGpsRescueItemAltitudeSelect").sortSelect();
// Show the return altitude input if the alt mode equals to FixedAlt
function showReturnAlt() {
let altitude_number_field = $('input[name="gps_rescue_return_altitude"]').closest(".number");
if ($("#failsafeGpsRescueItemAltitudeSelect").val() === "1") {
altitude_number_field.show();
} else {
altitude_number_field.hide();
}
}
showReturnAlt();
$("#failsafeGpsRescueItemAltitudeSelect").on("change", showReturnAlt);
// Introduced in 1.43
$('input[name="gps_rescue_ascend_rate"]').val((FC.GPS_RESCUE.ascendRate / 100).toFixed(1));
$('input[name="gps_rescue_descend_rate"]').val((FC.GPS_RESCUE.descendRate / 100).toFixed(1));