using IDENT as first callback to draw initial tab

fixes #10
10.3.x-maintenance
cTn 2013-12-05 10:25:13 +01:00
parent 42101ec791
commit 0344110c2d
2 changed files with 164 additions and 160 deletions

View File

@ -132,6 +132,11 @@ GUI_control.prototype.timeout_kill_all = function() {
// default switch doesn't require callback to be set // default switch doesn't require callback to be set
GUI_control.prototype.tab_switch_cleanup = function(callback) { GUI_control.prototype.tab_switch_cleanup = function(callback) {
switch (this.active_tab) { switch (this.active_tab) {
case 'initial_setup':
GUI.interval_remove('initial_setup_data_pull');
if (callback) callback();
break;
case 'auxiliary_configuration': case 'auxiliary_configuration':
GUI.interval_remove('aux_data_poll'); GUI.interval_remove('aux_data_poll');

View File

@ -4,6 +4,7 @@ function tab_initialize_initial_setup() {
ga_tracker.sendAppView('Initial Setup'); ga_tracker.sendAppView('Initial Setup');
GUI.active_tab = 'initial_setup'; GUI.active_tab = 'initial_setup';
send_message(MSP_codes.MSP_IDENT, MSP_codes.MSP_IDENT, false, function() {
// Fill in the accel trimms from CONFIG object // Fill in the accel trimms from CONFIG object
$('input[name="pitch"]').val(CONFIG.accelerometerTrims[0]); $('input[name="pitch"]').val(CONFIG.accelerometerTrims[0]);
$('input[name="roll"]').val(CONFIG.accelerometerTrims[1]); $('input[name="roll"]').val(CONFIG.accelerometerTrims[1]);
@ -146,11 +147,7 @@ function tab_initialize_initial_setup() {
$('#content .restore').click(configuration_restore); $('#content .restore').click(configuration_restore);
// enable data pulling GUI.interval_add('initial_setup_data_pull', function() {
timers.push(setInterval(data_poll, 50));
}
function data_poll() {
// Update cube // Update cube
var cube = $('div#cube'); var cube = $('div#cube');
@ -170,4 +167,6 @@ function data_poll() {
send_message(MSP_codes.MSP_ATTITUDE, MSP_codes.MSP_ATTITUDE); send_message(MSP_codes.MSP_ATTITUDE, MSP_codes.MSP_ATTITUDE);
send_message(MSP_codes.MSP_COMP_GPS, MSP_codes.MSP_COMP_GPS); send_message(MSP_codes.MSP_COMP_GPS, MSP_codes.MSP_COMP_GPS);
send_message(MSP_codes.MSP_ANALOG, MSP_codes.MSP_ANALOG); send_message(MSP_codes.MSP_ANALOG, MSP_codes.MSP_ANALOG);
}, 50, true);
});
} }