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

Fix antigravity gain value

sonar issue,remove unneded math,const renamed

Moved const inside if

Moved const inside else
This commit is contained in:
Asizon 2020-05-08 10:23:02 +02:00
parent 8fd1c11ac3
commit d32fe20ddc

View file

@ -181,9 +181,13 @@ TABS.pid_tuning.initialize = function (callback) {
antiGravitySwitch.change(function() {
var checked = $(this).is(':checked');
if (checked) {
const MAX_ACCELERATOR_GAIN = semver.gte(CONFIG.apiVersion, API_VERSION_1_43) ? 3.5 : 1.1;
const itermAcceleratorGain = Math.max(ADVANCED_TUNING.itermAcceleratorGain / 1000, MAX_ACCELERATOR_GAIN);
if (ADVANCED_TUNING.itermAcceleratorGain === 1000) {
const DEFAULT_ACCELERATOR_GAIN = semver.gte(CONFIG.apiVersion, API_VERSION_1_43) ? 3.5 : 1.1;
$('.antigravity input[name="itermAcceleratorGain"]').val(DEFAULT_ACCELERATOR_GAIN);
} else {
const itermAcceleratorGain = (ADVANCED_TUNING.itermAcceleratorGain / 1000);
$('.antigravity input[name="itermAcceleratorGain"]').val(itermAcceleratorGain);
}
$('.antigravity .suboption').show();
if (ADVANCED_TUNING.antiGravityMode == 0) {
$('.antigravity .antiGravityThres').hide();