mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-26 01:35:28 +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:
parent
8f73ccc6d4
commit
00e10be226
2 changed files with 13 additions and 1 deletions
|
@ -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."
|
"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": {
|
"failsafeGpsRescueItemReturnAltitude": {
|
||||||
"message": "Return altitude (meters) - <strong>only applies in Fixed Altitude mode</strong>"
|
"message": "Return altitude (meters)"
|
||||||
},
|
},
|
||||||
"failsafeGpsRescueItemAscendRate": {
|
"failsafeGpsRescueItemAscendRate": {
|
||||||
"message": "Ascend rate (meters/second)"
|
"message": "Ascend rate (meters/second)"
|
||||||
|
|
|
@ -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
|
// Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
|
||||||
$("#failsafeGpsRescueItemAltitudeSelect").sortSelect();
|
$("#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
|
// Introduced in 1.43
|
||||||
$('input[name="gps_rescue_ascend_rate"]').val((FC.GPS_RESCUE.ascendRate / 100).toFixed(1));
|
$('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));
|
$('input[name="gps_rescue_descend_rate"]').val((FC.GPS_RESCUE.descendRate / 100).toFixed(1));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue