make initial tab data request burst better comply with strict mode to prevent random race conditions

10.3.x-maintenance
cTn 2014-08-14 16:48:16 +02:00
parent dbf528345e
commit d7810e1bb6
7 changed files with 15 additions and 15 deletions

View File

@ -7,8 +7,6 @@ TABS.auxiliary_configuration.initialize = function (callback) {
GUI.active_tab = 'auxiliary_configuration';
googleAnalytics.sendAppView('Auxiliary Configuration');
MSP.send_message(MSP_codes.MSP_BOXNAMES, false, false, get_box_data);
function get_box_data() {
MSP.send_message(MSP_codes.MSP_BOX, false, false, get_box_ids);
}
@ -25,6 +23,8 @@ TABS.auxiliary_configuration.initialize = function (callback) {
$('#content').load("./tabs/auxiliary_configuration.html", process_html);
}
MSP.send_message(MSP_codes.MSP_BOXNAMES, false, false, get_box_data);
function process_html() {
// generate heads according to RC count
var table_head = $('table.boxes .heads');

View File

@ -6,12 +6,12 @@ TABS.gps.initialize = function (callback) {
GUI.active_tab = 'gps';
googleAnalytics.sendAppView('GPS Page');
MSP.send_message(MSP_codes.MSP_RAW_GPS, false, false, load_html);
function load_html() {
$('#content').load("./tabs/gps.html", process_html);
}
MSP.send_message(MSP_codes.MSP_RAW_GPS, false, false, load_html);
function process_html() {
// translate to user-selected language
localize();

View File

@ -10,8 +10,6 @@ TABS.initial_setup.initialize = function (callback) {
GUI.active_tab = 'initial_setup';
googleAnalytics.sendAppView('Initial Setup');
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false, load_ident);
function load_ident() {
MSP.send_message(MSP_codes.MSP_IDENT, false, false, load_misc_data);
}
@ -24,6 +22,8 @@ TABS.initial_setup.initialize = function (callback) {
$('#content').load("./tabs/initial_setup.html", process_html);
}
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false, load_ident);
function process_html() {
// translate to user-selected language
localize();

View File

@ -124,8 +124,6 @@ TABS.motor_outputs.initialize = function (callback) {
lines.attr('d', graphHelpers.line);
}
MSP.send_message(MSP_codes.MSP_MISC, false, false, get_motor_data);
function get_motor_data() {
MSP.send_message(MSP_codes.MSP_MOTOR, false, false, load_html);
}
@ -134,6 +132,8 @@ TABS.motor_outputs.initialize = function (callback) {
$('#content').load("./tabs/motor_outputs.html", process_html);
}
MSP.send_message(MSP_codes.MSP_MISC, false, false, get_motor_data);
function process_html() {
// translate to user-selected language
localize();

View File

@ -6,9 +6,6 @@ TABS.pid_tuning.initialize = function (callback) {
GUI.active_tab = 'pid_tuning';
googleAnalytics.sendAppView('PID Tuning');
// requesting MSP_STATUS manually because it contains CONFIG.profile
MSP.send_message(MSP_codes.MSP_STATUS, false, false, get_pid_names);
function get_pid_names() {
MSP.send_message(MSP_codes.MSP_PIDNAMES, false, false, get_pid_data);
}
@ -25,6 +22,9 @@ TABS.pid_tuning.initialize = function (callback) {
$('#content').load("./tabs/pid_tuning.html", process_html);
}
// requesting MSP_STATUS manually because it contains CONFIG.profile
MSP.send_message(MSP_codes.MSP_STATUS, false, false, get_pid_names);
function process_html() {
// translate to user-selected language
localize();

View File

@ -6,8 +6,6 @@ TABS.receiver.initialize = function (callback) {
GUI.active_tab = 'receiver';
googleAnalytics.sendAppView('Receiver Page');
MSP.send_message(MSP_codes.MSP_RC_TUNING, false, false, get_rc_data);
function get_rc_data() {
MSP.send_message(MSP_codes.MSP_RC, false, false, load_html);
}
@ -16,6 +14,8 @@ TABS.receiver.initialize = function (callback) {
$('#content').load("./tabs/receiver.html", process_html);
}
MSP.send_message(MSP_codes.MSP_RC_TUNING, false, false, get_rc_data);
function process_html() {
// translate to user-selected language
localize();

View File

@ -12,8 +12,6 @@ TABS.servos.initialize = function (callback) {
GUI.active_tab = 'servos';
googleAnalytics.sendAppView('Servos');
MSP.send_message(MSP_codes.MSP_IDENT, false, false, get_servo_conf_data);
function get_servo_conf_data() {
MSP.send_message(MSP_codes.MSP_SERVO_CONF, false, false, get_boxnames_data);
}
@ -26,6 +24,8 @@ TABS.servos.initialize = function (callback) {
$('#content').load("./tabs/servos.html", process_html);
}
MSP.send_message(MSP_codes.MSP_IDENT, false, false, get_servo_conf_data);
function process_html() {
// translate to user-selected language
localize();