mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 00:05: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
|
@ -111,7 +111,13 @@ TABS.ports.initialize = function (callback, scrollPosition) {
|
|||
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() {
|
||||
$('#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);
|
||||
}
|
||||
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() {
|
||||
|
|
|
@ -11,6 +11,11 @@
|
|||
<p i18n="portsMSPHelp"></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="note vtxTableNotSet spacebottom">
|
||||
<div class="note_spacer">
|
||||
<p i18n="portsVtxTableNotSet"></p>
|
||||
</div>
|
||||
</div>
|
||||
<table class="ports spacebottom">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue