mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-13 11:29:53 +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
|
@ -2,7 +2,7 @@
|
|||
|
||||
$(document).ready(function () {
|
||||
|
||||
var updateManualPortVisibility = function(){
|
||||
GUI.updateManualPortVisibility = function(){
|
||||
if ($('div#port-picker #port option:selected').data().isManual) {
|
||||
$('#port-override-option').show();
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ $(document).ready(function () {
|
|||
}
|
||||
};
|
||||
|
||||
updateManualPortVisibility();
|
||||
GUI.updateManualPortVisibility();
|
||||
|
||||
$('#port-override').change(function () {
|
||||
chrome.storage.local.set({'portOverride': $('#port-override').val()});
|
||||
|
@ -22,7 +22,7 @@ $(document).ready(function () {
|
|||
});
|
||||
|
||||
$('div#port-picker #port').change(function (target) {
|
||||
updateManualPortVisibility();
|
||||
GUI.updateManualPortVisibility();
|
||||
});
|
||||
|
||||
$('div#port-picker a.connect').click(function () {
|
||||
|
@ -53,7 +53,7 @@ $(document).ready(function () {
|
|||
serial.disconnect(onClosed);
|
||||
|
||||
var wasConnected = CONFIGURATOR.connectionValid;
|
||||
|
||||
|
||||
GUI.connected_to = false;
|
||||
CONFIGURATOR.connectionValid = false;
|
||||
GUI.allowedTabs = GUI.defaultAllowedTabsWhenDisconnected.slice();
|
||||
|
@ -79,7 +79,7 @@ $(document).ready(function () {
|
|||
// detach listeners and remove element data
|
||||
$('#content').empty();
|
||||
}
|
||||
|
||||
|
||||
$('#tabs .tab_landing a').click();
|
||||
}
|
||||
|
||||
|
@ -172,36 +172,36 @@ function onOpen(openInfo) {
|
|||
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_VERSION, false, false, function () {
|
||||
|
||||
|
||||
googleAnalytics.sendEvent('Firmware', 'Variant', 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 () {
|
||||
|
||||
|
||||
googleAnalytics.sendEvent('Firmware', 'Using', CONFIG.buildInfo);
|
||||
GUI.log(chrome.i18n.getMessage('buildInfoReceived', [CONFIG.buildInfo]));
|
||||
|
||||
|
||||
MSP.send_message(MSP_codes.MSP_BOARD_INFO, false, false, function () {
|
||||
|
||||
|
||||
googleAnalytics.sendEvent('Board', 'Using', CONFIG.boardIdentifier + ',' + CONFIG.boardVersion);
|
||||
GUI.log(chrome.i18n.getMessage('boardInfoReceived', [CONFIG.boardIdentifier, CONFIG.boardVersion]));
|
||||
|
||||
|
||||
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)]));
|
||||
|
||||
|
||||
// continue as usually
|
||||
CONFIGURATOR.connectionValid = true;
|
||||
GUI.allowedTabs = GUI.defaultAllowedTabsWhenConnected.slice();
|
||||
if (semver.lt(CONFIG.apiVersion, "1.4.0")) {
|
||||
GUI.allowedTabs.splice(GUI.allowedTabs.indexOf('led_strip'), 1);
|
||||
}
|
||||
|
||||
|
||||
GUI.canChangePidController = semver.gte(CONFIG.apiVersion, CONFIGURATOR.pidControllerChangeMinApiVersion);
|
||||
|
||||
onConnect();
|
||||
|
||||
|
||||
$('#tabs ul.mode-connected .tab_setup a').click();
|
||||
});
|
||||
});
|
||||
|
@ -254,7 +254,7 @@ function onClosed(result) {
|
|||
|
||||
$('#tabs ul.mode-connected').hide();
|
||||
$('#tabs ul.mode-disconnected').show();
|
||||
|
||||
|
||||
var documentationButton = $('#button-documentation');
|
||||
documentationButton.hide();
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ function sensor_status(sensors_detected) {
|
|||
if (sensor_status.previous_sensors_detected == sensors_detected) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// set current value
|
||||
sensor_status.previous_sensors_detected = sensors_detected;
|
||||
|
||||
|
@ -359,4 +359,4 @@ function bit_set(num, bit) {
|
|||
|
||||
function bit_clear(num, bit) {
|
||||
return num & ~(1 << bit);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue