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:
parent
9ece824971
commit
9c9f53813a
5 changed files with 29 additions and 0 deletions
|
@ -4001,6 +4001,12 @@
|
|||
"failsafeGpsRescueItemDescentDistance": {
|
||||
"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": {
|
||||
"message": "Ground speed (meters/second)"
|
||||
},
|
||||
|
|
|
@ -570,6 +570,7 @@ const FC = {
|
|||
descendRate: 0,
|
||||
allowArmingWithoutFix: 0,
|
||||
altitudeMode: 0,
|
||||
minRescueDth: 0,
|
||||
};
|
||||
|
||||
this.RXFAIL_CONFIG = [];
|
||||
|
|
|
@ -453,6 +453,9 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
|||
FC.GPS_RESCUE.allowArmingWithoutFix = 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;
|
||||
case MSPCodes.MSP_RSSI_CONFIG:
|
||||
FC.RSSI_CONFIG.channel = data.readU8();
|
||||
|
@ -1818,6 +1821,9 @@ MspHelper.prototype.crunch = function(code) {
|
|||
.push8(FC.GPS_RESCUE.allowArmingWithoutFix)
|
||||
.push8(FC.GPS_RESCUE.altitudeMode);
|
||||
}
|
||||
if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_44)) {
|
||||
buffer.push16(FC.GPS_RESCUE.minRescueDth);
|
||||
}
|
||||
break;
|
||||
case MSPCodes.MSP_SET_RSSI_CONFIG:
|
||||
buffer.push8(FC.RSSI_CONFIG.channel);
|
||||
|
|
|
@ -316,6 +316,12 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
|
|||
$('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 {
|
||||
// GPS Rescue Parameters not available
|
||||
$('.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());
|
||||
}
|
||||
|
||||
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() {
|
||||
MSP.send_message(MSPCodes.MSP_SET_FAILSAFE_CONFIG, mspHelper.crunch(MSPCodes.MSP_SET_FAILSAFE_CONFIG), false, save_rxfail_config);
|
||||
}
|
||||
|
|
|
@ -133,6 +133,12 @@
|
|||
i18n="failsafeGpsRescueItemDescentDistance"></span>
|
||||
</label>
|
||||
</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">
|
||||
<label> <input type="number" name="gps_rescue_ground_speed" min="0.30" max="30.00" step="0.01"/> <span
|
||||
i18n="failsafeGpsRescueItemGroundSpeed"></span>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue