feat: Add options to disable radio and model menu tabs (#3484)

* Add options to disable radio and model menu tabs.
- Update radio and model data structs
- UI for color LCD radios
- Convert existing 'noGlobalFunctions' property.
- Language strings.

* Make 'theme' control specific to color LCD radios.

* Add B&W radio UI.

* Simplify code, reduce compiled code size.
Fix page count display on model select tab.
Fix GVARS for 212x64 radios.

* Collapse timer sections if timer is off.

* Remove 'Use global functions' checkbox from B&W model setup.

* Make preflight checks, throttle and view options sections expand & collapse (default collapsed).

* Fix build.

* Add view options to companion data classes, save and load values in YAML files.
Fix scrolling for radio setup view options.

* Add Companion UI for view option settings.

* Remove 'Mixes' from list of tabs that can be hidden.

* Updated Companion UI from elecpower.

* Use view options flags to enable/disable functionality:
- skip heli mixer logic if heli not enabled
- Remove heli, gvars and telemetry options from source selection if not enabled

* Remove 'flight mode', 'curve' and 'global variable' settings from input & mix editors if option disabled.

* Rename 'View Options' to 'Enabled Features'.
Put GVAR option under Flight Mode and indent text.
Make relationship between FM and GV more obvious.

* Remove global variable option dependency on flight modes.
Hide FM1-FM8 in global variables if flight modes hidden.

* Hide 'Custom Mixer Scripts' in source selection menu popup if disabled.

* Add translation strings for Hebrew language file.

* Fix typo. Add comment for double call to setCurrentTab.
This commit is contained in:
philmoz
2023-05-22 20:08:16 +10:00
committed by GitHub
parent 04359757c4
commit 5327c890f2
98 changed files with 2459 additions and 452 deletions
+40 -23
View File
@@ -77,16 +77,21 @@ void menuRadioPowerMeter(event_t event);
void menuRadioCalibration(event_t event);
void menuGhostModuleConfig(event_t event);
static const MenuHandlerFunc menuTabGeneral[MENU_RADIO_PAGES_COUNT] = {
extern bool radioGFEnabled();
extern bool radioTrainerEnabled();
static const MenuHandler menuTabGeneral[MENU_RADIO_PAGES_COUNT] = {
#if defined(RADIO_TOOLS)
menuRadioTools,
{ menuRadioTools, nullptr },
#endif
CASE_SDCARD(menuRadioSdManager)
menuRadioSetup,
menuRadioSpecialFunctions,
menuRadioTrainer,
menuRadioHardware,
menuRadioVersion
#if defined(SDCARD)
{ menuRadioSdManager, nullptr },
#endif
{ menuRadioSetup, nullptr },
{ menuRadioSpecialFunctions, radioGFEnabled },
{ menuRadioTrainer, radioTrainerEnabled },
{ menuRadioHardware, nullptr },
{ menuRadioVersion, nullptr }
};
enum MenuModelIndexes {
@@ -135,22 +140,34 @@ void menuModelGVarOne(event_t event);
void menuModelUSBJoystick(event_t event);
#endif
static const MenuHandlerFunc menuTabModel[] = {
menuModelSelect,
menuModelSetup,
CASE_HELI(menuModelHeli)
CASE_FLIGHT_MODES(menuModelFlightModesAll)
menuModelExposAll,
menuModelMixAll,
menuModelLimits,
menuModelCurvesAll,
menuModelLogicalSwitches,
menuModelSpecialFunctions,
#if defined(LUA_MODEL_SCRIPTS)
menuModelCustomScripts,
extern bool modelHeliEnabled();
extern bool modelFMEnabled();
extern bool modelCurvesEnabled();
extern bool modelLSEnabled();
extern bool modelSFEnabled();
extern bool modelCustomScriptsEnabled();
extern bool modelTelemetryEnabled();
static const MenuHandler menuTabModel[] = {
{ menuModelSelect, nullptr },
{ menuModelSetup, nullptr },
#if defined(HELI)
{ menuModelHeli, modelHeliEnabled },
#endif
menuModelTelemetry,
menuModelDisplay,
#if defined(FLIGHT_MODES)
{ menuModelFlightModesAll, modelFMEnabled },
#endif
{ menuModelExposAll, nullptr },
{ menuModelMixAll, nullptr },
{ menuModelLimits, nullptr },
{ menuModelCurvesAll, modelCurvesEnabled },
{ menuModelLogicalSwitches, modelLSEnabled },
{ menuModelSpecialFunctions, modelSFEnabled },
#if defined(LUA_MODEL_SCRIPTS)
{ menuModelCustomScripts, modelCustomScriptsEnabled },
#endif
{ menuModelTelemetry, modelTelemetryEnabled },
{ menuModelDisplay, nullptr }
};
void menuStatisticsView(event_t event);