Fix aux channel configuration when using an rc system with 3 aux

channels.
10.3.x-maintenance
Dominic Clifton 2014-08-25 10:50:25 +01:00
parent a710a2fbb1
commit 6f4d04eb90
3 changed files with 24 additions and 10 deletions

View File

@ -1,3 +1,7 @@
<span>08.25.2014 - 0.49.1 cleanflight</span>
<p>
- Fix auxiliary configuration tab when using an rc system with 3 aux channels.<br />
</p>
<span>08.18.2014 - 0.49</span>
<p>
- Motor indicators now display signal length in tooltips<br />

View File

@ -1,7 +1,7 @@
{
"manifest_version": 2,
"minimum_chrome_version": "36",
"version": "0.49",
"version": "0.49.1",
"author": "Hydra",
"name": "Cleanflight - Configurator",

View File

@ -48,24 +48,32 @@ TABS.auxiliary_configuration.initialize = function (callback) {
var line = '<tr class="switches">';
line += '<td class="name">' + AUX_CONFIG[i] + '</td>';
var switches = '';
var auxChannelCount = RC.active_channels - 4;
var bitIndex = 0;
var chunks = 1;
if (bit_check(CONFIG.capability, 5) && (RC.active_channels - 4) > 4) {
if (bit_check(CONFIG.capability, 5) && (auxChannelCount) > 4) {
chunks = 2;
}
var channelsRemaining = auxChannelCount;
var channelsPerChunk = 4;
for (var chunk = 0; chunk < chunks; chunk++) {
for (var j = 0; j < channelsPerChunk * 3; j++) {
if (bit_check(AUX_CONFIG_values[i], bitIndex++)) {
line += '<td><input type="checkbox" checked="checked" /></td>';
} else {
line += '<td><input type="checkbox" /></td>';
for (var chunkChannel = 0; chunkChannel < channelsPerChunk && channelsRemaining; chunkChannel++, channelsRemaining--) {
for (var j = 0; j < 3; j++) {
if (bit_check(AUX_CONFIG_values[i], bitIndex++)) {
switches += '<td><input type="checkbox" checked="checked" /></td>';
} else {
switches += '<td><input type="checkbox" /></td>';
}
}
}
bitIndex += 16 - (4 * 3);
}
line += '</tr>';
line += switches + '</tr>';
$('.boxes > tbody:last').append(line);
}
@ -76,9 +84,11 @@ TABS.auxiliary_configuration.initialize = function (callback) {
var main_needle = 0;
var needle = 0;
var auxChannelCount = RC.active_channels - 4;
var boxCountFor4AuxChannels = 3 * 4;
var boxCountPerLine = boxCountFor4AuxChannels;
if (bit_check(CONFIG.capability, 5) && (RC.active_channels - 4) > 4) {
var boxCountPerLine = auxChannelCount * 3;
if (bit_check(CONFIG.capability, 5) && (auxChannelCount) > 4) {
boxCountPerLine = boxCountFor4AuxChannels * 2;
}