1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-16 21:05:30 +03:00

Add GPS rescue min dth

This commit is contained in:
Hans Christian Olaussen 2021-04-11 16:21:04 +02:00
parent 9ece824971
commit 9c9f53813a
5 changed files with 29 additions and 0 deletions

View file

@ -4001,6 +4001,12 @@
"failsafeGpsRescueItemDescentDistance": { "failsafeGpsRescueItemDescentDistance": {
"message": "Descent distance (meters)" "message": "Descent distance (meters)"
}, },
"failsafeGpsRescueItemMinDth": {
"message": "Minimum distance to home (meters)"
},
"failsafeGpsRescueItemMinDthHelp": {
"message": "The minimum distance to home needed for GPS rescue to activate"
},
"failsafeGpsRescueItemGroundSpeed": { "failsafeGpsRescueItemGroundSpeed": {
"message": "Ground speed (meters/second)" "message": "Ground speed (meters/second)"
}, },

View file

@ -570,6 +570,7 @@ const FC = {
descendRate: 0, descendRate: 0,
allowArmingWithoutFix: 0, allowArmingWithoutFix: 0,
altitudeMode: 0, altitudeMode: 0,
minRescueDth: 0,
}; };
this.RXFAIL_CONFIG = []; this.RXFAIL_CONFIG = [];

View file

@ -453,6 +453,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
FC.GPS_RESCUE.allowArmingWithoutFix = data.readU8(); FC.GPS_RESCUE.allowArmingWithoutFix = data.readU8();
FC.GPS_RESCUE.altitudeMode = data.readU8(); FC.GPS_RESCUE.altitudeMode = data.readU8();
} }
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
FC.GPS_RESCUE.minRescueDth = data.readU16();
}
break; break;
case MSPCodes.MSP_RSSI_CONFIG: case MSPCodes.MSP_RSSI_CONFIG:
FC.RSSI_CONFIG.channel = data.readU8(); FC.RSSI_CONFIG.channel = data.readU8();
@ -1818,6 +1821,9 @@ MspHelper.prototype.crunch = function(code) {
.push8(FC.GPS_RESCUE.allowArmingWithoutFix) .push8(FC.GPS_RESCUE.allowArmingWithoutFix)
.push8(FC.GPS_RESCUE.altitudeMode); .push8(FC.GPS_RESCUE.altitudeMode);
} }
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
buffer.push16(FC.GPS_RESCUE.minRescueDth);
}
break; break;
case MSPCodes.MSP_SET_RSSI_CONFIG: case MSPCodes.MSP_SET_RSSI_CONFIG:
buffer.push8(FC.RSSI_CONFIG.channel); buffer.push8(FC.RSSI_CONFIG.channel);

View file

@ -316,6 +316,12 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
$('select[name="gps_rescue_altitude_mode"]').closest('.number').hide(); $('select[name="gps_rescue_altitude_mode"]').closest('.number').hide();
} }
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
$('input[name="gps_rescue_min_dth"]').val(FC.GPS_RESCUE.minRescueDth);
} else {
$('input[name="gps_rescue_min_dth"]').closest('.number').hide();
}
} else { } else {
// GPS Rescue Parameters not available // GPS Rescue Parameters not available
$('.pro4 > .proceduresettings').hide(); $('.pro4 > .proceduresettings').hide();
@ -377,6 +383,10 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
FC.GPS_RESCUE.altitudeMode = parseInt($('select[name="gps_rescue_altitude_mode"]').val()); FC.GPS_RESCUE.altitudeMode = parseInt($('select[name="gps_rescue_altitude_mode"]').val());
} }
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
FC.GPS_RESCUE.minRescueDth = $('input[name="gps_rescue_min_dth"]').val();
}
function save_failssafe_config() { function save_failssafe_config() {
MSP.send_message(MSPCodes.MSP_SET_FAILSAFE_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FAILSAFE_CONFIG), false, save_rxfail_config); MSP.send_message(MSPCodes.MSP_SET_FAILSAFE_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FAILSAFE_CONFIG), false, save_rxfail_config);
} }

View file

@ -133,6 +133,12 @@
i18n="failsafeGpsRescueItemDescentDistance"></span> i18n="failsafeGpsRescueItemDescentDistance"></span>
</label> </label>
</div> </div>
<div class="number">
<label> <input type="number" name="gps_rescue_min_dth" min="50" max="1000" /> <span
i18n="failsafeGpsRescueItemMinDth"></span>
</label>
<div class="helpicon cf_tip" i18n_title="failsafeGpsRescueItemMinDthHelp"></div>
</div>
<div class="number"> <div class="number">
<label> <input type="number" name="gps_rescue_ground_speed" min="0.30" max="30.00" step="0.01"/> <span <label> <input type="number" name="gps_rescue_ground_speed" min="0.30" max="30.00" step="0.01"/> <span
i18n="failsafeGpsRescueItemGroundSpeed"></span> i18n="failsafeGpsRescueItemGroundSpeed"></span>