1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 11:29:53 +03:00

removal of char_counter, new port_usage, i18n

added bitrate to serial object, removed last bits of 'port_handler'
interval code forgotten in the kill routines, new port_usage is now
saved in a separate file
This commit is contained in:
cTn 2014-03-29 00:59:39 +01:00
parent 241b44e893
commit 58d43c381b
11 changed files with 73 additions and 27 deletions

View file

@ -32,11 +32,11 @@ $(document).ready(function() {
GUI.connected_to = false;
// Reset various UI elements
$('span.port-usage').html('0%');
$('.software-version').html('0.0');
$('span.cycle-time').html('0');
MSP.disconnect_cleanup();
PortUsage.reset();
configuration_received = false; // reset valid config received variable (used to block tabs while not connected properly)
// unlock port select & baud
@ -109,7 +109,9 @@ $(document).ready(function() {
chrome.storage.local.set({'auto_connect': GUI.auto_connect});
});
});
PortHandler.initialize();
PortUsage.initialize();
});
function onOpen(openInfo) {
@ -142,7 +144,6 @@ function onOpen(openInfo) {
});
serial.onReceive.addListener(read_serial);
GUI.interval_add('port_usage', port_usage, 1000, true);
// disconnect after 10 seconds with error if we don't get IDENT data
GUI.timeout_add('connecting', function() {
@ -203,14 +204,6 @@ function read_serial(info) {
}
}
function port_usage() {
var port_usage = (char_counter * 10 / parseInt($('div#port-picker #baud').val())) * 100;
$('span.port-usage').html(parseInt(port_usage) + '%');
// reset counter
char_counter = 0;
}
function sensor_status(sensors_detected) {
// initialize variable (if it wasn't)
if (typeof sensor_status.previous_sensors_detected == 'undefined') {