1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

more .log hooks

This commit is contained in:
cTn 2014-02-03 09:15:13 +01:00
parent 5b130cfc9b
commit 9b63c082d1

View file

@ -48,6 +48,10 @@ $(document).ready(function() {
$(this).text('Connect');
$(this).removeClass('active');
sensor_status(sensors_detected = 0); // reset active sensor indicators
$('#tabs > ul li').removeClass('active'); // de-select any selected tabs
tab_initialize_default();
}
$(this).data("clicks", !clicks);
@ -109,6 +113,8 @@ function onOpen(openInfo) {
// reset connecting_to
GUI.connecting_to = false;
GUI.log('Serial port <span style="color: green">successfully</span> opened with ID: ' + openInfo.connectionId);
// save selected port with chrome.storage if the port differs
chrome.storage.local.get('last_used_port', function(result) {
if (typeof result.last_used_port != 'undefined') {
@ -134,7 +140,7 @@ function onOpen(openInfo) {
// disconnect after 10 seconds with error if we don't get IDENT data
GUI.timeout_add('connecting', function() {
if (!configuration_received) {
GUI.log('No configuration received within <span style="color: red">10 seconds</span>, communication <span style="color: red">failed</span> - Disconnecting');
GUI.log('No configuration received within <span style="color: red">10 seconds</span>, communication <span style="color: red">failed</span>');
$('div#port-picker a.connect').click(); // disconnect
}
@ -170,11 +176,9 @@ function onOpen(openInfo) {
function onClosed(result) {
if (result) { // All went as expected
sensor_status(sensors_detected = 0); // reset active sensor indicators
$('#tabs > ul li').removeClass('active'); // de-select any selected tabs
tab_initialize_default();
GUI.log('Serial port <span style="color: green">successfully</span> closed');
} else { // Something went wrong
GUI.log('Failed to close serial port', 'red');
GUI.log('<span style="color: red">Failed</span> to close serial port');
}
}