From 398d32821e228dd681730dac34d808578fdae665 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Mon, 31 Aug 2015 20:48:32 +0200 Subject: [PATCH] Refactoring putsSwitches Will simplify things when we have 64 logical switches ... --- radio/src/audio_arm.cpp | 36 +++++++++------- radio/src/gui/9X/helpers.cpp | 4 +- radio/src/gui/Taranis/helpers.cpp | 4 +- radio/src/gui/Taranis/lcd.cpp | 43 +++++++++++++------ .../gui/Taranis/menu_model_inputs_mixes.cpp | 4 +- radio/src/myeeprom.h | 2 +- radio/src/switches.cpp | 2 +- radio/src/tests/lcd.cpp | 2 +- radio/src/translations/cz.h.txt | 18 +++----- radio/src/translations/de.h.txt | 18 +++----- radio/src/translations/en.h.txt | 18 +++----- radio/src/translations/es.h.txt | 18 +++----- radio/src/translations/fi.h.txt | 18 +++----- radio/src/translations/fr.h.txt | 18 +++----- radio/src/translations/it.h.txt | 18 +++----- radio/src/translations/nl.h.txt | 18 +++----- radio/src/translations/pl.h.txt | 18 +++----- radio/src/translations/pt.h.txt | 18 +++----- radio/src/translations/se.h.txt | 18 +++----- 19 files changed, 126 insertions(+), 169 deletions(-) diff --git a/radio/src/audio_arm.cpp b/radio/src/audio_arm.cpp index df2a75955..75dff4974 100644 --- a/radio/src/audio_arm.cpp +++ b/radio/src/audio_arm.cpp @@ -305,24 +305,28 @@ void getPhaseAudioFile(char * filename, int index, unsigned int event) void getSwitchAudioFile(char * filename, int index) { char * str = getModelAudioPath(filename); - int len = STR_VSWITCHES[0]; - strncpy(str, &STR_VSWITCHES[1+len*(index+1)], len); - str += len-1; - if (*str == '\300') { - strcpy(str, "-up"); - str += 3; - } - else if (*str == '-') { - strcpy(str, "-mid"); - str += 4; - } - else if (*str == '\301') { - strcpy(str, "-down"); - str += 5; + +#if defined(PCBTARANIS) + if (index <= SWSRC_LAST_SWITCH) { + div_t swinfo = switchInfo(index); + *str++ = 'S'; + *str++ = 'A' + swinfo.quot; + const char * positions[] = { "-up", "-mid", "-down" }; + strcpy(str, positions[swinfo.rem]); } else { - *(str+1) = 0; + div_t swinfo = div(index - SWSRC_FIRST_MULTIPOS_SWITCH, XPOTS_MULTIPOS_COUNT); + *str++ = 'S'; + *str++ = '1' + swinfo.quot; + *str++ = '1' + swinfo.rem; + *str = '\0'; } +#else + int len = STR_VSWITCHES[0]; + strncpy(str, &STR_VSWITCHES[1+(len*index)], len); + str += len; + *str = '\0'; +#endif strcat(str, SOUNDS_EXT); } @@ -381,7 +385,7 @@ void referenceModelAudioFiles() } // Switches Audio Files -[up|mid|down].wav - for (int i=0; i= MIXSRC_FIRST_SWITCH && idx < MIXSRC_FIRST_LOGICAL_SWITCH) { + else if (idx >= MIXSRC_FIRST_SWITCH && idx <= MIXSRC_LAST_SWITCH) { idx = idx-MIXSRC_FIRST_SWITCH; if (ZEXIST(g_eeGeneral.switchNames[idx])) { lcd_putcAtt(x, y, '\312', att); //switch symbol @@ -729,27 +729,46 @@ void putsModelName(coord_t x, coord_t y, char *name, uint8_t id, LcdFlags att) void putsSwitches(coord_t x, coord_t y, int32_t idx, LcdFlags att) { - if (idx == SWSRC_OFF) + if (idx == SWSRC_NONE) { + return lcd_putsiAtt(x, y, STR_VSWITCHES, 0, att); + } + else if (idx == SWSRC_OFF) { return lcd_putsiAtt(x, y, STR_OFFON, 0, att); + } + if (idx < 0) { lcd_putcAtt(x-2, y, '!', att); idx = -idx; } -#if defined(FLIGHT_MODES) - if (idx >= SWSRC_FIRST_FLIGHT_MODE) { - return putsStrIdx(x, y, STR_FP, idx-SWSRC_FIRST_FLIGHT_MODE, att); - } -#endif - if (idx >= SWSRC_FIRST_SWITCH && idx <= SWSRC_LAST_SWITCH) { + + if (idx <= SWSRC_LAST_SWITCH) { div_t swinfo = switchInfo(idx); if (ZEXIST(g_eeGeneral.switchNames[swinfo.quot])) { lcd_putsnAtt(x, y, g_eeGeneral.switchNames[swinfo.quot], LEN_SWITCH_NAME, ZCHAR|att); - char c = "\300-\301"[swinfo.rem]; - lcd_putcAtt(lcdNextPos, y, c, att); - return; } + else { + lcd_putcAtt(x, y, 'S', att); + lcd_putcAtt(lcdNextPos, y, 'A'+swinfo.quot, att); + } + char c = "\300-\301"[swinfo.rem]; + lcd_putcAtt(lcdNextPos, y, c, att); + } + else if (idx <= SWSRC_LAST_MULTIPOS_SWITCH) { + div_t swinfo = div(idx - SWSRC_FIRST_MULTIPOS_SWITCH, XPOTS_MULTIPOS_COUNT); + putsStrIdx(x, y, "S", swinfo.quot*10+swinfo.rem+11, att); + } + else if (idx <= SWSRC_LAST_TRIM) { + lcd_putsiAtt(x, y, STR_VSWITCHES, idx-SWSRC_FIRST_TRIM+1, att); + } + else if (idx <= SWSRC_LAST_LOGICAL_SWITCH) { + putsStrIdx(x, y, "L", idx-SWSRC_FIRST_LOGICAL_SWITCH+1, att); + } + else if (idx <= SWSRC_ONE) { + lcd_putsiAtt(x, y, STR_VSWITCHES, idx-SWSRC_ON+1+(2*NUM_STICKS), att); + } + else { + putsStrIdx(x, y, STR_FP, idx-SWSRC_FIRST_FLIGHT_MODE, att); } - return lcd_putsiAtt(x, y, STR_VSWITCHES, idx, att); } #if defined(FLIGHT_MODES) diff --git a/radio/src/gui/Taranis/menu_model_inputs_mixes.cpp b/radio/src/gui/Taranis/menu_model_inputs_mixes.cpp index 133e82df2..38eb02c88 100644 --- a/radio/src/gui/Taranis/menu_model_inputs_mixes.cpp +++ b/radio/src/gui/Taranis/menu_model_inputs_mixes.cpp @@ -88,7 +88,7 @@ void DrawFunction(FnFuncP fn, uint8_t offset) coord_t prev_yv = (coord_t)-1; - for (int8_t xv=-WCHART; xv<=WCHART; xv++) { + for (int xv=-WCHART; xv<=WCHART; xv++) { coord_t yv = (LCD_H-1) - (((uint16_t)RESX + fn(xv * (RESX/WCHART))) / 2 * (LCD_H-1) / RESX); if (prev_yv != (coord_t)-1) { if (abs((int8_t)yv-prev_yv) <= 1) { @@ -108,7 +108,7 @@ uint8_t getExpoMixCount(uint8_t expo) uint8_t count = 0; uint8_t ch ; - for(int8_t i=(expo ? MAX_EXPOS-1 : MAX_MIXERS-1); i>=0; i--) { + for (int i=(expo ? MAX_EXPOS-1 : MAX_MIXERS-1); i>=0; i--) { ch = (expo ? EXPO_VALID(expoAddress(i)) : mixAddress(i)->srcRaw); if (ch != 0) { count++; diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 4c0326108..493b2138f 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -1749,7 +1749,7 @@ enum SwitchSources { SWSRC_LAST_LOGICAL_SWITCH = SWSRC_FIRST_LOGICAL_SWITCH+NUM_LOGICAL_SWITCH-1, SWSRC_ON, - SWSRC_One, + SWSRC_ONE, #if defined(CPUARM) SWSRC_FIRST_FLIGHT_MODE, diff --git a/radio/src/switches.cpp b/radio/src/switches.cpp index 7e1a44ce1..c26f0f427 100644 --- a/radio/src/switches.cpp +++ b/radio/src/switches.cpp @@ -436,7 +436,7 @@ bool getSwitch(int8_t swtch) uint8_t cs_idx = abs(swtch); - if (cs_idx == SWSRC_One) { + if (cs_idx == SWSRC_ONE) { result = !s_mixer_first_run_done; } else if (cs_idx == SWSRC_ON) { diff --git a/radio/src/tests/lcd.cpp b/radio/src/tests/lcd.cpp index e3cebfbf3..dbba72798 100644 --- a/radio/src/tests/lcd.cpp +++ b/radio/src/tests/lcd.cpp @@ -92,7 +92,7 @@ void doPaint(QPainter & p) } } -bool checkScreenshot(QString test) +bool checkScreenshot(const QString & test) { lcdRefresh(); QImage buffer(LCD_W, LCD_H, QImage::Format_RGB32); diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 1a8465c14..1dbb03693 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -487,23 +487,17 @@ #define TR_ROTENC_SWITCHES #endif -#if defined(PCBTARANIS) && defined(REV9E) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301""SI\300""SI-""SI\301""SJ\300""SJ-""SJ\301""SK\300""SK-""SK\301""SL\300""SL-""SL\301""SM\300""SM-""SM\301""SN\300""SN-""SN\301""SO\300""SO-""SO\301""SP\300""SP-""SP\301""SQ\300""SQ-""SQ\301""SR\300""SR-""SR\301" -#elif defined(PCBTARANIS) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301" -#else +#if !defined(PCBTARANIS) #define TR_PHYS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" #endif +#define TR_ON_ONE_SWITCHES "ZAP""One" + #if defined(PCBTARANIS) - #if defined(REV9E) - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" - #else - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" - #endif - #define TR_VSWITCHES "---" TR_PHYS_SWITCHES TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ZAP""One" + // only special switches here + #define TR_VSWITCHES "---" TR_TRIMS_SWITCHES TR_ON_ONE_SWITCHES #else - #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ZAP""One" + #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW TR_ON_ONE_SWITCHES #endif #if defined(HELI) diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index 4e6521f3b..5f1a726fb 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -491,23 +491,17 @@ #define TR_ROTENC_SWITCHES #endif -#if defined(PCBTARANIS) && defined(REV9E) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301""SI\300""SI-""SI\301""SJ\300""SJ-""SJ\301""SK\300""SK-""SK\301""SL\300""SL-""SL\301""SM\300""SM-""SM\301""SN\300""SN-""SN\301""SO\300""SO-""SO\301""SP\300""SP-""SP\301""SQ\300""SQ-""SQ\301""SR\300""SR-""SR\301" -#elif defined(PCBTARANIS) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301" -#else +#if !defined(PCBTARANIS) #define TR_PHYS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" #endif +#define TR_ON_ONE_SWITCHES "ON\0""One" + #if defined(PCBTARANIS) - #if defined(REV9E) - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" - #else - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" - #endif - #define TR_VSWITCHES "---" TR_PHYS_SWITCHES TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + // only special switches here + #define TR_VSWITCHES "---" TR_TRIMS_SWITCHES TR_ON_ONE_SWITCHES #else - #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW TR_ON_ONE_SWITCHES #endif #if defined(HELI) diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index 65e438fef..4a5765c1f 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -486,23 +486,17 @@ #define TR_ROTENC_SWITCHES #endif -#if defined(PCBTARANIS) && defined(REV9E) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301""SI\300""SI-""SI\301""SJ\300""SJ-""SJ\301""SK\300""SK-""SK\301""SL\300""SL-""SL\301""SM\300""SM-""SM\301""SN\300""SN-""SN\301""SO\300""SO-""SO\301""SP\300""SP-""SP\301""SQ\300""SQ-""SQ\301""SR\300""SR-""SR\301" -#elif defined(PCBTARANIS) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301" -#else +#if !defined(PCBTARANIS) #define TR_PHYS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" #endif +#define TR_ON_ONE_SWITCHES "ON\0""One" + #if defined(PCBTARANIS) - #if defined(REV9E) - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" - #else - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" - #endif - #define TR_VSWITCHES "---" TR_PHYS_SWITCHES TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + // only special switches here + #define TR_VSWITCHES "---" TR_TRIMS_SWITCHES TR_ON_ONE_SWITCHES #else - #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW TR_ON_ONE_SWITCHES #endif #if defined(HELI) diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index 0bd39c8a7..a4fcb11c0 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -471,23 +471,17 @@ #define TR_ROTENC_SWITCHES #endif -#if defined(PCBTARANIS) && defined(REV9E) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301""SI\300""SI-""SI\301""SJ\300""SJ-""SJ\301""SK\300""SK-""SK\301""SL\300""SL-""SL\301""SM\300""SM-""SM\301""SN\300""SN-""SN\301""SO\300""SO-""SO\301""SP\300""SP-""SP\301""SQ\300""SQ-""SQ\301""SR\300""SR-""SR\301" -#elif defined(PCBTARANIS) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301" -#else +#if !defined(PCBTARANIS) #define TR_PHYS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" #endif +#define TR_ON_ONE_SWITCHES "ON\0""One" + #if defined(PCBTARANIS) - #if defined(REV9E) - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" - #else - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" - #endif - #define TR_VSWITCHES "---" TR_PHYS_SWITCHES TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + // only special switches here + #define TR_VSWITCHES "---" TR_TRIMS_SWITCHES TR_ON_ONE_SWITCHES #else - #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW TR_ON_ONE_SWITCHES #endif #if defined(HELI) diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 8b30e122a..40bcd17f9 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -471,23 +471,17 @@ #define TR_ROTENC_SWITCHES #endif -#if defined(PCBTARANIS) && defined(REV9E) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301""SI\300""SI-""SI\301""SJ\300""SJ-""SJ\301""SK\300""SK-""SK\301""SL\300""SL-""SL\301""SM\300""SM-""SM\301""SN\300""SN-""SN\301""SO\300""SO-""SO\301""SP\300""SP-""SP\301""SQ\300""SQ-""SQ\301""SR\300""SR-""SR\301" -#elif defined(PCBTARANIS) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301" -#else +#if !defined(PCBTARANIS) #define TR_PHYS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" #endif +#define TR_ON_ONE_SWITCHES "ON\0""One" + #if defined(PCBTARANIS) - #if defined(REV9E) - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" - #else - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" - #endif - #define TR_VSWITCHES "---" TR_PHYS_SWITCHES TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + // only special switches here + #define TR_VSWITCHES "---" TR_TRIMS_SWITCHES TR_ON_ONE_SWITCHES #else - #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW TR_ON_ONE_SWITCHES #endif #if defined(HELI) diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index 60d906ab9..ba8f86b11 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -486,23 +486,17 @@ #define TR_ROTENC_SWITCHES #endif -#if defined(PCBTARANIS) && defined(REV9E) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301""SI\300""SI-""SI\301""SJ\300""SJ-""SJ\301""SK\300""SK-""SK\301""SL\300""SL-""SL\301""SM\300""SM-""SM\301""SN\300""SN-""SN\301""SO\300""SO-""SO\301""SP\300""SP-""SP\301""SQ\300""SQ-""SQ\301""SR\300""SR-""SR\301" -#elif defined(PCBTARANIS) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301" -#else +#if !defined(PCBTARANIS) #define TR_PHYS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" #endif +#define TR_ON_ONE_SWITCHES "ON\0""Un" + #if defined(PCBTARANIS) - #if defined(REV9E) - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" - #else - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" - #endif - #define TR_VSWITCHES "---" TR_PHYS_SWITCHES TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""Un" + // only special switches here + #define TR_VSWITCHES "---" TR_TRIMS_SWITCHES TR_ON_ONE_SWITCHES #else - #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""Un" + #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW TR_ON_ONE_SWITCHES #endif #if defined(HELI) diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index 13acf7941..897dd8c83 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -489,23 +489,17 @@ #define TR_ROTENC_SWITCHES #endif -#if defined(PCBTARANIS) && defined(REV9E) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301""SI\300""SI-""SI\301""SJ\300""SJ-""SJ\301""SK\300""SK-""SK\301""SL\300""SL-""SL\301""SM\300""SM-""SM\301""SN\300""SN-""SN\301""SO\300""SO-""SO\301""SP\300""SP-""SP\301""SQ\300""SQ-""SQ\301""SR\300""SR-""SR\301" -#elif defined(PCBTARANIS) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301" -#else +#if !defined(PCBTARANIS) #define TR_PHYS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" #endif +#define TR_ON_ONE_SWITCHES "ON\0""One" + #if defined(PCBTARANIS) - #if defined(REV9E) - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" - #else - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" - #endif - #define TR_VSWITCHES "---" TR_PHYS_SWITCHES TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + // only special switches here + #define TR_VSWITCHES "---" TR_TRIMS_SWITCHES TR_ON_ONE_SWITCHES #else - #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW TR_ON_ONE_SWITCHES #endif #if defined(HELI) diff --git a/radio/src/translations/nl.h.txt b/radio/src/translations/nl.h.txt index 67b0801b7..7613fcbe8 100755 --- a/radio/src/translations/nl.h.txt +++ b/radio/src/translations/nl.h.txt @@ -489,23 +489,17 @@ #define TR_ROTENC_SWITCHES #endif -#if defined(PCBTARANIS) && defined(REV9E) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301""SI\300""SI-""SI\301""SJ\300""SJ-""SJ\301""SK\300""SK-""SK\301""SL\300""SL-""SL\301""SM\300""SM-""SM\301""SN\300""SN-""SN\301""SO\300""SO-""SO\301""SP\300""SP-""SP\301""SQ\300""SQ-""SQ\301""SR\300""SR-""SR\301" -#elif defined(PCBTARANIS) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301" -#else +#if !defined(PCBTARANIS) #define TR_PHYS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" #endif +#define TR_ON_ONE_SWITCHES "ON\0""One" + #if defined(PCBTARANIS) - #if defined(REV9E) - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" - #else - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" - #endif - #define TR_VSWITCHES "---" TR_PHYS_SWITCHES TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + // only special switches here + #define TR_VSWITCHES "---" TR_TRIMS_SWITCHES TR_ON_ONE_SWITCHES #else - #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW TR_ON_ONE_SWITCHES #endif #if defined(HELI) diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 6f3ab30e0..950165f44 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -490,23 +490,17 @@ #define TR_ROTENC_SWITCHES #endif -#if defined(PCBTARANIS) && defined(REV9E) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301""SI\300""SI-""SI\301""SJ\300""SJ-""SJ\301""SK\300""SK-""SK\301""SL\300""SL-""SL\301""SM\300""SM-""SM\301""SN\300""SN-""SN\301""SO\300""SO-""SO\301""SP\300""SP-""SP\301""SQ\300""SQ-""SQ\301""SR\300""SR-""SR\301" -#elif defined(PCBTARANIS) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301" -#else +#if !defined(PCBTARANIS) #define TR_PHYS_SWITCHES "GAZ""SK ""SW ""LOT""GEA""TRN" #endif +#define TR_ON_ONE_SWITCHES "ON\0""One" + #if defined(PCBTARANIS) - #if defined(REV9E) - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" - #else - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" - #endif - #define TR_VSWITCHES "---" TR_PHYS_SWITCHES TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + // only special switches here + #define TR_VSWITCHES "---" TR_TRIMS_SWITCHES TR_ON_ONE_SWITCHES #else - #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW TR_ON_ONE_SWITCHES #endif #if defined(HELI) diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index 773eb1dae..ea0a75c51 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -471,23 +471,17 @@ #define TR_ROTENC_SWITCHES #endif -#if defined(PCBTARANIS) && defined(REV9E) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301""SI\300""SI-""SI\301""SJ\300""SJ-""SJ\301""SK\300""SK-""SK\301""SL\300""SL-""SL\301""SM\300""SM-""SM\301""SN\300""SN-""SN\301""SO\300""SO-""SO\301""SP\300""SP-""SP\301""SQ\300""SQ-""SQ\301""SR\300""SR-""SR\301" -#elif defined(PCBTARANIS) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301" -#else +#if !defined(PCBTARANIS) #define TR_PHYS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" #endif +#define TR_ON_ONE_SWITCHES "ON\0""One" + #if defined(PCBTARANIS) - #if defined(REV9E) - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" - #else - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" - #endif - #define TR_VSWITCHES "---" TR_PHYS_SWITCHES TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + // only special switches here + #define TR_VSWITCHES "---" TR_TRIMS_SWITCHES TR_ON_ONE_SWITCHES #else - #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW TR_ON_ONE_SWITCHES #endif #if defined(HELI) diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 40cd02f78..454cf3d42 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -471,23 +471,17 @@ #define TR_ROTENC_SWITCHES #endif -#if defined(PCBTARANIS) && defined(REV9E) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301""SI\300""SI-""SI\301""SJ\300""SJ-""SJ\301""SK\300""SK-""SK\301""SL\300""SL-""SL\301""SM\300""SM-""SM\301""SN\300""SN-""SN\301""SO\300""SO-""SO\301""SP\300""SP-""SP\301""SQ\300""SQ-""SQ\301""SR\300""SR-""SR\301" -#elif defined(PCBTARANIS) - #define TR_PHYS_SWITCHES "SA\300""SA-""SA\301""SB\300""SB-""SB\301""SC\300""SC-""SC\301""SD\300""SD-""SD\301""SE\300""SE-""SE\301""SF\300""SF-""SF\301""SG\300""SG-""SG\301""SH\300""SH-""SH\301" -#else +#if !defined(PCBTARANIS) #define TR_PHYS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" #endif +#define TR_ON_ONE_SWITCHES "ON\0""One" + #if defined(PCBTARANIS) - #if defined(REV9E) - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36""S41""S42""S43""S44""S45""S46" - #else - #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" - #endif - #define TR_VSWITCHES "---" TR_PHYS_SWITCHES TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + // only special switches here + #define TR_VSWITCHES "---" TR_TRIMS_SWITCHES TR_ON_ONE_SWITCHES #else - #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW "ON\0""One" + #define TR_VSWITCHES "---" TR_9X_3POS_SWITCHES TR_PHYS_SWITCHES TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW TR_ON_ONE_SWITCHES #endif #if defined(HELI)