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

Add RC Rate Yaw as adjustment function

This commit is contained in:
KiteAnton 2016-08-08 23:17:22 +02:00
parent b4ce967453
commit e7cacef851
3 changed files with 19 additions and 3 deletions

View file

@ -1097,6 +1097,10 @@
"adjustmentsFunction20": { "adjustmentsFunction20": {
"message": "Roll D Adjustment" "message": "Roll D Adjustment"
}, },
"adjustmentsFunction21": {
"message": "RC Rate Yaw"
},
"adjustmentsSave": { "adjustmentsSave": {
"message": "Save" "message": "Save"
}, },

View file

@ -88,6 +88,7 @@
<option value="18" i18n="adjustmentsFunction18"></option> <option value="18" i18n="adjustmentsFunction18"></option>
<option value="19" i18n="adjustmentsFunction19"></option> <option value="19" i18n="adjustmentsFunction19"></option>
<option value="20" i18n="adjustmentsFunction20"></option> <option value="20" i18n="adjustmentsFunction20"></option>
<option value="21" i18n="adjustmentsFunction21"></option>
</select></td> </select></td>
<td class="adjustmentSlot"><select class="slot"> <td class="adjustmentSlot"><select class="slot">
<option value="0" i18n="adjustmentsSlot0"></option> <option value="0" i18n="adjustmentsSlot0"></option>

View file

@ -57,14 +57,25 @@ TABS.adjustments.initialize = function (callback) {
// //
// update selected function // update selected function
// //
var functionList = $(newAdjustment).find('.functionSelection .function'); var functionList = $(newAdjustment).find('.functionSelection .function');
functionList.val(adjustmentRange.adjustmentFunction); // update list of selected functions
var functionListOptions = $(functionList).find('option');
var availableFunctionCount = 21; // Available in betaflight 2.9
if (semver.gte(CONFIG.flightControllerVersion, '3.1.0')) {
availableFunctionCount += 1; // RC rate Yaw added to 3.1.0
}
var functionListOptions = $(functionListOptions).slice(0,availableFunctionCount);
functionList.empty().append(functionListOptions);
functionList.val(adjustmentRange.adjustmentFunction);
// //
// populate function channel select box // populate function channel select box
// //
var channelList = $(newAdjustment).find('.functionSwitchChannel .channel'); var channelList = $(newAdjustment).find('.functionSwitchChannel .channel');
var channelOptionTemplate = $(channelList).find('option'); var channelOptionTemplate = $(channelList).find('option');
channelOptionTemplate.remove(); channelOptionTemplate.remove();