CF/BF - Disable ESC Sensor and virtual current meter sources for OSD

Slave boards.
10.3.x-maintenance
Hydra 2017-04-09 21:16:34 +01:00 committed by Michael Keller
parent bf0fcb5643
commit a4da6240a1
1 changed files with 11 additions and 3 deletions

View File

@ -141,12 +141,17 @@ TABS.power.initialize = function (callback) {
$('input[name="warningcellvoltage"]').val(BATTERY_CONFIG.vbatwarningcellvoltage); $('input[name="warningcellvoltage"]').val(BATTERY_CONFIG.vbatwarningcellvoltage);
$('input[name="capacity"]').val(BATTERY_CONFIG.capacity); $('input[name="capacity"]').val(BATTERY_CONFIG.capacity);
var haveFc = (semver.lt(CONFIG.apiVersion, "1.35.0") || (CONFIG.boardType == 0 || CONFIG.boardType == 2));
var batteryMeterTypes = [ var batteryMeterTypes = [
'None', 'None',
'Onboard ADC', 'Onboard ADC',
'ESC Sensor'
]; ];
if (haveFc) {
batteryMeterTypes.push('ESC Sensor');
}
var batteryMeterType_e = $('select.batterymetersource'); var batteryMeterType_e = $('select.batterymetersource');
for (var i = 0; i < batteryMeterTypes.length; i++) { for (var i = 0; i < batteryMeterTypes.length; i++) {
batteryMeterType_e.append('<option value="' + i + '">' + batteryMeterTypes[i] + '</option>'); batteryMeterType_e.append('<option value="' + i + '">' + batteryMeterTypes[i] + '</option>');
@ -161,10 +166,13 @@ TABS.power.initialize = function (callback) {
var currentMeterTypes = [ var currentMeterTypes = [
'None', 'None',
'Onboard ADC', 'Onboard ADC',
'Virtual',
'ESC Sensor'
]; ];
if (haveFc) {
currentMeterTypes.push('Virtual');
currentMeterTypes.push('ESC Sensor');
}
var currentMeterType_e = $('select.currentmetersource'); var currentMeterType_e = $('select.currentmetersource');
for (var i = 0; i < currentMeterTypes.length; i++) { for (var i = 0; i < currentMeterTypes.length; i++) {
currentMeterType_e.append('<option value="' + i + '">' + currentMeterTypes[i] + '</option>'); currentMeterType_e.append('<option value="' + i + '">' + currentMeterTypes[i] + '</option>');