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

Vbat precision (fixes)

This commit is contained in:
fgiudice98 2018-12-26 15:14:12 +01:00
parent d687e382fe
commit 95f4f1c888
6 changed files with 29 additions and 12 deletions

View file

@ -181,6 +181,12 @@ TABS.power.initialize = function (callback) {
var element = template.clone();
destination.append(element);
if (semver.gte(CONFIG.apiVersion, "1.41.0")) {
$('input[name="mincellvoltage"]').prop('step','0.01');
$('input[name="maxcellvoltage"]').prop('step','0.01');
$('input[name="warningcellvoltage"]').prop('step','0.01');
}
$('input[name="mincellvoltage"]').val(BATTERY_CONFIG.vbatmincellvoltage);
$('input[name="maxcellvoltage"]').val(BATTERY_CONFIG.vbatmaxcellvoltage);
$('input[name="warningcellvoltage"]').val(BATTERY_CONFIG.vbatwarningcellvoltage);
@ -247,7 +253,11 @@ TABS.power.initialize = function (callback) {
for (var i = 0; i < VOLTAGE_METERS.length; i++) {
var elementName = '#voltage-meter-' + i + ' .value';
var element = $(elementName);
element.text(i18n.getMessage('powerVoltageValue', [VOLTAGE_METERS[i].voltage]));
if (semver.gte(CONFIG.apiVersion, "1.41.0")) {
element.text(i18n.getMessage('powerVoltageValue', [ANALOG.voltage]));
} else {
element.text(i18n.getMessage('powerVoltageValue', [VOLTAGE_METERS[i].voltage]));
}
}
});