adding selectable poll rate, i18n run in todo
parent
0c95e94cd5
commit
18c71f69c5
|
@ -25,6 +25,12 @@
|
|||
line-height: 20px;
|
||||
color: silver;
|
||||
}
|
||||
.tab-logging .speed {
|
||||
margin-top: 5px;
|
||||
width: 80px;
|
||||
|
||||
border: 1px solid silver;
|
||||
}
|
||||
.tab-logging .info {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,19 @@
|
|||
<dt><label><input type="checkbox" name="MSP_DEBUG" /> MSP_DEBUG</label></dt><dd>4 columns</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<select class="speed" name="speed">
|
||||
<option value="10">10 ms</option>
|
||||
<option value="20">20 ms</option>
|
||||
<option value="30">30 ms</option>
|
||||
<option value="40">40 ms</option>
|
||||
<option value="50">50 ms</option>
|
||||
<option value="100" selected="selected">100 ms</option>
|
||||
<option value="250">250 ms</option>
|
||||
<option value="500">500 ms</option>
|
||||
<option value="1000">1000 ms</option>
|
||||
<option value="2000">2000 ms</option>
|
||||
<option value="5000">5000 ms</option>
|
||||
</select>
|
||||
<div class="info">
|
||||
<dl>
|
||||
<dt>Samples Saved:</dt><dd class="samples">0</dd>
|
||||
|
|
|
@ -46,20 +46,23 @@ function tab_initialize_logging() {
|
|||
}
|
||||
}
|
||||
|
||||
GUI.interval_add('log_data_pull', poll_data, 1000, true); // refresh rate goes here
|
||||
GUI.interval_add('log_data_pull', poll_data, parseInt($('select.speed').val()), true); // refresh rate goes here
|
||||
GUI.interval_add('flush_data', function() {
|
||||
if (fileWriter.readyState == 0 || fileWriter.readyState == 2) {
|
||||
append_to_file(log_buffer.join('\n'));
|
||||
if (log_buffer.length) { // only execute when there is actual data to write
|
||||
if (fileWriter.readyState == 0 || fileWriter.readyState == 2) {
|
||||
append_to_file(log_buffer.join('\n'));
|
||||
|
||||
$('.samples').text(samples += log_buffer.length);
|
||||
$('.size').text((fileWriter.length / 1024).toFixed(2) + ' kB');
|
||||
$('.samples').text(samples += log_buffer.length);
|
||||
$('.size').text((fileWriter.length / 1024).toFixed(2) + ' kB');
|
||||
|
||||
log_buffer = [];
|
||||
} else {
|
||||
console.log('IO having trouble keeping up with the data flow');
|
||||
log_buffer = [];
|
||||
} else {
|
||||
console.log('IO having trouble keeping up with the data flow');
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
$('.speed').prop('disabled', true);
|
||||
$(this).text('Stop Logging');
|
||||
$(this).data("clicks", !clicks);
|
||||
} else {
|
||||
|
@ -69,6 +72,7 @@ function tab_initialize_logging() {
|
|||
GUI.interval_remove('log_data_pull');
|
||||
GUI.interval_remove('flush_data');
|
||||
|
||||
$('.speed').prop('disabled', false);
|
||||
$(this).text('Start Logging');
|
||||
$(this).data("clicks", !clicks);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue