From abb1d9956213976285c3b140810cb5de39446647 Mon Sep 17 00:00:00 2001 From: raphaelcoeffic Date: Sun, 6 Aug 2023 08:10:08 +0200 Subject: [PATCH] feat: move to full LUA based RGB led --- radio/src/boards/generic_stm32/rgb_leds.cpp | 5 --- radio/src/dataconstants.h | 10 ----- radio/src/functions.cpp | 41 ------------------- .../gui/128x64/model_special_functions.cpp | 19 ++++----- radio/src/lua/api_general.cpp | 26 ++++++++++-- radio/src/lua/api_model.cpp | 2 +- radio/src/lua/interface.cpp | 13 ++++++ radio/src/opentx.h | 3 -- radio/src/sdcard.h | 1 + .../storage/yaml/yaml_datastructs_funcs.cpp | 18 +------- radio/src/translations.cpp | 1 - radio/src/translations.h | 1 - radio/src/translations/cn.h | 1 - radio/src/translations/cz.h | 1 - radio/src/translations/da.h | 1 - radio/src/translations/de.h | 1 - radio/src/translations/en.h | 1 - radio/src/translations/es.h | 1 - radio/src/translations/fi.h | 1 - radio/src/translations/fr.h | 4 -- radio/src/translations/he.h | 1 - radio/src/translations/it.h | 1 - radio/src/translations/jp.h | 1 - radio/src/translations/nl.h | 1 - radio/src/translations/pl.h | 1 - radio/src/translations/pt.h | 1 - radio/src/translations/se.h | 1 - radio/src/translations/tw.h | 1 - radio/util/addtr.py | 2 +- 29 files changed, 49 insertions(+), 112 deletions(-) mode change 100644 => 100755 radio/util/addtr.py diff --git a/radio/src/boards/generic_stm32/rgb_leds.cpp b/radio/src/boards/generic_stm32/rgb_leds.cpp index 78739b59e16..54fee303d04 100644 --- a/radio/src/boards/generic_stm32/rgb_leds.cpp +++ b/radio/src/boards/generic_stm32/rgb_leds.cpp @@ -53,11 +53,6 @@ static void rgbLedTimerCb(TimerHandle_t xTimer) { (void)xTimer; - if (!isFunctionActive(FUNCTION_RGBLED)) { - for (uint8_t i = 0; i < LED_STRIP_LENGTH; i++) { - rgbSetLedColor(i, 0, 0, 0); - } - } ws2812_update(&_led_timer); } diff --git a/radio/src/dataconstants.h b/radio/src/dataconstants.h index 05432b7fd5c..b0b9234406f 100644 --- a/radio/src/dataconstants.h +++ b/radio/src/dataconstants.h @@ -676,16 +676,6 @@ enum ModelOverridableEnable { OVERRIDE_ON }; -// List of modes available for RGB leds -enum FunctionRgbLedsParams { - FUNC_RGBLEDS_LUA, - FUNC_RGBLEDS_WHITE, - FUNC_RGBLEDS_BLUE, - FUNC_RGBLEDS_RED, - FUNC_RGBLEDS_YELLOW, - FUNC_RGBLEDS_GREEN, - FUNC_RGBLEDS_MAX SKIP = FUNC_RGBLEDS_GREEN -}; #define SELECTED_THEME_NAME_LEN 26 #endif // _DATACONSTANTS_H_ diff --git a/radio/src/functions.cpp b/radio/src/functions.cpp index 281e75cb09a..0b08987668b 100644 --- a/radio/src/functions.cpp +++ b/radio/src/functions.cpp @@ -412,47 +412,6 @@ void evalFunctions(const CustomFunctionData * functions, CustomFunctionsContext } break; -#if defined(LED_STRIP_GPIO) - case FUNC_RGB_LED: - newActiveFunctions |= (1u << FUNCTION_RGBLED); - - switch (CFN_PARAM(cfn)) { - case FUNC_RGBLEDS_LUA: - // color values are set using LUA - break; - - case FUNC_RGBLEDS_WHITE: - for (uint8_t i = 0; i < LED_STRIP_LENGTH; i++) { - rgbSetLedColor(i, 50, 50, 50); - } - break; - - case FUNC_RGBLEDS_BLUE: - for (uint8_t i = 0; i < LED_STRIP_LENGTH; i++) { - rgbSetLedColor(i, 0, 0, 50); - } - break; - - case FUNC_RGBLEDS_RED: - for (uint8_t i = 0; i < LED_STRIP_LENGTH; i++) { - rgbSetLedColor(i, 50, 0, 0); - } - break; - - case FUNC_RGBLEDS_YELLOW: - for (uint8_t i = 0; i < LED_STRIP_LENGTH; i++) { - rgbSetLedColor(i, 50, 50, 0); - } - break; - - case FUNC_RGBLEDS_GREEN: - for (uint8_t i = 0; i < LED_STRIP_LENGTH; i++) { - rgbSetLedColor(i, 0, 50, 0); - } - break; - } - break; -#endif #if defined(PXX2) case FUNC_RACING_MODE: if (isRacingModeEnabled()) { diff --git a/radio/src/gui/128x64/model_special_functions.cpp b/radio/src/gui/128x64/model_special_functions.cpp index b9ddf69f5eb..df869c772be 100644 --- a/radio/src/gui/128x64/model_special_functions.cpp +++ b/radio/src/gui/128x64/model_special_functions.cpp @@ -58,6 +58,9 @@ void onCustomFunctionsFileSelectionMenu(const char * result) if (func == FUNC_PLAY_SCRIPT) { strcpy(directory, SCRIPTS_FUNCS_PATH); } + else if (func == FUNC_RGB_LED) { + strcpy(directory, SCRIPTS_RGB_PATH); + } else { strcpy(directory, SOUNDS_PATH); strncpy(directory+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2); @@ -305,7 +308,7 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF } #endif #if defined(SDCARD) - else if (func == FUNC_PLAY_TRACK || func == FUNC_BACKGND_MUSIC || func == FUNC_PLAY_SCRIPT) { + else if (func == FUNC_PLAY_TRACK || func == FUNC_BACKGND_MUSIC || func == FUNC_PLAY_SCRIPT || func==FUNC_RGB_LED) { if (ZEXIST(cfn->play.name)) lcdDrawSizedText(MODEL_SPECIAL_FUNC_3RD_COLUMN-6, y, cfn->play.name, sizeof(cfn->play.name), attr); else @@ -316,15 +319,18 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF if (func==FUNC_PLAY_SCRIPT) { strcpy(directory, SCRIPTS_FUNCS_PATH); } + else if (func==FUNC_RGB_LED) { + strcpy(directory, SCRIPTS_RGB_PATH); + } else { strcpy(directory, SOUNDS_PATH); strncpy(directory+SOUNDS_PATH_LNG_OFS, currentLanguagePack->id, 2); } - if (sdListFiles(directory, func==FUNC_PLAY_SCRIPT ? SCRIPTS_EXT : SOUNDS_EXT, sizeof(cfn->play.name), cfn->play.name)) { + if (sdListFiles(directory, func==FUNC_PLAY_SCRIPT || func==FUNC_RGB_LED ? SCRIPTS_EXT : SOUNDS_EXT, sizeof(cfn->play.name), cfn->play.name)) { POPUP_MENU_START(onCustomFunctionsFileSelectionMenu); } else { - POPUP_WARNING(func==FUNC_PLAY_SCRIPT ? STR_NO_SCRIPTS_ON_SD : STR_NO_SOUNDS_ON_SD); + POPUP_WARNING(func==FUNC_PLAY_SCRIPT || func==FUNC_RGB_LED ? STR_NO_SCRIPTS_ON_SD : STR_NO_SOUNDS_ON_SD); } } break; @@ -354,13 +360,6 @@ void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomF INCDEC_ENABLE_CHECK(isSourceAvailable); } } - else if (func == FUNC_RGB_LED) { - val_max = FUNC_RGBLEDS_MAX; - lcdDrawTextAtIndex(MODEL_SPECIAL_FUNC_3RD_COLUMN, y, STR_FUNCRGBLEDS, val_displayed, attr); - if (active) { - CFN_PARAM(cfn) = CHECK_INCDEC_PARAM(event, val_displayed, val_min, val_max); - } - } #if defined(SDCARD) else if (func == FUNC_LOGS) { val_min = SD_LOGS_PERIOD_MIN; diff --git a/radio/src/lua/api_general.cpp b/radio/src/lua/api_general.cpp index cf24f33daa4..1792c97483b 100644 --- a/radio/src/lua/api_general.cpp +++ b/radio/src/lua/api_general.cpp @@ -2775,9 +2775,9 @@ static int luaGetTrainerStatus(lua_State * L) return 1; } -#if defined(LED_STRIP_GPIO) \ +#if defined(LED_STRIP_GPIO) /*luadoc -@function setRgbLedColor(id, rvalue, bvalue, cvalue) +@function setRGBLedColor(id, rvalue, bvalue, cvalue) @param id: integer identifying a led in the led chain @@ -2787,7 +2787,7 @@ static int luaGetTrainerStatus(lua_State * L) @param bvalue: interger, value of blue channel -@status current Introduced in 2.9 +@status current Introduced in 2.10 */ static int luaSetRgbLedColor(lua_State * L) @@ -2801,6 +2801,23 @@ static int luaSetRgbLedColor(lua_State * L) return 1; } + +/*luadoc +@function applyRGBLedColors() + + Apply RGB led colors previously defined by setRGBLedColor + +@status current Introduced in 2.10 +*/ + +static int luaApplyRGBLedColors(lua_State * L) +{ + + rgbLedColorApply(); + + return 1; +} + #endif #define KEY_EVENTS(xxx, yyy) \ @@ -2890,7 +2907,8 @@ LROT_BEGIN(etxlib, NULL, 0) LROT_FUNCENTRY( getSourceName, luaGetSourceName ) LROT_FUNCENTRY( sources, luaSources ) #if defined(LED_STRIP_GPIO) - LROT_FUNCENTRY(setRgbLedColor, luaSetRgbLedColor ) + LROT_FUNCENTRY(setRGBLedColor, luaSetRgbLedColor ) + LROT_FUNCENTRY(applyRGBLedColors, luaApplyRGBLedColors ) #endif LROT_END(etxlib, NULL, 0) diff --git a/radio/src/lua/api_model.cpp b/radio/src/lua/api_model.cpp index 2b31855f698..ba183a7142c 100644 --- a/radio/src/lua/api_model.cpp +++ b/radio/src/lua/api_model.cpp @@ -1366,7 +1366,7 @@ static int luaModelGetCustomFunction(lua_State *L) lua_newtable(L); lua_pushtableinteger(L, "switch", CFN_SWITCH(cfn)); lua_pushtableinteger(L, "func", CFN_FUNC(cfn)); - if (CFN_FUNC(cfn) == FUNC_PLAY_TRACK || CFN_FUNC(cfn) == FUNC_BACKGND_MUSIC || CFN_FUNC(cfn) == FUNC_PLAY_SCRIPT) { + if (CFN_FUNC(cfn) == FUNC_PLAY_TRACK || CFN_FUNC(cfn) == FUNC_BACKGND_MUSIC || CFN_FUNC(cfn) == FUNC_PLAY_SCRIPT || CFN_FUNC(cfn) == FUNC_RGB_LED) { lua_pushtablenstring(L, "name", cfn->play.name); } else { diff --git a/radio/src/lua/interface.cpp b/radio/src/lua/interface.cpp index bd24e49ff1b..74aca4bc004 100644 --- a/radio/src/lua/interface.cpp +++ b/radio/src/lua/interface.cpp @@ -650,6 +650,19 @@ static bool luaLoadFunctionScript(uint8_t ref) return true; } } + + if (fn -> func == FUNC_RGB_LED && ZEXIST(fn -> play.name)) { + if (luaScriptsCount < MAX_SCRIPTS) { + ScriptInternalData & sid = scriptInternalData[luaScriptsCount++]; + sid.reference = ref; + return luaLoadFile(SCRIPTS_RGB_PATH, fn->play.name, sid); + } + else { + POPUP_WARNING(STR_TOO_MANY_LUA_SCRIPTS); + return true; + } + } + return false; } diff --git a/radio/src/opentx.h b/radio/src/opentx.h index 9d9104176ed..aa5c075cf0e 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -668,9 +668,6 @@ enum FunctionsActive { #if defined(HARDWARE_TOUCH) FUNCTION_DISABLE_TOUCH, #endif -#if defined(LED_STRIP_GPIO) - FUNCTION_RGBLED, -#endif }; #define VARIO_FREQUENCY_ZERO 700/*Hz*/ diff --git a/radio/src/sdcard.h b/radio/src/sdcard.h index ad777092e4d..1fa00553329 100644 --- a/radio/src/sdcard.h +++ b/radio/src/sdcard.h @@ -59,6 +59,7 @@ extern FIL g_oLogFile; #define SCRIPTS_FUNCS_PATH SCRIPTS_PATH PATH_SEPARATOR "FUNCTIONS" #define SCRIPTS_TELEM_PATH SCRIPTS_PATH PATH_SEPARATOR "TELEMETRY" #define SCRIPTS_TOOLS_PATH SCRIPTS_PATH PATH_SEPARATOR "TOOLS" +#define SCRIPTS_RGB_PATH SCRIPTS_PATH PATH_SEPARATOR "RGBLED" #define LEN_FILE_PATH_MAX (sizeof(SCRIPTS_TELEM_PATH)+1) // longest + "/" diff --git a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp index 64f37e55684..e2e7562e19f 100644 --- a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp @@ -1407,19 +1407,10 @@ static void r_customFn(void* user, uint8_t* data, uint32_t bitoffs, } break; - case FUNC_RGB_LED: - // find "," and cut val_len - for (unsigned i=0; i < DIM(_func_rgbled_lookup); i++) { - if (!strncmp(_func_rgbled_lookup[i],val,l_sep)) { - CFN_PARAM(cfn) = i; - break; - } - } - break; - case FUNC_PLAY_TRACK: case FUNC_BACKGND_MUSIC: case FUNC_PLAY_SCRIPT: + case FUNC_RGB_LED: strncpy(cfn->play.name, val, std::min(l_sep, LEN_FUNCTION_NAME)); break; @@ -1623,15 +1614,10 @@ static bool w_customFn(void* user, uint8_t* data, uint32_t bitoffs, if (!wf(opaque, str, strlen(str))) return false; break; - case FUNC_RGB_LED: - // Lua, WHite, Blue, Red, Yellow, Green - str = _func_rgbled_lookup[CFN_PARAM(cfn)]; - if (!wf(opaque, str, strlen(str))) return false; - break; - case FUNC_PLAY_TRACK: case FUNC_BACKGND_MUSIC: case FUNC_PLAY_SCRIPT: + case FUNC_RGB_LED: if (!wf(opaque, cfn->play.name, strnlen(cfn->play.name, LEN_FUNCTION_NAME))) return false; break; diff --git a/radio/src/translations.cpp b/radio/src/translations.cpp index 65b8e135bb1..72a3bc2c048 100644 --- a/radio/src/translations.cpp +++ b/radio/src/translations.cpp @@ -45,7 +45,6 @@ ISTR(VMLTPX2); ISTR(VCSWFUNC); ISTR(VFSWRESET); ISTR(FUNCSOUNDS); -ISTR(FUNCRGBLEDS); ISTR(VTELEMUNIT); ISTR(GPSFORMAT); ISTR(VTELEMSCREENTYPE); diff --git a/radio/src/translations.h b/radio/src/translations.h index e7f5db88486..c489270c9a5 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -156,7 +156,6 @@ extern const char* const STR_VMLTPX2[]; extern const char* const STR_VCSWFUNC[]; extern const char* const STR_VFSWRESET[]; extern const char* const STR_FUNCSOUNDS[]; -extern const char* const STR_FUNCRGBLEDS[]; extern const char* const STR_VTELEMUNIT[]; extern const char* const STR_GPSFORMAT[]; extern const char* const STR_VTELEMSCREENTYPE[]; diff --git a/radio/src/translations/cn.h b/radio/src/translations/cn.h index 866723f63d0..ee6495033aa 100644 --- a/radio/src/translations/cn.h +++ b/radio/src/translations/cn.h @@ -123,7 +123,6 @@ #define TR_VFSWRESET TR_FSW_RESET_TIMERS,TR("全部","飞行"),TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/src/translations/cz.h b/radio/src/translations/cz.h index 76e431706a4..c7172a69bb0 100644 --- a/radio/src/translations/cz.h +++ b/radio/src/translations/cz.h @@ -135,7 +135,6 @@ #endif #define TR_VFSWRESET TR_FSW_RESET_TIMERS,"Vše",TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Píp1","Pípnutí1"),TR("Píp2","Pípnutí2"),TR("Píp3","Pípnutí3"),TR("Var1","Varování1"),TR("Var2","Varování2"),TR("Chee","Cheep"),TR("Rata", "Ratata"),"Tick",TR("Sirn","Siréna"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/src/translations/da.h b/radio/src/translations/da.h index 0b8aa13a100..3dd5592013d 100644 --- a/radio/src/translations/da.h +++ b/radio/src/translations/da.h @@ -135,7 +135,6 @@ #define TR_VFSWRESET TR_FSW_RESET_TIMERS,TR("Alle","Flight"),TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bi1","Bip1"),TR("Bi2","Bip2"),TR("Bi3","Bi3"),TR("Adv1","Advarsel1"),TR("Adv2","Advarsel2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/src/translations/de.h b/radio/src/translations/de.h index fce638cd8c3..18c13bdfbcf 100644 --- a/radio/src/translations/de.h +++ b/radio/src/translations/de.h @@ -131,7 +131,6 @@ #define TR_VFSWRESET TR_FSW_RESET_TIMERS,"All",TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Piep1"),TR("Bp2","Piep2"),TR("Bp3","Piep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/src/translations/en.h b/radio/src/translations/en.h index 69c19a21afd..d86544e8be4 100644 --- a/radio/src/translations/en.h +++ b/radio/src/translations/en.h @@ -133,7 +133,6 @@ #define TR_VFSWRESET TR_FSW_RESET_TIMERS,TR("All","Flight"),TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/src/translations/es.h b/radio/src/translations/es.h index 34e6f2a1417..3bdbc737c24 100644 --- a/radio/src/translations/es.h +++ b/radio/src/translations/es.h @@ -129,7 +129,6 @@ #define TR_VFSWRESET TR_FSW_RESET_TIMERS,TR("Todo","Vuelo"),TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Avs1","Aviso1"),TR("Avs2","Aviso2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/src/translations/fi.h b/radio/src/translations/fi.h index 2211f5457ec..a1568e36721 100644 --- a/radio/src/translations/fi.h +++ b/radio/src/translations/fi.h @@ -134,7 +134,6 @@ #define TR_VFSWRESET TR_FSW_RESET_TIMERS,"All",TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") diff --git a/radio/src/translations/fr.h b/radio/src/translations/fr.h index bebaedbc401..b3a938d455f 100644 --- a/radio/src/translations/fr.h +++ b/radio/src/translations/fr.h @@ -132,16 +132,12 @@ #endif #define TR_VFSWRESET TR_FSW_RESET_TIMERS, "Tout", TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") - - #if LCD_W >= 212 #else #endif - #define LENGTH_UNIT_IMP "ft" #define SPEED_UNIT_IMP "mph" #define LENGTH_UNIT_METR "m" diff --git a/radio/src/translations/he.h b/radio/src/translations/he.h index 271eb3abc72..1cfde313d06 100644 --- a/radio/src/translations/he.h +++ b/radio/src/translations/he.h @@ -185,7 +185,6 @@ #define TR_VFSWRESET TR_FSW_RESET_TIMERS,TR("All","Flight"),TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/src/translations/it.h b/radio/src/translations/it.h index a21f5dffa03..8933781851e 100644 --- a/radio/src/translations/it.h +++ b/radio/src/translations/it.h @@ -132,7 +132,6 @@ #define TR_VFSWRESET TR_FSW_RESET_TIMERS,TR("All","Tutto"),TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/src/translations/jp.h b/radio/src/translations/jp.h index d232d5dc6e3..682bfbf5190 100644 --- a/radio/src/translations/jp.h +++ b/radio/src/translations/jp.h @@ -128,7 +128,6 @@ #define TR_VFSWRESET TR_FSW_RESET_TIMERS,TR("すべて","飛行時"),TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/src/translations/nl.h b/radio/src/translations/nl.h index 68f2ce5e729..7fb06b00014 100644 --- a/radio/src/translations/nl.h +++ b/radio/src/translations/nl.h @@ -130,7 +130,6 @@ #define TR_VFSWRESET TR_FSW_RESET_TIMERS,TR("All","Vliegdata"),TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/src/translations/pl.h b/radio/src/translations/pl.h index d88940b18c4..fe994443d11 100644 --- a/radio/src/translations/pl.h +++ b/radio/src/translations/pl.h @@ -127,7 +127,6 @@ #endif #define TR_VFSWRESET TR_FSW_RESET_TIMERS,TR("All","Flight"),TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Ost1","Ostrz1"),TR("Ost2","Ostrz2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Syre","Syrena"),TR("Dzwo","Dzwone"),TR("Crck","Krytcz"),TR("Alrm","AlmZeg") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/src/translations/pt.h b/radio/src/translations/pt.h index 517957a27a2..e16d503678e 100644 --- a/radio/src/translations/pt.h +++ b/radio/src/translations/pt.h @@ -136,7 +136,6 @@ #define TR_VFSWRESET TR_FSW_RESET_TIMERS,TR("All","Flight"),TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/src/translations/se.h b/radio/src/translations/se.h index 7b18c0facf3..5f4724c6195 100644 --- a/radio/src/translations/se.h +++ b/radio/src/translations/se.h @@ -138,7 +138,6 @@ #endif #define TR_VFSWRESET TR_FSW_RESET_TIMERS,"Alla",TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") diff --git a/radio/src/translations/tw.h b/radio/src/translations/tw.h index 6dce7c8f29f..16404b70fdb 100644 --- a/radio/src/translations/tw.h +++ b/radio/src/translations/tw.h @@ -128,7 +128,6 @@ #define TR_VFSWRESET TR_FSW_RESET_TIMERS,TR("全部","飛行"),TR_FSW_RESET_TELEM -#define TR_FUNCRGBLEDS "LUA","White","Blue","Red","Yellow","Green" #define TR_FUNCSOUNDS TR("Bp1","Beep1"),TR("Bp2","Beep2"),TR("Bp3","Beep3"),TR("Wrn1","Warn1"),TR("Wrn2","Warn2"),TR("Chee","Cheep"),TR("Rata","Ratata"),"Tick",TR("Sirn","Siren"),"Ring",TR("SciF","SciFi"),TR("Robt","Robot"),TR("Chrp","Chirp"),"Tada",TR("Crck","Crickt"),TR("Alrm","AlmClk") #define LENGTH_UNIT_IMP "ft" diff --git a/radio/util/addtr.py b/radio/util/addtr.py old mode 100644 new mode 100755 index c197869a30e..5b91a49c957 --- a/radio/util/addtr.py +++ b/radio/util/addtr.py @@ -19,7 +19,7 @@ def addLine(filename, newline, after): def modifyTranslations(constant, translation, after): - for filename in glob.glob('translations/*.h.txt'): + for filename in glob.glob('translations/*.h'): newline = "#define " + constant + " " * max(1, 31 - len(constant)) + '"' + translation + '"' addLine(filename, newline, after + " ")