1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-18 22:05:17 +03:00

visual indicators for successful save to eeprom

close #20
This commit is contained in:
cTn 2014-01-22 19:05:52 +01:00
parent 98c587c3d9
commit eaeda19842
10 changed files with 63 additions and 13 deletions

View file

@ -79,4 +79,7 @@
}
.tab-auxiliary_configuration .update:hover {
background-color: #dedcdc;
}
.tab-auxiliary_configuration .update.success {
border: 1px solid #43c84d;
}

View file

@ -6,7 +6,7 @@ function tab_initialize_auxiliary_configuration() {
send_message(MSP_codes.MSP_BOX, MSP_codes.MSP_BOX, false, function() {
// generate table from the supplied AUX names and AUX data
for (var i = 0; i < AUX_CONFIG.length; i++) {
$('.tab-auxiliary_configuration .boxes > tbody:last').append(
$('.boxes > tbody:last').append(
'<tr>' +
'<td class="name">' + AUX_CONFIG[i] + '</td>' +
box_check(AUX_CONFIG_values[i], 0) +
@ -29,11 +29,11 @@ function tab_initialize_auxiliary_configuration() {
}
// UI Hooks
$('.tab-auxiliary_configuration a.update').click(function() {
$('a.update').click(function() {
// catch the input changes
var main_needle = 0;
var needle = 0;
$('.tab-auxiliary_configuration .boxes input').each(function() {
$('.boxes input').each(function() {
if ($(this).is(':checked')) {
AUX_CONFIG_values[main_needle] = bit_set(AUX_CONFIG_values[main_needle], needle);
} else {
@ -61,7 +61,14 @@ function tab_initialize_auxiliary_configuration() {
send_message(MSP_codes.MSP_SET_BOX, AUX_val_buffer_out);
// Save changes to EEPROM
send_message(MSP_codes.MSP_EEPROM_WRITE, MSP_codes.MSP_EEPROM_WRITE);
send_message(MSP_codes.MSP_EEPROM_WRITE, MSP_codes.MSP_EEPROM_WRITE, false, function() {
var element = $('a.update');
element.addClass('success');
GUI.timeout_add('success_highlight', function() {
element.removeClass('success');
}, 2000);
});
});
// enable data pulling

View file

@ -309,7 +309,7 @@
border: 1px solid silver;
text-align: center;
}
.tab-initial_setup .save_settings {
.tab-initial_setup .update {
display: block;
float: left;
@ -325,9 +325,12 @@
border: 1px solid silver;
background-color: #ececec;
}
.tab-initial_setup .save_settings:hover {
.tab-initial_setup .update:hover {
background-color: #dedcdc;
}
}
.tab-initial_setup .update.success {
border: 1px solid #43c84d;
}
.tab-initial_setup .compass-wrapper {
position: absolute;

View file

@ -132,7 +132,7 @@ function tab_initialize_initial_setup() {
});
$('a.save_settings').click(function() {
$('a.update').click(function() {
CONFIG.accelerometerTrims[0] = parseInt($('input[name="pitch"]').val());
CONFIG.accelerometerTrims[1] = parseInt($('input[name="roll"]').val());
@ -185,7 +185,14 @@ function tab_initialize_initial_setup() {
send_message(MSP_codes.MSP_SET_MISC, buffer_out);
// Save changes to EEPROM
send_message(MSP_codes.MSP_EEPROM_WRITE, MSP_codes.MSP_EEPROM_WRITE);
send_message(MSP_codes.MSP_EEPROM_WRITE, MSP_codes.MSP_EEPROM_WRITE, false, function() {
var element = $('a.update');
element.addClass('success');
GUI.timeout_add('success_highlight', function() {
element.removeClass('success');
}, 2000);
});
});
// reset yaw button hook

View file

@ -85,4 +85,7 @@
.tab-pid_tuning .update:hover,
.tab-pid_tuning .refresh:hover {
background-color: #dedcdc;
}
.tab-pid_tuning .update.success {
border: 1px solid #43c84d;
}

View file

@ -223,7 +223,14 @@ function tab_initialize_pid_tuning() {
send_message(MSP_codes.MSP_SET_RC_TUNING, RC_tuning_buffer_out);
// Save changes to EEPROM
send_message(MSP_codes.MSP_EEPROM_WRITE, MSP_codes.MSP_EEPROM_WRITE);
send_message(MSP_codes.MSP_EEPROM_WRITE, MSP_codes.MSP_EEPROM_WRITE, false, function() {
var element = $('a.update');
element.addClass('success');
GUI.timeout_add('success_highlight', function() {
element.removeClass('success');
}, 2000);
});
});
// enable data pulling

View file

@ -119,4 +119,7 @@
.tab-receiver .update:hover,
.tab-receiver .refresh:hover {
background-color: #dedcdc;
}
}
.tab-receiver .update.success {
border: 1px solid #43c84d;
}

View file

@ -141,7 +141,14 @@ function tab_initialize_receiver() {
send_message(MSP_codes.MSP_SET_RC_TUNING, RC_tuning_buffer_out);
// Save changes to EEPROM
send_message(MSP_codes.MSP_EEPROM_WRITE, MSP_codes.MSP_EEPROM_WRITE);
send_message(MSP_codes.MSP_EEPROM_WRITE, MSP_codes.MSP_EEPROM_WRITE, false, function() {
var element = $('a.update');
element.addClass('success');
GUI.timeout_add('success_highlight', function() {
element.removeClass('success');
}, 2000);
});
});
// enable RC data pulling

View file

@ -132,4 +132,7 @@
}
.tab-servos .update:hover {
background-color: #dedcdc;
}
.tab-servos .update.success {
border: 1px solid #43c84d;
}

View file

@ -190,7 +190,14 @@ function servos_update(save_to_eeprom) {
if (save_to_eeprom) {
// Save changes to EEPROM
send_message(MSP_codes.MSP_EEPROM_WRITE, MSP_codes.MSP_EEPROM_WRITE);
send_message(MSP_codes.MSP_EEPROM_WRITE, MSP_codes.MSP_EEPROM_WRITE, false, function() {
var element = $('a.update');
element.addClass('success');
GUI.timeout_add('success_highlight', function() {
element.removeClass('success');
}, 2000);
});
}
}