mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 08:45:24 +03:00
X7-improvement (#4208)
* Allow autoswitch for LS AND * Add POPUPMENU base edit/clear/copy/paste to LS screen * Add long menu to OUTPUTS screen * Compil fix * Compil fix * Translations for outputs POPMENU 128x64
This commit is contained in:
parent
1642732e8f
commit
651f7b3f93
13 changed files with 94 additions and 38 deletions
|
@ -195,7 +195,7 @@ void menuModelLogicalSwitchOne(event_t event)
|
|||
case LS_FIELD_ANDSW:
|
||||
lcdDrawTextAlignedLeft(y, STR_AND_SWITCH);
|
||||
drawSwitch(CSWONE_2ND_COLUMN, y, cs->andsw, attr);
|
||||
if (attr) CHECK_INCDEC_MODELVAR_CHECK(event, cs->andsw, -MAX_LS_ANDSW, MAX_LS_ANDSW, isSwitchAvailableInLogicalSwitches);
|
||||
if (attr) CHECK_INCDEC_MODELSWITCH(event, cs->andsw, -MAX_LS_ANDSW, MAX_LS_ANDSW, isSwitchAvailableInLogicalSwitches);
|
||||
break;
|
||||
|
||||
case LS_FIELD_DURATION:
|
||||
|
@ -219,6 +219,29 @@ void menuModelLogicalSwitchOne(event_t event)
|
|||
}
|
||||
}
|
||||
|
||||
void onLogicalSwitchesMenu(const char *result)
|
||||
{
|
||||
int8_t sub = menuVerticalPosition;
|
||||
LogicalSwitchData * cs = lswAddress(sub);
|
||||
|
||||
if (result == STR_EDIT) {
|
||||
pushMenu(menuModelLogicalSwitchOne);
|
||||
}
|
||||
|
||||
if (result == STR_COPY) {
|
||||
clipboard.type = CLIPBOARD_TYPE_CUSTOM_SWITCH;
|
||||
clipboard.data.csw = *cs;
|
||||
}
|
||||
else if (result == STR_PASTE) {
|
||||
*cs = clipboard.data.csw;
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
else if (result == STR_CLEAR) {
|
||||
memset(cs, 0, sizeof(LogicalSwitchData));
|
||||
storageDirty(EE_MODEL);
|
||||
}
|
||||
}
|
||||
|
||||
void menuModelLogicalSwitches(event_t event)
|
||||
{
|
||||
SIMPLE_MENU(STR_MENULOGICALSWITCHES, menuTabModel, MENU_MODEL_LOGICAL_SWITCHES, HEADER_LINE+MAX_LOGICAL_SWITCHES);
|
||||
|
@ -227,19 +250,19 @@ void menuModelLogicalSwitches(event_t event)
|
|||
uint8_t k = 0;
|
||||
int8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||
|
||||
switch (event) {
|
||||
#if defined(ROTARY_ENCODER_NAVIGATION)
|
||||
case EVT_ROTARY_BREAK:
|
||||
#endif
|
||||
#if !defined(PCBX7)
|
||||
case EVT_KEY_FIRST(KEY_RIGHT):
|
||||
#endif
|
||||
case EVT_KEY_FIRST(KEY_ENTER):
|
||||
if (sub >= 0) {
|
||||
s_currIdx = sub;
|
||||
pushMenu(menuModelLogicalSwitchOne);
|
||||
}
|
||||
break;
|
||||
if (event==EVT_KEY_FIRST(KEY_ENTER)) {
|
||||
killEvents(event);
|
||||
LogicalSwitchData * cs = lswAddress(sub);
|
||||
if (cs->func)
|
||||
s_currIdx = sub;
|
||||
POPUP_MENU_ADD_ITEM(STR_EDIT);
|
||||
if (cs->func || cs->v1 || cs->v2 || cs->delay || cs->duration || cs->andsw)
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY);
|
||||
if (clipboard.type == CLIPBOARD_TYPE_CUSTOM_SWITCH)
|
||||
POPUP_MENU_ADD_ITEM(STR_PASTE);
|
||||
if (cs->func || cs->v1 || cs->v2 || cs->delay || cs->duration || cs->andsw)
|
||||
POPUP_MENU_ADD_ITEM(STR_CLEAR);
|
||||
POPUP_MENU_START(onLogicalSwitchesMenu);
|
||||
}
|
||||
|
||||
for (uint8_t i=0; i<LCD_LINES-1; i++) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Copyright (C) OpenTX
|
||||
*
|
||||
* Based on code named
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
|
@ -87,6 +87,29 @@ enum MenuModelOutputsItems {
|
|||
#define MIN_MAX_DISPLAY(x) ((int8_t)(x))
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
void onLimitsMenu(const char *result)
|
||||
{
|
||||
int ch = menuVerticalPosition;
|
||||
|
||||
if (result == STR_RESET) {
|
||||
LimitData *ld = limitAddress(ch);
|
||||
ld->min = 0;
|
||||
ld->max = 0;
|
||||
ld->offset = 0;
|
||||
ld->ppmCenter = 0;
|
||||
ld->revert = false;
|
||||
ld->curve = 0;
|
||||
}
|
||||
else if (result == STR_COPY_STICKS_TO_OFS) {
|
||||
copySticksToOffset(ch);
|
||||
}
|
||||
else if (result == STR_COPY_TRIMS_TO_OFS) {
|
||||
copyTrimsToOffset(ch);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuModelLimits(event_t event)
|
||||
{
|
||||
uint8_t sub = menuVerticalPosition - HEADER_LINE;
|
||||
|
@ -144,9 +167,19 @@ void menuModelLimits(event_t event)
|
|||
#endif
|
||||
|
||||
limit_min_max_t limit = (g_model.extendedLimits ? LIMIT_EXT_MAX : 100);
|
||||
|
||||
|
||||
putsChn(0, y, k+1, IS_LINE_SELECTED(sub, k) ? INVERS : 0);
|
||||
|
||||
#if defined(CPUARM)
|
||||
if (sub==k && CURSOR_ON_LINE() && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
|
||||
killEvents(event);
|
||||
POPUP_MENU_ADD_ITEM(STR_RESET);
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY_TRIMS_TO_OFS);
|
||||
POPUP_MENU_ADD_ITEM(STR_COPY_STICKS_TO_OFS);
|
||||
POPUP_MENU_START(onLimitsMenu);
|
||||
}
|
||||
#endif
|
||||
|
||||
for (uint8_t j=0; j<ITEM_OUTPUTS_COUNT; j++) {
|
||||
uint8_t attr = ((sub==k && menuHorizontalPosition==j) ? ((s_editMode>0) ? BLINK|INVERS : INVERS) : 0);
|
||||
uint8_t active = (attr && (s_editMode>0 || p1valdiff)) ;
|
||||
|
|
|
@ -1107,8 +1107,8 @@
|
|||
#define TR_PT "č."
|
||||
#define TR_PTS " b."
|
||||
#define TR_SMOOTH "Hladká"
|
||||
#define TR_COPY_STICKS_TO_OFS "Kopie pák do subtrimu"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Kopíe trimů do subtrimu"
|
||||
#define TR_COPY_STICKS_TO_OFS TR("Cpy stick->subtrim","Kopie pák do subtrimu")
|
||||
#define TR_COPY_TRIMS_TO_OFS TR("Cpy trim->subtrim", "Kopíe trimů do subtrimu")
|
||||
#define TR_INCDEC "Zvěšit/Zmenšit"
|
||||
#define TR_GLOBALVAR "Glob. proměnná"
|
||||
#define TR_MIXSOURCE "Zdroje mixeru"
|
||||
|
|
|
@ -1107,8 +1107,8 @@
|
|||
#define TR_PT "Pt"
|
||||
#define TR_PTS "Pts"
|
||||
#define TR_SMOOTH "Runden"
|
||||
#define TR_COPY_STICKS_TO_OFS "Kopie Stick to Servo-Mitte"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Kopie Trimm to Servo-Mitte" // "Trim to Subtrim"
|
||||
#define TR_COPY_STICKS_TO_OFS TR("Cpy stick->subtrim", "Kopie Stick to Servo-Mitte")
|
||||
#define TR_COPY_TRIMS_TO_OFS TR("Cpy trim->subtrim", "Kopie Trimm to Servo-Mitte") // "Trim to Subtrim"
|
||||
#define TR_INCDEC "Inc/Decrement"
|
||||
#define TR_GLOBALVAR "Global Var"
|
||||
#define TR_MIXSOURCE "Mixer Quelle"
|
||||
|
|
|
@ -1082,8 +1082,8 @@
|
|||
#define TR_PT "pt"
|
||||
#define TR_PTS "pts"
|
||||
#define TR_SMOOTH "Smooth"
|
||||
#define TR_COPY_STICKS_TO_OFS "Copy sticks to subtrim"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Copy trims to subtrim"
|
||||
#define TR_COPY_STICKS_TO_OFS TR("Cpy stick->subtrim", "Copy sticks to subtrim")
|
||||
#define TR_COPY_TRIMS_TO_OFS TR("Cpy trim->subtrim", "Copy trims to subtrim")
|
||||
#define TR_INCDEC "Inc/Decrement"
|
||||
#define TR_GLOBALVAR "Global var"
|
||||
#define TR_MIXSOURCE "Mixer source"
|
||||
|
|
|
@ -1055,8 +1055,8 @@
|
|||
#define TR_PT "pt"
|
||||
#define TR_PTS "pts"
|
||||
#define TR_SMOOTH "Smooth"
|
||||
#define TR_COPY_STICKS_TO_OFS "Copy Sticks To Offset"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Copy trims to subtrim"
|
||||
#define TR_COPY_STICKS_TO_OFS TR("Cpy stick->subtrim", "Copy Sticks To Offset")
|
||||
#define TR_COPY_TRIMS_TO_OFS TR("Cpy trim->subtrim", "Copy trims to subtrim")
|
||||
#define TR_INCDEC "Inc/Decrement"
|
||||
#define TR_GLOBALVAR "Global Var"
|
||||
#define TR_MIXSOURCE "Mixer Source"
|
||||
|
|
|
@ -1055,8 +1055,8 @@
|
|||
#define TR_PT "pt"
|
||||
#define TR_PTS "pts"
|
||||
#define TR_SMOOTH "Smooth"
|
||||
#define TR_COPY_STICKS_TO_OFS "Copy Sticks To Offset"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Copy trims to subtrim"
|
||||
#define TR_COPY_STICKS_TO_OFS TR("Cpy stick->subtrim", "Copy Sticks To Offset")
|
||||
#define TR_COPY_TRIMS_TO_OFS TR("Cpy trim->subtrim", "Copy trims to subtrim")
|
||||
#define TR_INCDEC "Inc/Decrement"
|
||||
#define TR_GLOBALVAR "Global Var"
|
||||
#define TR_MIXSOURCE "Mixer Source"
|
||||
|
|
|
@ -1089,8 +1089,8 @@
|
|||
#define TR_PT "pt"
|
||||
#define TR_PTS "pts"
|
||||
#define TR_SMOOTH "Lissage"
|
||||
#define TR_COPY_STICKS_TO_OFS "Manche vers subtrim"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Trim vers subtrim"
|
||||
#define TR_COPY_STICKS_TO_OFS TR("Cpy stick->subtrim", "Manche vers subtrim")
|
||||
#define TR_COPY_TRIMS_TO_OFS TR("Cpy trim->subtrim", "Trim vers subtrim")
|
||||
#define TR_INCDEC "Inc/décrementer"
|
||||
#define TR_GLOBALVAR "Var. globale"
|
||||
#define TR_MIXSOURCE "Source mixeur"
|
||||
|
|
|
@ -1090,8 +1090,8 @@
|
|||
#define TR_PT "pt"
|
||||
#define TR_PTS "pti"
|
||||
#define TR_SMOOTH "Smussa"
|
||||
#define TR_COPY_STICKS_TO_OFS "Copia Stick su Offset"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Copia Trim in Subtrim"
|
||||
#define TR_COPY_STICKS_TO_OFS TR("Cpy stick->subtrim", "Copia Stick su Offset")
|
||||
#define TR_COPY_TRIMS_TO_OFS TR("Cpy trim->subtrim", "Copia Trim in Subtrim")
|
||||
#define TR_INCDEC "Inc/Decrementa"
|
||||
#define TR_GLOBALVAR "Var Globale"
|
||||
#define TR_MIXSOURCE "Sorgente Mixer"
|
||||
|
|
|
@ -1084,8 +1084,8 @@
|
|||
#define TR_PT "Pt"
|
||||
#define TR_PTS "Ptn"
|
||||
#define TR_SMOOTH "Zacht"
|
||||
#define TR_COPY_STICKS_TO_OFS "Kopieer Sticks naar Subtrim"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Kopieer Trim naar Subtrim"
|
||||
#define TR_COPY_STICKS_TO_OFS TR("Cpy stick->subtrim", "Kopieer Sticks naar Subtrim")
|
||||
#define TR_COPY_TRIMS_TO_OFS TR("Cpy trim->subtrim", "Kopieer Trim naar Subtrim")
|
||||
#define TR_INCDEC "Inc/Decrement"
|
||||
#define TR_GLOBALVAR "Globale Var"
|
||||
#define TR_MIXSOURCE "Mixer Bron"
|
||||
|
|
|
@ -1092,8 +1092,8 @@
|
|||
#define TR_PT "pkt"
|
||||
#define TR_PTS "pkty"
|
||||
#define TR_SMOOTH "Gładka"
|
||||
#define TR_COPY_STICKS_TO_OFS "Skopiuj Drążki Do Offsetu"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Skopiuj Trymery Do subtrymerów"
|
||||
#define TR_COPY_STICKS_TO_OFS TR("Cpy stick->subtrim", "Skopiuj Drążki Do Offsetu")
|
||||
#define TR_COPY_TRIMS_TO_OFS TR("Cpy trim->subtrim", "Skopiuj Trymery Do subtrymerów")
|
||||
#define TR_INCDEC "Zwiększ/Zmnie"
|
||||
#define TR_GLOBALVAR "Zm.Global."
|
||||
#define TR_MIXSOURCE "Źródło Miks."
|
||||
|
|
|
@ -1050,8 +1050,8 @@
|
|||
#define TR_PT "pt"
|
||||
#define TR_PTS "pts"
|
||||
#define TR_SMOOTH "Smooth"
|
||||
#define TR_COPY_STICKS_TO_OFS "Copy Sticks To Offset"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Copy trims to subtrim"
|
||||
#define TR_COPY_STICKS_TO_OFS TR("Cpy stick->subtrim", "Copy Sticks To Offset")
|
||||
#define TR_COPY_TRIMS_TO_OFS TR("Cpy trim->subtrim", "Copy trims to subtrim")
|
||||
#define TR_INCDEC "Inc/Decrement"
|
||||
#define TR_GLOBALVAR "Global Var"
|
||||
#define TR_MIXSOURCE "Mixer Source"
|
||||
|
|
|
@ -1095,8 +1095,8 @@
|
|||
#define TR_PT "pt"
|
||||
#define TR_PTS "pkt"
|
||||
#define TR_SMOOTH "Mjuk"
|
||||
#define TR_COPY_STICKS_TO_OFS "Spara spakar som subtrim"
|
||||
#define TR_COPY_TRIMS_TO_OFS "Spara trimmar som subtrim"
|
||||
#define TR_COPY_STICKS_TO_OFS TR("Cpy stick->subtrim", "Spara spakar som subtrim")
|
||||
#define TR_COPY_TRIMS_TO_OFS TR("Cpy trim->subtrim", "Spara trimmar som subtrim")
|
||||
#define TR_INCDEC "Inkr/Dekrement"
|
||||
#define TR_GLOBALVAR "Globala Var"
|
||||
#define TR_MIXSOURCE "Mixer Källa"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue