|
|
|
@ -1,9 +1,12 @@
|
|
|
|
|
var MSP_pass_through = false;
|
|
|
|
|
|
|
|
|
|
function tab_initialize_logging() {
|
|
|
|
|
ga_tracker.sendAppView('Logging');
|
|
|
|
|
GUI.active_tab = 'logging';
|
|
|
|
|
|
|
|
|
|
var requested_properties = [];
|
|
|
|
|
|
|
|
|
|
if (configuration_received) {
|
|
|
|
|
MSP.send_message(MSP_codes.MSP_RC, false, false, get_motor_data);
|
|
|
|
|
|
|
|
|
|
function get_motor_data() {
|
|
|
|
@ -13,6 +16,21 @@ function tab_initialize_logging() {
|
|
|
|
|
function load_html() {
|
|
|
|
|
$('#content').load("./tabs/logging.html", process_html);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
MSP_pass_through = true;
|
|
|
|
|
|
|
|
|
|
// we will initialize RC.channels array and MOTOR_DATA array manually
|
|
|
|
|
RC.active_channels = 8;
|
|
|
|
|
for (var i = 0; i < RC.active_channels; i++) {
|
|
|
|
|
RC.channels[i] = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < 8; i++) {
|
|
|
|
|
MOTOR_DATA[i] = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('#content').load("./tabs/logging.html", process_html);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function process_html() {
|
|
|
|
|
// translate to user-selected language
|
|
|
|
@ -36,7 +54,7 @@ function tab_initialize_logging() {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (requested_properties.length) {
|
|
|
|
|
// print header for the
|
|
|
|
|
// print header for the csv file
|
|
|
|
|
print_head();
|
|
|
|
|
|
|
|
|
|
function poll_data() {
|
|
|
|
@ -44,6 +62,7 @@ function tab_initialize_logging() {
|
|
|
|
|
crunch_data();
|
|
|
|
|
|
|
|
|
|
// request new
|
|
|
|
|
if (!MSP_pass_through) {
|
|
|
|
|
for (var i = 0; i < requested_properties.length; i++) {
|
|
|
|
|
MSP.send_message(MSP_codes[requested_properties[i]]);
|
|
|
|
|
|
|
|
|
@ -56,6 +75,7 @@ function tab_initialize_logging() {
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GUI.interval_add('log_data_pull', poll_data, parseInt($('select.speed').val()), true); // refresh rate goes here
|
|
|
|
|
GUI.interval_add('flush_data', function() {
|
|
|
|
|