1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-15 20:35:19 +03:00

display mode values in aux tab (realtime)

This commit is contained in:
cTn 2013-10-16 11:15:14 +02:00
parent bced4d0cb5
commit 30c2faa2d5
3 changed files with 18 additions and 8 deletions

View file

@ -700,8 +700,13 @@ a:hover {
text-align: center; text-align: center;
} }
.tab-auxiliary_configuration .boxes .on { .tab-auxiliary_configuration .boxes .on {
color: white;
background-color: #0d8b13; background-color: #0d8b13;
} }
.tab-auxiliary_configuration .boxes .off {
color: white;
background-color: #be2222;
}
.tab-auxiliary_configuration .boxes td input { .tab-auxiliary_configuration .boxes td input {
position: absolute; position: absolute;

View file

@ -485,7 +485,6 @@ function process_message(code, data) {
CONFIG.profile = view.getUint8(10); CONFIG.profile = view.getUint8(10);
$('span.cycle-time').html(CONFIG.cycleTime); $('span.cycle-time').html(CONFIG.cycleTime);
sensor_status(CONFIG.activeSensors); sensor_status(CONFIG.activeSensors);
break; break;
case MSP_codes.MSP_RAW_IMU: case MSP_codes.MSP_RAW_IMU:

View file

@ -27,12 +27,6 @@ function tab_initialize_auxiliary_configuration() {
// UI Hooks // UI Hooks
$('.tab-auxiliary_configuration .boxes input').change(function() { $('.tab-auxiliary_configuration .boxes input').change(function() {
if($(this).is(':checked')) {
$(this).parent().addClass('on');
} else {
$(this).parent().removeClass('on');
}
// if any of the fields changed, unlock update button // if any of the fields changed, unlock update button
$('a.update').addClass('active'); $('a.update').addClass('active');
}); });
@ -83,11 +77,23 @@ function tab_initialize_auxiliary_configuration() {
function aux_data_poll() { function aux_data_poll() {
send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS); send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS);
for (var i = 0; i < AUX_CONFIG.length; i++) {
if (bit_check(CONFIG.mode, i)) {
$('td.name').eq(i).addClass('on').removeClass('off');
} else {
$('td.name').eq(i).removeClass('on').removeClass('off');
if (AUX_CONFIG_values[i] > 0) {
$('td.name').eq(i).addClass('off');
}
}
}
} }
function box_check(num, pos) { function box_check(num, pos) {
if (bit_check(num, pos)) { // 1 if (bit_check(num, pos)) { // 1
return '<td class="on"><input type="checkbox" checked="checked" /></td>'; return '<td><input type="checkbox" checked="checked" /></td>';
} else { // 0 } else { // 0
return '<td><input type="checkbox" /></td>'; return '<td><input type="checkbox" /></td>';
} }