diff --git a/js/main.js b/js/main.js index 547c21108a..3881fcb67d 100644 --- a/js/main.js +++ b/js/main.js @@ -7,6 +7,17 @@ if (navigator.appVersion.indexOf("Linux") != -1) OS = "Linux"; var timers = new Array(); +function disable_timers() { + for (var i = 0; i < timers.length; i++) { + clearInterval(timers[i]); + } + + // kill all the refferences + timers = []; + + return true; +} + $(document).ready(function() { var tabs = $('#tabs > ul'); $('a', tabs).click(function() { @@ -46,22 +57,11 @@ $(document).ready(function() { } else if ($(this).parent().hasClass('tab_cli')) { $('#content').load("./tabs/cli.html", tab_initialize_cli); } else if ($(this).parent().hasClass('tab_about')) { - $('#content').load("./tabs/about.html"); + $('#content').load("./tabs/about.html", tab_initialize_about); } } }); // temporary //$('#content').load("./tabs/gps.html", tab_initialize_gps); -}); - -function disable_timers() { - for (var i = 0; i < timers.length; i++) { - clearInterval(timers[i]); - } - - // kill all the refferences - timers = []; - - return true; -} \ No newline at end of file +}); \ No newline at end of file diff --git a/js/serial_backend.js b/js/serial_backend.js index 98e71d8857..83ee14b724 100644 --- a/js/serial_backend.js +++ b/js/serial_backend.js @@ -449,6 +449,8 @@ function process_message(code, data) { CONFIG.activeSensors = view.getUint16(4, 1); CONFIG.mode = view.getUint32(6, 1); + $('span.cycle-time').html(CONFIG.cycleTime); + sensor_status(CONFIG.activeSensors); break; case MSP_codes.MSP_RAW_IMU: diff --git a/main.html b/main.html index aaa22d4b86..e5c9a4ae79 100644 --- a/main.html +++ b/main.html @@ -22,6 +22,7 @@ +
@@ -97,7 +98,8 @@
Port utilization: 0% | - MCU Software Version: 0.00 + MCU Software Version: 0.00 | + Cycle Time: 0
diff --git a/tabs/about.js b/tabs/about.js new file mode 100644 index 0000000000..efede5681e --- /dev/null +++ b/tabs/about.js @@ -0,0 +1,8 @@ +function tab_initialize_about() { + // enable data pulling + timers.push(setInterval(about_data_poll, 50)); +} + +function about_data_poll() { + send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS); +} \ No newline at end of file diff --git a/tabs/auxiliary_configuration.js b/tabs/auxiliary_configuration.js index 532ab67786..4f2c470305 100644 --- a/tabs/auxiliary_configuration.js +++ b/tabs/auxiliary_configuration.js @@ -74,7 +74,13 @@ function tab_initialize_auxiliary_configuration() { $(this).removeClass('active'); } }); - + + // enable data pulling + timers.push(setInterval(aux_data_poll, 50)); +} + +function aux_data_poll() { + send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS); } function box_check(num, pos) { diff --git a/tabs/gps.js b/tabs/gps.js index f194c6f2ea..64aa5ceed2 100644 --- a/tabs/gps.js +++ b/tabs/gps.js @@ -24,6 +24,7 @@ function gps_pull() { $('td', row).eq(2).find('progress').val(GPS_DATA.cno); } + send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS); send_message(MSP_codes.MSP_RAW_GPS, MSP_codes.MSP_RAW_GPS); send_message(MSP_codes.MSP_GPSSVINFO, MSP_codes.MSP_GPSSVINFO); } \ No newline at end of file diff --git a/tabs/initial_setup.js b/tabs/initial_setup.js index 5306137dcf..fb307bd4c1 100644 --- a/tabs/initial_setup.js +++ b/tabs/initial_setup.js @@ -70,6 +70,7 @@ function data_poll() { $('span.bat-voltage').html(BATTERY.voltage + ' V'); // Request new data + send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS); 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_BAT, MSP_codes.MSP_BAT); diff --git a/tabs/motor_outputs.js b/tabs/motor_outputs.js index 896f161cba..e56e7262bc 100644 --- a/tabs/motor_outputs.js +++ b/tabs/motor_outputs.js @@ -5,6 +5,7 @@ function tab_initialize_motor_outputs() { function motorPoll() { // Request New Motor data + send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS); send_message(MSP_codes.MSP_MOTOR, MSP_codes.MSP_MOTOR); // Update UI diff --git a/tabs/pid_tuning.js b/tabs/pid_tuning.js index 045f7e09ea..8d2f454c86 100644 --- a/tabs/pid_tuning.js +++ b/tabs/pid_tuning.js @@ -153,5 +153,11 @@ function tab_initialize_pid_tuning() { $(this).removeClass('active'); } }); - + + // enable data pulling + timers.push(setInterval(pid_data_poll, 50)); +} + +function pid_data_poll() { + send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS); } \ No newline at end of file diff --git a/tabs/receiver.js b/tabs/receiver.js index cc1d2cd68c..cce4924627 100644 --- a/tabs/receiver.js +++ b/tabs/receiver.js @@ -150,5 +150,6 @@ function receiverPoll() { samples_i++; // Request new data + send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS); send_message(MSP_codes.MSP_RC, MSP_codes.MSP_RC); } \ No newline at end of file diff --git a/tabs/sensors.js b/tabs/sensors.js index 6e82999fba..cd6e16a66e 100644 --- a/tabs/sensors.js +++ b/tabs/sensors.js @@ -176,6 +176,7 @@ function sensor_array_pull() { samples_i++; // Request new data + send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS); send_message(MSP_codes.MSP_RAW_IMU, MSP_codes.MSP_RAW_IMU); send_message(MSP_codes.MSP_ALTITUDE, MSP_codes.MSP_ALTITUDE); }