2013-04-09 00:14:23 +00:00
|
|
|
var timers = new Array();
|
|
|
|
|
2013-04-08 19:10:47 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
var tabs = $('#tabs > ul');
|
|
|
|
$('a', tabs).click(function() {
|
|
|
|
if ($(this).parent().hasClass('active') == false) { // only initialize when the tab isn't already active
|
|
|
|
if (connectionId < 1) { // if there is no active connection, return
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-04-09 00:14:23 +00:00
|
|
|
// Disable any active "data pulling" timer
|
|
|
|
disable_timers();
|
|
|
|
|
2013-04-08 19:10:47 +00:00
|
|
|
// Disable previous active button
|
|
|
|
$('li', tabs).removeClass('active');
|
|
|
|
|
|
|
|
// Highlight selected button
|
|
|
|
$(this).parent().addClass('active');
|
|
|
|
|
|
|
|
if ($(this).parent().hasClass('tab_initial_setup')) {
|
|
|
|
$('#content').load("./tabs/initial_setup.html", tab_initialize_initial_setup);
|
|
|
|
} else if ($(this).parent().hasClass('tab_pid_tuning')) {
|
|
|
|
$('#content').load("./tabs/pid_tuning.html", tab_initialize_pid_tuning);
|
2013-04-09 00:14:23 +00:00
|
|
|
} else if ($(this).parent().hasClass('tab_receiver')) {
|
|
|
|
$('#content').load("./tabs/receiver.html", tab_initialize_receiver);
|
2013-04-10 09:40:36 +00:00
|
|
|
} else if ($(this).parent().hasClass('tab_auxillary_configuration')) {
|
|
|
|
$('#content').load("./tabs/auxillary_configuration.html", tab_initialize_auxillary_configuration);
|
2013-04-08 19:10:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2013-04-09 15:58:54 +00:00
|
|
|
|
|
|
|
// temporary
|
2013-04-09 18:14:49 +00:00
|
|
|
//$('#content').load("./tabs/receiver.html", tab_initialize_receiver);
|
2013-04-09 00:14:23 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
function disable_timers() {
|
|
|
|
for (var i = 0; i < timers.length; i++) {
|
|
|
|
clearInterval(timers[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// kill all the refferences
|
|
|
|
timers = [];
|
|
|
|
}
|