mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 16:25:22 +03:00
Merge pull request #1615 from IvoFPV/vtx-warning
Add warning if Smartaudio port assigned and VTX table not set up
This commit is contained in:
commit
2ba51a8019
3 changed files with 39 additions and 1 deletions
|
@ -1373,6 +1373,9 @@
|
||||||
"portsHelp": {
|
"portsHelp": {
|
||||||
"message": "<strong>Note:</strong> not all combinations are valid. When the flight controller firmware detects this the serial port configuration will be reset."
|
"message": "<strong>Note:</strong> not all combinations are valid. When the flight controller firmware detects this the serial port configuration will be reset."
|
||||||
},
|
},
|
||||||
|
"portsVtxTableNotSet": {
|
||||||
|
"message": "<span class=\"message-negative\">WARNING:</span> The VTX table has not been set up correctly and without it VTX control will not be possible. Please set up the VTX table in $t(tabVtx.message) tab."
|
||||||
|
},
|
||||||
"portsMSPHelp": {
|
"portsMSPHelp": {
|
||||||
"message": "<strong>Note:</strong> Do <span class=\"message-negative\">NOT</span> disable MSP on the first serial port unless you know what you are doing. You may have to reflash and erase your configuration if you do."
|
"message": "<strong>Note:</strong> Do <span class=\"message-negative\">NOT</span> disable MSP on the first serial port unless you know what you are doing. You may have to reflash and erase your configuration if you do."
|
||||||
},
|
},
|
||||||
|
|
|
@ -111,7 +111,13 @@ TABS.ports.initialize = function (callback, scrollPosition) {
|
||||||
load_configuration_from_fc();
|
load_configuration_from_fc();
|
||||||
|
|
||||||
function load_configuration_from_fc() {
|
function load_configuration_from_fc() {
|
||||||
MSP.send_message(MSPCodes.MSP_CF_SERIAL_CONFIG, false, false, on_configuration_loaded_handler);
|
if(semver.gte(CONFIG.apiVersion, "1.42.0")) {
|
||||||
|
MSP.promise(MSPCodes.MSP_VTX_CONFIG).then(function() {
|
||||||
|
return MSP.send_message(MSPCodes.MSP_CF_SERIAL_CONFIG, false, false, on_configuration_loaded_handler);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
MSP.send_message(MSPCodes.MSP_CF_SERIAL_CONFIG, false, false, on_configuration_loaded_handler);
|
||||||
|
}
|
||||||
|
|
||||||
function on_configuration_loaded_handler() {
|
function on_configuration_loaded_handler() {
|
||||||
$('#content').load("./tabs/ports.html", on_tab_loaded_handler);
|
$('#content').load("./tabs/ports.html", on_tab_loaded_handler);
|
||||||
|
@ -273,6 +279,30 @@ TABS.ports.initialize = function (callback, scrollPosition) {
|
||||||
|
|
||||||
ports_e.find('tbody').append(port_configuration_e);
|
ports_e.find('tbody').append(port_configuration_e);
|
||||||
}
|
}
|
||||||
|
if (semver.gte(CONFIG.apiVersion, "1.42.0")) {
|
||||||
|
var vtxTableNotConfigured = VTX_CONFIG.vtx_table_available &&
|
||||||
|
(VTX_CONFIG.vtx_table_bands == 0 ||
|
||||||
|
VTX_CONFIG.vtx_table_channels == 0 ||
|
||||||
|
VTX_CONFIG.vtx_table_powerlevels == 0);
|
||||||
|
const pheripheralsSelectElement = $('select[name="function-peripherals"]');
|
||||||
|
pheripheralsSelectElement.change(function() {
|
||||||
|
let vtxControlSelected = false;
|
||||||
|
pheripheralsSelectElement.each(function() {
|
||||||
|
const el = $(this);
|
||||||
|
if (el.val() == "TBS_SMARTAUDIO" || el.val() == "IRC_TRAMP") {
|
||||||
|
vtxControlSelected = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (vtxControlSelected && vtxTableNotConfigured) {
|
||||||
|
$('.vtxTableNotSet').show();
|
||||||
|
} else {
|
||||||
|
$('.vtxTableNotSet').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
pheripheralsSelectElement.change();
|
||||||
|
} else {
|
||||||
|
$('.vtxTableNotSet').hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function on_tab_loaded_handler() {
|
function on_tab_loaded_handler() {
|
||||||
|
|
|
@ -11,6 +11,11 @@
|
||||||
<p i18n="portsMSPHelp"></p>
|
<p i18n="portsMSPHelp"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="note vtxTableNotSet spacebottom">
|
||||||
|
<div class="note_spacer">
|
||||||
|
<p i18n="portsVtxTableNotSet"></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<table class="ports spacebottom">
|
<table class="ports spacebottom">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue