mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 05:45:31 +03:00
Cycle Time value is now visible in status bar
This commit is contained in:
parent
f42a1fd708
commit
652f560e42
11 changed files with 45 additions and 16 deletions
24
js/main.js
24
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,7 +57,7 @@ $(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);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -54,14 +65,3 @@ $(document).ready(function() {
|
|||
// 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;
|
||||
}
|
|
@ -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:
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<script type="text/javascript" src="./tabs/motor_outputs.js"></script>
|
||||
<script type="text/javascript" src="./tabs/sensors.js"></script>
|
||||
<script type="text/javascript" src="./tabs/cli.js"></script>
|
||||
<script type="text/javascript" src="./tabs/about.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="main-wrapper">
|
||||
|
@ -97,7 +98,8 @@
|
|||
</div>
|
||||
<div id="status-bar">
|
||||
Port utilization: <span class="port-usage">0%</span> |
|
||||
MCU Software Version: <span class="software-version">0.00</span>
|
||||
MCU Software Version: <span class="software-version">0.00</span> |
|
||||
Cycle Time: <span class="cycle-time">0</span>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
8
tabs/about.js
Normal file
8
tabs/about.js
Normal file
|
@ -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);
|
||||
}
|
|
@ -75,6 +75,12 @@ function tab_initialize_auxiliary_configuration() {
|
|||
}
|
||||
});
|
||||
|
||||
// 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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -154,4 +154,10 @@ function tab_initialize_pid_tuning() {
|
|||
}
|
||||
});
|
||||
|
||||
// enable data pulling
|
||||
timers.push(setInterval(pid_data_poll, 50));
|
||||
}
|
||||
|
||||
function pid_data_poll() {
|
||||
send_message(MSP_codes.MSP_STATUS, MSP_codes.MSP_STATUS);
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue