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

Add more parameters to GPS Rescue

This commit is contained in:
Miguel Angel Mulero Martinez 2019-11-07 15:27:15 +01:00
parent e69c904730
commit 1672a44dc2
7 changed files with 92 additions and 11 deletions

View file

@ -312,6 +312,19 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
$('input[name="gps_rescue_throttle_hover"]').val(GPS_RESCUE.throttleHover);
$('input[name="gps_rescue_min_sats"]').val(GPS_RESCUE.minSats);
$('select[name="gps_rescue_sanity_checks"]').val(GPS_RESCUE.sanityChecks);
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
$('input[name="gps_rescue_ascend_rate"]').val((GPS_RESCUE.ascendRate / 100).toFixed(2));
$('input[name="gps_rescue_descend_rate"]').val((GPS_RESCUE.descendRate / 100).toFixed(2));
$('input[name="gps_rescue_allow_arming_without_fix"]').prop('checked', GPS_RESCUE.allowArmingWithoutFix > 0);
$('select[name="gps_rescue_altitude_mode"]').val(GPS_RESCUE.altitudeMode);
} else {
$('input[name="gps_rescue_ascend_rate"]').closest('.number').hide();
$('input[name="gps_rescue_descend_rate"]').closest('.number').hide();
$('input[name="gps_rescue_allow_arming_without_fix"]').closest('.number').hide();
$('select[name="gps_rescue_altitude_mode"]').closest('.number').hide();
}
} else {
// GPS Rescue Parameters not available
$('.pro4 > .proceduresettings').hide();
@ -366,6 +379,13 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
GPS_RESCUE.sanityChecks = $('select[name="gps_rescue_sanity_checks"]').val();
}
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
GPS_RESCUE.ascendRate = $('input[name="gps_rescue_ascend_rate"]').val() * 100;
GPS_RESCUE.descendRate = $('input[name="gps_rescue_descend_rate"]').val() * 100;
GPS_RESCUE.allowArmingWithoutFix = $('input[name="gps_rescue_allow_arming_without_fix"]').prop('checked') ? 1 : 0;
GPS_RESCUE.altitudeMode = parseInt($('select[name="gps_rescue_altitude_mode"]').val());
}
function save_failssafe_config() {
MSP.send_message(MSPCodes.MSP_SET_FAILSAFE_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FAILSAFE_CONFIG), false, save_rxfail_config);
}