mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-15 20:35:23 +03:00
Add more parameters to GPS Rescue
This commit is contained in:
parent
e69c904730
commit
1672a44dc2
7 changed files with 92 additions and 11 deletions
|
@ -3649,10 +3649,31 @@
|
||||||
"failsafeGpsRescueItemThrottleHover": {
|
"failsafeGpsRescueItemThrottleHover": {
|
||||||
"message": "Throttle hover"
|
"message": "Throttle hover"
|
||||||
},
|
},
|
||||||
|
"failsafeGpsRescueItemAscendRate": {
|
||||||
|
"message": "Ascend rate (meters/second)"
|
||||||
|
},
|
||||||
|
"failsafeGpsRescueItemDescendRate": {
|
||||||
|
"message": "Descend rate (meters/second)"
|
||||||
|
},
|
||||||
"failsafeGpsRescueItemMinSats": {
|
"failsafeGpsRescueItemMinSats": {
|
||||||
"message": "Minimum satellites"
|
"message": "Minimum satellites"
|
||||||
},
|
},
|
||||||
"failsafeGpsRescueItemSanityChecks": {
|
"failsafeGpsRescueItemAllowArmingWithoutFix": {
|
||||||
|
"message": "Allow arming without fix - <span class=\"message-negative\">WARNING: the GPS Rescue will not be available</span>"
|
||||||
|
},
|
||||||
|
"failsafeGpsRescueItemAltitudeMode": {
|
||||||
|
"message": "Altitude mode"
|
||||||
|
},
|
||||||
|
"failsafeGpsRescueItemAltitudeModeMaxAlt": {
|
||||||
|
"message": "Maximum altitude"
|
||||||
|
},
|
||||||
|
"failsafeGpsRescueItemAltitudeModeFixedAlt": {
|
||||||
|
"message": "Fixed altitude"
|
||||||
|
},
|
||||||
|
"failsafeGpsRescueItemAltitudeModeCurrentAlt": {
|
||||||
|
"message": "Current altitude"
|
||||||
|
},
|
||||||
|
"failsafeGpsRescueItemSanityChecks": {
|
||||||
"message": "Sanity checks"
|
"message": "Sanity checks"
|
||||||
},
|
},
|
||||||
"failsafeGpsRescueItemSanityChecksOff": {
|
"failsafeGpsRescueItemSanityChecksOff": {
|
||||||
|
|
|
@ -140,8 +140,8 @@ input[type="number"]::-webkit-inner-spin-button {
|
||||||
}
|
}
|
||||||
|
|
||||||
.message-negative {
|
.message-negative {
|
||||||
color: var(--error);
|
color: var(--error) !important;
|
||||||
font-weight: bold;
|
font-weight: bold !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.headerbar {
|
.headerbar {
|
||||||
|
|
|
@ -41,6 +41,10 @@
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tab-failsafe .number .switchery {
|
||||||
|
margin-right: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
.tab-failsafe .number input:disabled {
|
.tab-failsafe .number input:disabled {
|
||||||
background-color: #ececec;
|
background-color: #ececec;
|
||||||
}
|
}
|
||||||
|
@ -277,12 +281,6 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-failsafe .selectSwitchMode {
|
|
||||||
clear: left;
|
|
||||||
width: 100%;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tab-failsafe .switchMode {
|
.tab-failsafe .switchMode {
|
||||||
border: 1px solid var(--subtleAccent);
|
border: 1px solid var(--subtleAccent);
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
|
|
@ -502,6 +502,10 @@ var FC = {
|
||||||
throttleHover: 0,
|
throttleHover: 0,
|
||||||
sanityChecks: 0,
|
sanityChecks: 0,
|
||||||
minSats: 0,
|
minSats: 0,
|
||||||
|
ascendRate: 0,
|
||||||
|
descendRate: 0,
|
||||||
|
allowArmingWithoutFix: 0,
|
||||||
|
altitudeMode: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
RXFAIL_CONFIG = [];
|
RXFAIL_CONFIG = [];
|
||||||
|
|
|
@ -435,6 +435,12 @@ MspHelper.prototype.process_data = function(dataHandler) {
|
||||||
GPS_RESCUE.throttleHover = data.readU16();
|
GPS_RESCUE.throttleHover = data.readU16();
|
||||||
GPS_RESCUE.sanityChecks = data.readU8();
|
GPS_RESCUE.sanityChecks = data.readU8();
|
||||||
GPS_RESCUE.minSats = data.readU8();
|
GPS_RESCUE.minSats = data.readU8();
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
|
||||||
|
GPS_RESCUE.ascendRate = data.readU16();
|
||||||
|
GPS_RESCUE.descendRate = data.readU16();
|
||||||
|
GPS_RESCUE.allowArmingWithoutFix = data.readU8();
|
||||||
|
GPS_RESCUE.altitudeMode = data.readU8();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSP_RSSI_CONFIG:
|
case MSPCodes.MSP_RSSI_CONFIG:
|
||||||
RSSI_CONFIG.channel = data.readU8();
|
RSSI_CONFIG.channel = data.readU8();
|
||||||
|
@ -1705,6 +1711,13 @@ MspHelper.prototype.crunch = function(code) {
|
||||||
.push16(GPS_RESCUE.throttleHover)
|
.push16(GPS_RESCUE.throttleHover)
|
||||||
.push8(GPS_RESCUE.sanityChecks)
|
.push8(GPS_RESCUE.sanityChecks)
|
||||||
.push8(GPS_RESCUE.minSats);
|
.push8(GPS_RESCUE.minSats);
|
||||||
|
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
|
||||||
|
buffer.push16(GPS_RESCUE.ascendRate)
|
||||||
|
.push16(GPS_RESCUE.descendRate)
|
||||||
|
.push8(GPS_RESCUE.allowArmingWithoutFix)
|
||||||
|
.push8(GPS_RESCUE.altitudeMode);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MSPCodes.MSP_SET_COMPASS_CONFIG:
|
case MSPCodes.MSP_SET_COMPASS_CONFIG:
|
||||||
buffer.push16(Math.round(COMPASS_CONFIG.mag_declination * 100));
|
buffer.push16(Math.round(COMPASS_CONFIG.mag_declination * 100));
|
||||||
|
|
|
@ -312,6 +312,19 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
|
||||||
$('input[name="gps_rescue_throttle_hover"]').val(GPS_RESCUE.throttleHover);
|
$('input[name="gps_rescue_throttle_hover"]').val(GPS_RESCUE.throttleHover);
|
||||||
$('input[name="gps_rescue_min_sats"]').val(GPS_RESCUE.minSats);
|
$('input[name="gps_rescue_min_sats"]').val(GPS_RESCUE.minSats);
|
||||||
$('select[name="gps_rescue_sanity_checks"]').val(GPS_RESCUE.sanityChecks);
|
$('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 {
|
} else {
|
||||||
// GPS Rescue Parameters not available
|
// GPS Rescue Parameters not available
|
||||||
$('.pro4 > .proceduresettings').hide();
|
$('.pro4 > .proceduresettings').hide();
|
||||||
|
@ -366,6 +379,13 @@ TABS.failsafe.initialize = function (callback, scrollPosition) {
|
||||||
GPS_RESCUE.sanityChecks = $('select[name="gps_rescue_sanity_checks"]').val();
|
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() {
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<div class="spacer_box_title" i18n="failsafeSwitchTitle"></div>
|
<div class="spacer_box_title" i18n="failsafeSwitchTitle"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="spacer_box">
|
<div class="spacer_box">
|
||||||
<div class="selectSwitchMode">
|
<div class="number">
|
||||||
<label>
|
<label>
|
||||||
<select class="switchMode" name="failsafe_switch_mode">
|
<select class="switchMode" name="failsafe_switch_mode">
|
||||||
<option value="0" i18n="failsafeSwitchOptionStage1"></option>
|
<option value="0" i18n="failsafeSwitchOptionStage1"></option>
|
||||||
|
@ -152,12 +152,37 @@
|
||||||
i18n="failsafeGpsRescueItemThrottleHover"></span>
|
i18n="failsafeGpsRescueItemThrottleHover"></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<label> <input type="number" name="gps_rescue_ascend_rate" min="1.00" max="25.00" step="0.01" /> <span
|
||||||
|
i18n="failsafeGpsRescueItemAscendRate"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<label> <input type="number" name="gps_rescue_descend_rate" min="1.00" max="5.00" step="0.01" /> <span
|
||||||
|
i18n="failsafeGpsRescueItemDescendRate"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<div class="number">
|
<div class="number">
|
||||||
<label> <input type="number" name="gps_rescue_min_sats" min="5" max="50" /> <span
|
<label> <input type="number" name="gps_rescue_min_sats" min="5" max="50" /> <span
|
||||||
i18n="failsafeGpsRescueItemMinSats"></span>
|
i18n="failsafeGpsRescueItemMinSats"></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="selectSwitchMode">
|
<div class="number">
|
||||||
|
<label> <input type="checkbox" name="gps_rescue_allow_arming_without_fix" class="toggle" /> <span
|
||||||
|
i18n="failsafeGpsRescueItemAllowArmingWithoutFix"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
|
<label>
|
||||||
|
<select class="switchMode" name="gps_rescue_altitude_mode">
|
||||||
|
<option value="0" i18n="failsafeGpsRescueItemAltitudeModeMaxAlt"></option>
|
||||||
|
<option value="1" i18n="failsafeGpsRescueItemAltitudeModeFixedAlt"></option>
|
||||||
|
<option value="2" i18n="failsafeGpsRescueItemAltitudeModeCurrentAlt"></option>
|
||||||
|
</select>
|
||||||
|
<span i18n="failsafeGpsRescueItemAltitudeMode"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="number">
|
||||||
<label>
|
<label>
|
||||||
<select class="switchMode" name="gps_rescue_sanity_checks">
|
<select class="switchMode" name="gps_rescue_sanity_checks">
|
||||||
<option value="0" i18n="failsafeGpsRescueItemSanityChecksOff"></option>
|
<option value="0" i18n="failsafeGpsRescueItemSanityChecksOff"></option>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue