Skip to content

Commit

Permalink
Remove fake vtx feature
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Jul 7, 2023
1 parent b70fdc2 commit c300f71
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/js/Features.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const Features = function (config) {
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING', dependsOn: 'SERVOS'},
{bit: 21, group: 'other', name: 'TRANSPONDER', haveTip: true, dependsOn: 'TRANSPONDER'},
{bit: 22, group: 'other', name: 'AIRMODE'},
{bit: 24, group: 'vtx', name: 'VTX', dependsOn: 'VTX'},
{bit: 25, group: 'rxMode', mode: 'select', name: 'RX_SPI'},
{bit: 27, group: 'escSensor', name: 'ESC_SENSOR'},
{bit: 28, group: 'antiGravity', name: 'ANTI_GRAVITY', haveTip: true, hideName: true},
Expand Down
2 changes: 1 addition & 1 deletion src/js/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class GuiControl {
'ports',
'receiver',
'sensors',
// 'vtx',
];

this.defaultCloudBuildTabOptions = [
Expand All @@ -59,7 +60,6 @@ class GuiControl {
'osd',
'servos',
'transponder',
'vtx',
];

this.defaultAllowedFCTabsWhenConnected = [ ...this.defaultAllowedTabsCloudBuild, ...this.defaultCloudBuildTabOptions];
Expand Down
7 changes: 6 additions & 1 deletion src/js/serial_backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import MSP from "./msp";
import MSPCodes from "./msp/MSPCodes";
import PortUsage from "./port_usage";
import PortHandler from "./port_handler";
import CONFIGURATOR, { API_VERSION_1_45, API_VERSION_1_46 } from "./data_storage";
import CONFIGURATOR, { API_VERSION_1_42, API_VERSION_1_45, API_VERSION_1_46 } from "./data_storage";
import serial from "./serial";
import UI_PHONES from "./phones_ui";
import { bit_check } from './bit.js';
Expand Down Expand Up @@ -536,6 +536,11 @@ function setRtc() {

function finishOpen() {
CONFIGURATOR.connectionValid = true;

if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_42)) {
GUI.defaultAllowedTabsCloudBuild.push('vtx');
}

if (semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_45) && FC.CONFIG.buildOptions.length) {

GUI.allowedTabs = GUI.defaultAllowedTabsCloudBuild;
Expand Down
11 changes: 0 additions & 11 deletions src/js/tabs/ports.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ ports.initialize = function (callback) {
let enableBlackbox = false;
let enableEsc = false;
let enableGps = false;
let enableVtx = false;

for (const port of FC.SERIAL_CONFIG.ports) {
const func = port.functions;
Expand All @@ -438,10 +437,6 @@ ports.initialize = function (callback) {
if (func.includes('GPS')) {
enableGps = true;
}

if (func.includes('IRC_TRAMP') || func.includes('TBS_SMARTAUDIO') || func.includes('VTX_MSP')) {
enableVtx = true;
}
}

const featureConfig = FC.FEATURE_CONFIG.features;
Expand Down Expand Up @@ -474,12 +469,6 @@ ports.initialize = function (callback) {
featureConfig.disable('GPS');
}

if (enableVtx) {
featureConfig.enable('VTX');
} else {
featureConfig.disable('VTX');
}

mspHelper.sendSerialConfig(save_features);

function save_features() {
Expand Down
1 change: 0 additions & 1 deletion src/js/utils/updateTabList.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ export function updateTabList(features) {
$('#tabs ul.mode-connected li.tab_led_strip').toggle(features.isEnabled('LED_STRIP'));
$('#tabs ul.mode-connected li.tab_transponder').toggle(features.isEnabled('TRANSPONDER'));
$('#tabs ul.mode-connected li.tab_osd').toggle(features.isEnabled('OSD'));
$('#tabs ul.mode-connected li.tab_vtx').toggle(features.isEnabled('VTX'));
}

0 comments on commit c300f71

Please sign in to comment.