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
+12 -2
View File
@@ -39,6 +39,8 @@ enum MixFields {
MIX_FIELD_COUNT
};
extern uint8_t FM_ROW(uint8_t);
void drawOffsetBar(uint8_t x, uint8_t y, MixData * md)
{
const int gaugeWidth = 33;
@@ -97,14 +99,21 @@ void menuModelMixOne(event_t event)
uint8_t old_editMode = s_editMode;
SUBMENU(STR_MIXES, MIX_FIELD_COUNT, {0, 0, 0, 0, 0, 1, CASE_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/});
SUBMENU(STR_MIXES, MIX_FIELD_COUNT,
{0, 0, 0, 0, 0, 1, CASE_FLIGHT_MODES(FM_ROW((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE)) 0, 0 /*, ...*/});
int8_t sub = menuVerticalPosition;
int8_t editMode = s_editMode;
coord_t y = MENU_HEADER_HEIGHT + 1;
for (uint8_t k=0; k<NUM_BODY_LINES; k++) {
coord_t y = MENU_HEADER_HEIGHT + 1 + k*FH;
int i = k + menuVerticalOffset;
for (int j=0; j<=i; ++j) {
if (j<(int)DIM(mstate_tab) && mstate_tab[j] == HIDDEN_ROW) {
++i;
}
}
LcdFlags attr = (sub==i ? INVERS | (editMode>0 ? BLINK : 0) : 0);
switch (i) {
case MIX_FIELD_NAME:
@@ -189,5 +198,6 @@ void menuModelMixOne(event_t event)
md2->speedDown = EDIT_DELAY(y, event, attr, STR_SLOWDOWN, md2->speedDown);
break;
}
y += FH;
}
}