mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 22:05:17 +03:00
parent
98c587c3d9
commit
eaeda19842
10 changed files with 63 additions and 13 deletions
|
@ -79,4 +79,7 @@
|
|||
}
|
||||
.tab-auxiliary_configuration .update:hover {
|
||||
background-color: #dedcdc;
|
||||
}
|
||||
.tab-auxiliary_configuration .update.success {
|
||||
border: 1px solid #43c84d;
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -119,4 +119,7 @@
|
|||
.tab-receiver .update:hover,
|
||||
.tab-receiver .refresh:hover {
|
||||
background-color: #dedcdc;
|
||||
}
|
||||
}
|
||||
.tab-receiver .update.success {
|
||||
border: 1px solid #43c84d;
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -132,4 +132,7 @@
|
|||
}
|
||||
.tab-servos .update:hover {
|
||||
background-color: #dedcdc;
|
||||
}
|
||||
.tab-servos .update.success {
|
||||
border: 1px solid #43c84d;
|
||||
}
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue