mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-15 12:25:13 +03:00
handle setups with no non-bt serial ports - for real
This commit is contained in:
parent
21a75ea7d3
commit
8913b8bb1c
2 changed files with 20 additions and 19 deletions
|
@ -135,6 +135,7 @@ PortHandler.check = function () {
|
||||||
check_usb_devices();
|
check_usb_devices();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GUI.updateManualPortVisibility();
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
self.check();
|
self.check();
|
||||||
}, 250);
|
}, 250);
|
||||||
|
@ -252,4 +253,4 @@ PortHandler.flush_callbacks = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
return killed;
|
return killed;
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
var updateManualPortVisibility = function(){
|
GUI.updateManualPortVisibility = function(){
|
||||||
if ($('div#port-picker #port option:selected').data().isManual) {
|
if ($('div#port-picker #port option:selected').data().isManual) {
|
||||||
$('#port-override-option').show();
|
$('#port-override-option').show();
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
updateManualPortVisibility();
|
GUI.updateManualPortVisibility();
|
||||||
|
|
||||||
$('#port-override').change(function () {
|
$('#port-override').change(function () {
|
||||||
chrome.storage.local.set({'portOverride': $('#port-override').val()});
|
chrome.storage.local.set({'portOverride': $('#port-override').val()});
|
||||||
|
@ -22,7 +22,7 @@ $(document).ready(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('div#port-picker #port').change(function (target) {
|
$('div#port-picker #port').change(function (target) {
|
||||||
updateManualPortVisibility();
|
GUI.updateManualPortVisibility();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('div#port-picker a.connect').click(function () {
|
$('div#port-picker a.connect').click(function () {
|
||||||
|
@ -53,7 +53,7 @@ $(document).ready(function () {
|
||||||
serial.disconnect(onClosed);
|
serial.disconnect(onClosed);
|
||||||
|
|
||||||
var wasConnected = CONFIGURATOR.connectionValid;
|
var wasConnected = CONFIGURATOR.connectionValid;
|
||||||
|
|
||||||
GUI.connected_to = false;
|
GUI.connected_to = false;
|
||||||
CONFIGURATOR.connectionValid = false;
|
CONFIGURATOR.connectionValid = false;
|
||||||
GUI.allowedTabs = GUI.defaultAllowedTabsWhenDisconnected.slice();
|
GUI.allowedTabs = GUI.defaultAllowedTabsWhenDisconnected.slice();
|
||||||
|
@ -79,7 +79,7 @@ $(document).ready(function () {
|
||||||
// detach listeners and remove element data
|
// detach listeners and remove element data
|
||||||
$('#content').empty();
|
$('#content').empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#tabs .tab_landing a').click();
|
$('#tabs .tab_landing a').click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,36 +172,36 @@ function onOpen(openInfo) {
|
||||||
if (semver.gte(CONFIG.apiVersion, CONFIGURATOR.apiVersionAccepted)) {
|
if (semver.gte(CONFIG.apiVersion, CONFIGURATOR.apiVersionAccepted)) {
|
||||||
|
|
||||||
MSP.send_message(MSP_codes.MSP_FC_VARIANT, false, false, function () {
|
MSP.send_message(MSP_codes.MSP_FC_VARIANT, false, false, function () {
|
||||||
|
|
||||||
MSP.send_message(MSP_codes.MSP_FC_VERSION, false, false, function () {
|
MSP.send_message(MSP_codes.MSP_FC_VERSION, false, false, function () {
|
||||||
|
|
||||||
googleAnalytics.sendEvent('Firmware', 'Variant', CONFIG.flightControllerIdentifier + ',' + CONFIG.flightControllerVersion);
|
googleAnalytics.sendEvent('Firmware', 'Variant', CONFIG.flightControllerIdentifier + ',' + CONFIG.flightControllerVersion);
|
||||||
GUI.log(chrome.i18n.getMessage('fcInfoReceived', [CONFIG.flightControllerIdentifier, CONFIG.flightControllerVersion]));
|
GUI.log(chrome.i18n.getMessage('fcInfoReceived', [CONFIG.flightControllerIdentifier, CONFIG.flightControllerVersion]));
|
||||||
|
|
||||||
MSP.send_message(MSP_codes.MSP_BUILD_INFO, false, false, function () {
|
MSP.send_message(MSP_codes.MSP_BUILD_INFO, false, false, function () {
|
||||||
|
|
||||||
googleAnalytics.sendEvent('Firmware', 'Using', CONFIG.buildInfo);
|
googleAnalytics.sendEvent('Firmware', 'Using', CONFIG.buildInfo);
|
||||||
GUI.log(chrome.i18n.getMessage('buildInfoReceived', [CONFIG.buildInfo]));
|
GUI.log(chrome.i18n.getMessage('buildInfoReceived', [CONFIG.buildInfo]));
|
||||||
|
|
||||||
MSP.send_message(MSP_codes.MSP_BOARD_INFO, false, false, function () {
|
MSP.send_message(MSP_codes.MSP_BOARD_INFO, false, false, function () {
|
||||||
|
|
||||||
googleAnalytics.sendEvent('Board', 'Using', CONFIG.boardIdentifier + ',' + CONFIG.boardVersion);
|
googleAnalytics.sendEvent('Board', 'Using', CONFIG.boardIdentifier + ',' + CONFIG.boardVersion);
|
||||||
GUI.log(chrome.i18n.getMessage('boardInfoReceived', [CONFIG.boardIdentifier, CONFIG.boardVersion]));
|
GUI.log(chrome.i18n.getMessage('boardInfoReceived', [CONFIG.boardIdentifier, CONFIG.boardVersion]));
|
||||||
|
|
||||||
MSP.send_message(MSP_codes.MSP_UID, false, false, function () {
|
MSP.send_message(MSP_codes.MSP_UID, false, false, function () {
|
||||||
GUI.log(chrome.i18n.getMessage('uniqueDeviceIdReceived', [CONFIG.uid[0].toString(16) + CONFIG.uid[1].toString(16) + CONFIG.uid[2].toString(16)]));
|
GUI.log(chrome.i18n.getMessage('uniqueDeviceIdReceived', [CONFIG.uid[0].toString(16) + CONFIG.uid[1].toString(16) + CONFIG.uid[2].toString(16)]));
|
||||||
|
|
||||||
// continue as usually
|
// continue as usually
|
||||||
CONFIGURATOR.connectionValid = true;
|
CONFIGURATOR.connectionValid = true;
|
||||||
GUI.allowedTabs = GUI.defaultAllowedTabsWhenConnected.slice();
|
GUI.allowedTabs = GUI.defaultAllowedTabsWhenConnected.slice();
|
||||||
if (semver.lt(CONFIG.apiVersion, "1.4.0")) {
|
if (semver.lt(CONFIG.apiVersion, "1.4.0")) {
|
||||||
GUI.allowedTabs.splice(GUI.allowedTabs.indexOf('led_strip'), 1);
|
GUI.allowedTabs.splice(GUI.allowedTabs.indexOf('led_strip'), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
GUI.canChangePidController = semver.gte(CONFIG.apiVersion, CONFIGURATOR.pidControllerChangeMinApiVersion);
|
GUI.canChangePidController = semver.gte(CONFIG.apiVersion, CONFIGURATOR.pidControllerChangeMinApiVersion);
|
||||||
|
|
||||||
onConnect();
|
onConnect();
|
||||||
|
|
||||||
$('#tabs ul.mode-connected .tab_setup a').click();
|
$('#tabs ul.mode-connected .tab_setup a').click();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -254,7 +254,7 @@ function onClosed(result) {
|
||||||
|
|
||||||
$('#tabs ul.mode-connected').hide();
|
$('#tabs ul.mode-connected').hide();
|
||||||
$('#tabs ul.mode-disconnected').show();
|
$('#tabs ul.mode-disconnected').show();
|
||||||
|
|
||||||
var documentationButton = $('#button-documentation');
|
var documentationButton = $('#button-documentation');
|
||||||
documentationButton.hide();
|
documentationButton.hide();
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,7 @@ function sensor_status(sensors_detected) {
|
||||||
if (sensor_status.previous_sensors_detected == sensors_detected) {
|
if (sensor_status.previous_sensors_detected == sensors_detected) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set current value
|
// set current value
|
||||||
sensor_status.previous_sensors_detected = sensors_detected;
|
sensor_status.previous_sensors_detected = sensors_detected;
|
||||||
|
|
||||||
|
@ -359,4 +359,4 @@ function bit_set(num, bit) {
|
||||||
|
|
||||||
function bit_clear(num, bit) {
|
function bit_clear(num, bit) {
|
||||||
return num & ~(1 << bit);
|
return num & ~(1 << bit);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue