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

Add Vbat Sag Compensation to UI

Remove empty white line

Improve ff and vbatSag functions change events

Tooltip reviewing
This commit is contained in:
Asizon 2020-07-02 11:11:15 +02:00
parent ea880840a8
commit 18e84746e5
5 changed files with 41 additions and 3 deletions

View file

@ -448,11 +448,21 @@ TABS.pid_tuning.initialize = function (callback) {
ffInterpolateCheck.change(function() {
const checked = $(this).is(':checked');
$('.ffInterpolateSp .suboption').toggle(checked);
});
ffInterpolateCheck.change();
}).change();
// Vbat Sag Compensation
const vbatSagCompensationCheck = $('input[id="vbatSagCompensation"]');
vbatSagCompensationCheck.prop('checked', ADVANCED_TUNING.vbat_sag_compensation !== 0);
$('input[name="vbatSagValue"]').val(ADVANCED_TUNING.vbat_sag_compensation > 0 ? ADVANCED_TUNING.vbat_sag_compensation : 100);
vbatSagCompensationCheck.change(function() {
const checked = $(this).is(':checked');
$('.vbatSagCompensation .suboption').toggle(checked);
}).change();
} else {
$('.ffInterpolateSp').hide();
$('.vbatSagCompensation').hide();
}
$('input[id="useIntegratedYaw"]').change(function() {
@ -921,6 +931,7 @@ TABS.pid_tuning.initialize = function (callback) {
ADVANCED_TUNING.ff_smooth_factor = parseInt($('input[name="ffSmoothFactor"]').val());
ADVANCED_TUNING.ff_boost = parseInt($('input[name="ffBoost"]').val());
FILTER_CONFIG.dyn_lpf_curve_expo = parseInt($('.pid_filter input[name="dtermLowpassDynExpo"]').val());
ADVANCED_TUNING.vbat_sag_compensation = $('input[id="vbatSagCompensation"]').is(':checked') ? parseInt($('input[name="vbatSagValue"]').val()) : 0;
}
}