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

@ -47,7 +47,11 @@ $(document).ready(function() {
if (!GUI.auto_connect) $('div#port-picker #baud').prop('disabled', false); if (!GUI.auto_connect) $('div#port-picker #baud').prop('disabled', false);
$(this).text('Connect'); $(this).text('Connect');
$(this).removeClass('active'); $(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); $(this).data("clicks", !clicks);
@ -109,6 +113,8 @@ function onOpen(openInfo) {
// reset connecting_to // reset connecting_to
GUI.connecting_to = false; 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 // save selected port with chrome.storage if the port differs
chrome.storage.local.get('last_used_port', function(result) { chrome.storage.local.get('last_used_port', function(result) {
if (typeof result.last_used_port != 'undefined') { 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 // disconnect after 10 seconds with error if we don't get IDENT data
GUI.timeout_add('connecting', function() { GUI.timeout_add('connecting', function() {
if (!configuration_received) { 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 $('div#port-picker a.connect').click(); // disconnect
} }
@ -169,12 +175,10 @@ function onOpen(openInfo) {
} }
function onClosed(result) { function onClosed(result) {
if (result) { // All went as expected if (result) { // All went as expected
sensor_status(sensors_detected = 0); // reset active sensor indicators GUI.log('Serial port <span style="color: green">successfully</span> closed');
$('#tabs > ul li').removeClass('active'); // de-select any selected tabs
tab_initialize_default();
} else { // Something went wrong } else { // Something went wrong
GUI.log('Failed to close serial port', 'red'); GUI.log('<span style="color: red">Failed</span> to close serial port');
} }
} }