From 6fd47d7b54c089c4e813cb6b2fa95bbdfd779adb Mon Sep 17 00:00:00 2001 From: shane-droid <61736830+shane-droid@users.noreply.github.com> Date: Tue, 14 Jun 2022 07:56:37 +0000 Subject: [PATCH] update gui for new logic switch type --- radio/src/dataconstants.h | 1 + radio/src/datastructs.h | 24 +++++++++---------- radio/src/datastructs_private.h | 1 + .../gui/colorlcd/model_logical_switches.cpp | 21 +++++++++++----- .../storage/yaml/yaml_datastructs_nv14.cpp | 3 ++- .../src/storage/yaml/yaml_datastructs_t12.cpp | 3 ++- .../src/storage/yaml/yaml_datastructs_t8.cpp | 3 ++- .../storage/yaml/yaml_datastructs_tlite.cpp | 3 ++- .../storage/yaml/yaml_datastructs_tpro.cpp | 3 ++- .../storage/yaml/yaml_datastructs_tx12.cpp | 3 ++- .../src/storage/yaml/yaml_datastructs_x10.cpp | 3 ++- .../storage/yaml/yaml_datastructs_x12s.cpp | 3 ++- .../src/storage/yaml/yaml_datastructs_x7.cpp | 3 ++- .../src/storage/yaml/yaml_datastructs_x9d.cpp | 3 ++- .../src/storage/yaml/yaml_datastructs_x9e.cpp | 3 ++- .../storage/yaml/yaml_datastructs_x9lite.cpp | 3 ++- .../storage/yaml/yaml_datastructs_x9lites.cpp | 3 ++- .../storage/yaml/yaml_datastructs_xlite.cpp | 3 ++- .../storage/yaml/yaml_datastructs_xlites.cpp | 3 ++- .../storage/yaml/yaml_datastructs_zorro.cpp | 3 ++- radio/src/translations.cpp | 1 + radio/src/translations.h | 1 + radio/src/translations/en.h | 1 + 23 files changed, 64 insertions(+), 34 deletions(-) diff --git a/radio/src/dataconstants.h b/radio/src/dataconstants.h index 44483ba48af..ecd2980f17e 100644 --- a/radio/src/dataconstants.h +++ b/radio/src/dataconstants.h @@ -134,6 +134,7 @@ enum CurveType { #endif #define LEN_SPEC_FN_NAME 10 +#define LEN_LOGICSW_NAME 10 #if defined(PCBFRSKY) || defined(PCBNV14) #define NUM_MODULES 2 diff --git a/radio/src/datastructs.h b/radio/src/datastructs.h index fa04d4631a9..2df5680fc2a 100644 --- a/radio/src/datastructs.h +++ b/radio/src/datastructs.h @@ -51,7 +51,7 @@ static inline void check_struct() CHKSIZE(MixData, 20); CHKSIZE(ExpoData, 17); CHKSIZE(LimitData, 11); - CHKSIZE(LogicalSwitchData, 9); + CHKSIZE(LogicalSwitchData, 19); CHKSIZE(CustomFunctionData, 21); CHKSIZE(FlightModeData, 28 + 2*NUM_TRIMS); CHKSIZE(TimerData, 11); @@ -65,7 +65,7 @@ static inline void check_struct() CHKSIZE(MixData, 20); CHKSIZE(ExpoData, 17); CHKSIZE(LimitData, 13); - CHKSIZE(LogicalSwitchData, 9); + CHKSIZE(LogicalSwitchData, 19); CHKSIZE(CustomFunctionData, 21); CHKSIZE(FlightModeData, 40); CHKSIZE(TimerData, 16); @@ -109,7 +109,7 @@ static inline void check_struct() #endif /* board specific ifdefs*/ - CHKSIZE(LogicalSwitchData, 9); + CHKSIZE(LogicalSwitchData, 19); CHKSIZE(TelemetrySensor, 14); CHKSIZE(ModuleData, 29); CHKSIZE(GVarData, 7); @@ -118,33 +118,33 @@ static inline void check_struct() #if defined(PCBXLITES) CHKSIZE(RadioData, 1501); - CHKSIZE(ModelData, 6801); + CHKSIZE(ModelData, 7441); #elif defined(PCBXLITE) CHKSIZE(RadioData, 1499); - CHKSIZE(ModelData, 6801); + CHKSIZE(ModelData, 7441); #elif defined(RADIO_TPRO) CHKSIZE(RadioData, 1482); - CHKSIZE(ModelData, 6826); + CHKSIZE(ModelData, 7466); #elif defined(PCBX7) CHKSIZE(RadioData, 1505); - CHKSIZE(ModelData, 6801); + CHKSIZE(ModelData, 7441); #elif defined(PCBX9E) CHKSIZE(RadioData, 1595); - CHKSIZE(ModelData, 7253); + CHKSIZE(ModelData, 7893); #elif defined(PCBX9D) || defined(PCBX9DP) CHKSIZE(RadioData, 1537); - CHKSIZE(ModelData, 7245); + CHKSIZE(ModelData, 7885); #elif defined(PCBHORUS) #if defined(PCBX10) CHKSIZE(RadioData, 1561); - CHKSIZE(ModelData, 11665); + CHKSIZE(ModelData, 12305); #else CHKSIZE(RadioData, 1543); - CHKSIZE(ModelData, 11663); + CHKSIZE(ModelData, 12303); #endif #elif defined(PCBNV14) CHKSIZE(RadioData, 1491); - CHKSIZE(ModelData, 11479); + CHKSIZE(ModelData, 12119); #endif #undef CHKSIZE diff --git a/radio/src/datastructs_private.h b/radio/src/datastructs_private.h index e108346be61..94ddb70c0d6 100644 --- a/radio/src/datastructs_private.h +++ b/radio/src/datastructs_private.h @@ -138,6 +138,7 @@ PACK(struct LogicalSwitchData { int16_t v2 SKIP; uint8_t delay; uint8_t duration; + NOBACKUP(char custName[LEN_LOGICSW_NAME]); }); /* diff --git a/radio/src/gui/colorlcd/model_logical_switches.cpp b/radio/src/gui/colorlcd/model_logical_switches.cpp index 5821aff6faf..c1355e9f090 100644 --- a/radio/src/gui/colorlcd/model_logical_switches.cpp +++ b/radio/src/gui/colorlcd/model_logical_switches.cpp @@ -94,7 +94,10 @@ class LogicalSwitchEditPage: public Page LogicalSwitchData * cs = lswAddress(index); uint8_t cstate = lswFamily(cs->func); - + // custom label + new StaticText(logicalSwitchOneWindow, grid.getLabelSlot(), STR_CUST_LOGICALSWITCH_LABEL, 0, COLOR_THEME_PRIMARY1); + new ModelTextEdit(logicalSwitchOneWindow, grid.getFieldSlot(), cs->custName, LEN_LOGICSW_NAME); + grid.nextLine(); if (cstate == LS_FAMILY_BOOL || cstate == LS_FAMILY_STICKY || cs->func == LS_FUNC_SAFE) { new StaticText(logicalSwitchOneWindow, grid.getLabelSlot(), STR_V1, 0, COLOR_THEME_PRIMARY1); auto choice = new SwitchChoice(logicalSwitchOneWindow, grid.getFieldSlot(), SWSRC_FIRST_IN_LOGICAL_SWITCHES, SWSRC_LAST_IN_LOGICAL_SWITCHES, GET_SET_DEFAULT(cs->v1)); @@ -255,6 +258,7 @@ class LogicalSwitchEditPage: public Page static constexpr coord_t line1 = FIELD_PADDING_TOP; static constexpr coord_t line2 = line1 + PAGE_LINE_HEIGHT; +static constexpr coord_t line3 = line2 + PAGE_LINE_HEIGHT; static constexpr coord_t col1 = 20; static constexpr coord_t col2 = (LCD_W - 100) / 3 + col1; static constexpr coord_t col3 = ((LCD_W - 100) / 3) * 2 + col1; @@ -291,8 +295,8 @@ class LogicalSwitchButton : public Button uint8_t lsFamily = lswFamily(ls->func); // CSW func - dc->drawTextAtIndex(col1, line1, STR_VCSWFUNC, ls->func, COLOR_THEME_SECONDARY1); - + //dc->drawTextAtIndex(col1, line1, STR_VCSWFUNC, ls->func, COLOR_THEME_SECONDARY1); + dc->drawText(col1, line1, ls->custName, COLOR_THEME_SECONDARY1); // CSW params if (lsFamily == LS_FAMILY_BOOL || lsFamily == LS_FAMILY_STICKY || ls->func ==LS_FUNC_SAFE) { drawSwitch(dc, col2, line1, ls->v1, COLOR_THEME_SECONDARY1); @@ -324,15 +328,20 @@ class LogicalSwitchButton : public Button if (lsFamily != LS_FAMILY_EDGE && ls->delay > 0) { dc->drawNumber(col3, line2, ls->delay, COLOR_THEME_SECONDARY1 | PREC1 | LEFT); } + // switch custom name + //dc->drawText(col1, line3, "somename", COLOR_THEME_SECONDARY1); } void paint(BitmapBuffer* dc) override { - if (active) + if (active){ dc->drawSolidFilledRect(0, 0, rect.w, rect.h, COLOR_THEME_ACTIVE); - else + dc->drawText(col1, line3, "somename", COLOR_THEME_SECONDARY1); + } + else{ dc->drawSolidFilledRect(0, 0, rect.w, rect.h, COLOR_THEME_PRIMARY2); - + dc->drawText(col1, line3, "somename", COLOR_THEME_SECONDARY1); + } paintLogicalSwitchLine(dc); // The bounding rect diff --git a/radio/src/storage/yaml/yaml_datastructs_nv14.cpp b/radio/src/storage/yaml/yaml_datastructs_nv14.cpp index dc8603783a3..9772a5bb1f3 100644 --- a/radio/src/storage/yaml/yaml_datastructs_nv14.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_nv14.cpp @@ -545,6 +545,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -859,7 +860,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 152, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 320, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_t12.cpp b/radio/src/storage/yaml/yaml_datastructs_t12.cpp index 4f094fa8d8b..d5810f00411 100644 --- a/radio/src/storage/yaml/yaml_datastructs_t12.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_t12.cpp @@ -512,6 +512,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -829,7 +830,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_t8.cpp b/radio/src/storage/yaml/yaml_datastructs_t8.cpp index 5b3c5430cbc..1af20a6a37f 100644 --- a/radio/src/storage/yaml/yaml_datastructs_t8.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_t8.cpp @@ -512,6 +512,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -829,7 +830,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_tlite.cpp b/radio/src/storage/yaml/yaml_datastructs_tlite.cpp index 5b3c5430cbc..1af20a6a37f 100644 --- a/radio/src/storage/yaml/yaml_datastructs_tlite.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_tlite.cpp @@ -512,6 +512,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -829,7 +830,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_tpro.cpp b/radio/src/storage/yaml/yaml_datastructs_tpro.cpp index 6c88549b6eb..fd72d4407e1 100644 --- a/radio/src/storage/yaml/yaml_datastructs_tpro.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_tpro.cpp @@ -518,6 +518,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -835,7 +836,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_tx12.cpp b/radio/src/storage/yaml/yaml_datastructs_tx12.cpp index 967a305ed24..f4ef8e29eb5 100644 --- a/radio/src/storage/yaml/yaml_datastructs_tx12.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_tx12.cpp @@ -512,6 +512,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -829,7 +830,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_x10.cpp b/radio/src/storage/yaml/yaml_datastructs_x10.cpp index 5e68f8c571d..b660b23eb43 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x10.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x10.cpp @@ -565,6 +565,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -879,7 +880,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 152, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 352, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_x12s.cpp b/radio/src/storage/yaml/yaml_datastructs_x12s.cpp index a4a04c5775d..2a9b685f803 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x12s.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x12s.cpp @@ -563,6 +563,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -877,7 +878,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 152, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 352, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_x7.cpp b/radio/src/storage/yaml/yaml_datastructs_x7.cpp index 5b3c5430cbc..1af20a6a37f 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x7.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x7.cpp @@ -512,6 +512,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -829,7 +830,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_x9d.cpp b/radio/src/storage/yaml/yaml_datastructs_x9d.cpp index a569bc4a9b9..bc406fdf203 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9d.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9d.cpp @@ -520,6 +520,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -842,7 +843,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 320, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_x9e.cpp b/radio/src/storage/yaml/yaml_datastructs_x9e.cpp index 41e6b3d53ca..70e49e6e944 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9e.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9e.cpp @@ -559,6 +559,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -881,7 +882,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 320, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_x9lite.cpp b/radio/src/storage/yaml/yaml_datastructs_x9lite.cpp index bd2cb3a17f1..c5259ff9e87 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9lite.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9lite.cpp @@ -497,6 +497,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -814,7 +815,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_x9lites.cpp b/radio/src/storage/yaml/yaml_datastructs_x9lites.cpp index 90598d01591..f3172b7c697 100644 --- a/radio/src/storage/yaml/yaml_datastructs_x9lites.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_x9lites.cpp @@ -507,6 +507,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -824,7 +825,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_xlite.cpp b/radio/src/storage/yaml/yaml_datastructs_xlite.cpp index d5c082bf5c2..e65922db7bf 100644 --- a/radio/src/storage/yaml/yaml_datastructs_xlite.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_xlite.cpp @@ -504,6 +504,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -821,7 +822,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_xlites.cpp b/radio/src/storage/yaml/yaml_datastructs_xlites.cpp index 40697f626aa..bcf631bd2b0 100644 --- a/radio/src/storage/yaml/yaml_datastructs_xlites.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_xlites.cpp @@ -508,6 +508,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -825,7 +826,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/storage/yaml/yaml_datastructs_zorro.cpp b/radio/src/storage/yaml/yaml_datastructs_zorro.cpp index ab1b75ffa28..255fbad8714 100644 --- a/radio/src/storage/yaml/yaml_datastructs_zorro.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_zorro.cpp @@ -512,6 +512,7 @@ static const struct YamlNode struct_LogicalSwitchData[] = { YAML_PADDING( 16 ), YAML_UNSIGNED( "delay", 8 ), YAML_UNSIGNED( "duration", 8 ), + YAML_STRING("custName", 10), YAML_END }; static const struct YamlNode struct_SwashRingData[] = { @@ -829,7 +830,7 @@ static const struct YamlNode struct_ModelData[] = { YAML_ARRAY("expoData", 136, 64, struct_ExpoData, NULL), YAML_ARRAY("curves", 32, 32, struct_CurveHeader, NULL), YAML_ARRAY("points", 8, 512, struct_signed_8, NULL), - YAML_ARRAY("logicalSw", 72, 64, struct_LogicalSwitchData, NULL), + YAML_ARRAY("logicalSw", 152, 64, struct_LogicalSwitchData, NULL), YAML_ARRAY("customFn", 168, 64, struct_CustomFunctionData, cfn_is_active), YAML_STRUCT("swashR", 64, struct_SwashRingData, swash_is_active), YAML_ARRAY("flightModeData", 288, 9, struct_FlightModeData, fmd_is_active), diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index 04464d7a4e5..e0803d5d77b 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -265,6 +265,7 @@ const char STR_MENUCURVES[] = TR_MENUCURVES; const char STR_MENUCURVE[] = TR_MENUCURVE; const char STR_MENULOGICALSWITCH[] = TR_MENULOGICALSWITCH; const char STR_MENULOGICALSWITCHES[] = TR_MENULOGICALSWITCHES; +const char STR_CUST_LOGICALSWITCH_LABEL[] = TR_CUST_LOGICALSWITCH_LABEL; const char STR_MENUCUSTOMFUNC[] = TR_MENUCUSTOMFUNC; const char STR_CUST_FUNC_CUST_LABEL[] = TR_CUST_FUNC_CUST_LABEL; const char STR_SPLASHSCREEN[] = TR_SPLASHSCREEN; diff --git a/radio/src/translations.h b/radio/src/translations.h index f3312477498..5f00d782a7c 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -420,6 +420,7 @@ extern const char STR_MENUCURVES[]; extern const char STR_MENUCURVE[]; extern const char STR_MENULOGICALSWITCH[]; extern const char STR_MENULOGICALSWITCHES[]; +extern const char STR_CUST_LOGICALSWITCH_LABEL[]; extern const char STR_MENUCUSTOMFUNC[]; extern const char STR_CUST_FUNC_CUST_LABEL[]; extern const char STR_MENUCUSTOMSCRIPTS[]; diff --git a/radio/src/translations/en.h b/radio/src/translations/en.h index 27f68cbe508..eb54bf06b25 100644 --- a/radio/src/translations/en.h +++ b/radio/src/translations/en.h @@ -512,6 +512,7 @@ #define TR_MENUCURVE "CURVE" #define TR_MENULOGICALSWITCH "LOGICAL SWITCH" #define TR_MENULOGICALSWITCHES "LOGICAL SWITCHES" +#define TR_CUST_LOGICALSWITCH_LABEL "Name" #define TR_MENUCUSTOMFUNC "SPECIAL FUNCTIONS" #define TR_CUST_FUNC_CUST_LABEL "Name" #define TR_MENUCUSTOMSCRIPTS "CUSTOM SCRIPTS"