diff --git a/locales/en/messages.json b/locales/en/messages.json index e460eff7..bb604693 100644 --- a/locales/en/messages.json +++ b/locales/en/messages.json @@ -5093,6 +5093,10 @@ "message": "Attention: You need to configure and save FIRST the VTX Table at the bottom before you can make use of the $t(vtxSelectedMode.message) fields.", "description": "Message to show when the VTX is not supported in the VTX tab" }, + "vtxMessageFactoryBandsNotSupported": { + "message": "Attention: The selected VTX type does not support the 'factory' setting for bands, but some of your bands have this setting. Click '$t(vtxButtonSave.message)' to fix this.", + "description": "Message to show when the configured VTX type does not support factory bands, but one or more of the configured bands are of this type" + }, "vtxMessageVerifyTable": { "message": "Attention: The values of the VTX Table have been loaded, but not yet stored on the flight controller. You must verify and modify the values to be sure that they are valid and legal in your country and then press the $t(vtxButtonSave.message) button to store them on the flight controller.", "description": "Message to show when the VTX Table has been loaded from a external source" diff --git a/src/js/tabs/vtx.js b/src/js/tabs/vtx.js index 5b67a0d9..f240ee61 100644 --- a/src/js/tabs/vtx.js +++ b/src/js/tabs/vtx.js @@ -278,15 +278,19 @@ TABS.vtx.initialize = function (callback) { $("#vtx_table_channels").val(VTX_CONFIG.vtx_table_channels); // Populate VTX Table + let hasFactoryBands = false; for (let i = 1; i <= TABS.vtx.VTXTABLE_BAND_LIST.length; i++) { $(`#vtx_table_band_name_${i}`).val(TABS.vtx.VTXTABLE_BAND_LIST[i - 1].vtxtable_band_name); $(`#vtx_table_band_letter_${i}`).val(TABS.vtx.VTXTABLE_BAND_LIST[i - 1].vtxtable_band_letter); $(`#vtx_table_band_factory_${i}`).prop("checked", TABS.vtx.VTXTABLE_BAND_LIST[i - 1].vtxtable_band_is_factory_band); + hasFactoryBands = hasFactoryBands || TABS.vtx.VTXTABLE_BAND_LIST[i - 1].vtxtable_band_is_factory_band; for (let j = 1; j <= TABS.vtx.VTXTABLE_BAND_LIST[i - 1].vtxtable_band_frequencies.length; j++) { $(`#vtx_table_band_channel_${i}_${j}`).val(TABS.vtx.VTXTABLE_BAND_LIST[i - 1].vtxtable_band_frequencies[j - 1]); } } + $(".vtx_table_factory_bands_not_supported").toggle(!TABS.vtx.vtxTableFactoryBandsSupported && hasFactoryBands); + // Actions and other function frequencyOrBandChannel() { diff --git a/src/tabs/vtx.html b/src/tabs/vtx.html index f187b04c..2ac50749 100644 --- a/src/tabs/vtx.html +++ b/src/tabs/vtx.html @@ -20,6 +20,10 @@
+
+
+
+