From b805b147f38afa937dc2925f78dddbff00a71eac Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 16 Apr 2014 20:04:31 +0200 Subject: [PATCH 01/79] Issue #660 - Firmware part done. I need to check the ASM because when compiled with the FRSKY_STICKS option enabled, the FW is lighter than without the option! --- companion/src/eeprominterface.h | 1 + .../src/firmwares/opentx/opentxeeprom.cpp | 10 +++++++- companion/src/generaledit.cpp | 3 ++- radio/src/Makefile | 11 ++++----- radio/src/gui/menu_general.cpp | 24 +++++++++++++++++-- radio/src/myeeprom.h | 15 +++++++++++- radio/src/opentx.cpp | 9 +++++-- radio/src/targets/sky9x/adc_driver.cpp | 6 ++--- 8 files changed, 63 insertions(+), 16 deletions(-) diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index b9845163f..26a890d8f 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -470,6 +470,7 @@ class GeneralSettings { int PPM_Multiplier; int hapticLength; unsigned int reNavigation; + unsigned int stickReverse; bool hideNameOnSplash; bool enablePpmsim; unsigned int speakerPitch; diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 90c5b5125..9e4294ea7 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -2639,7 +2639,15 @@ OpenTxGeneralData::OpenTxGeneralData(GeneralSettings & generalData, BoardEnum bo internalField.Append(new UnsignedField<8>(generalData.templateSetup)); internalField.Append(new SignedField<8>(generalData.PPM_Multiplier)); internalField.Append(new SignedField<8>(generalData.hapticLength)); - internalField.Append(new UnsignedField<8>(generalData.reNavigation)); + + if (version < 216 || !IS_9X(board)) { + internalField.Append(new UnsignedField<8>(generalData.reNavigation)); + } + + if (version >= 216 && !IS_TARANIS(board)) { + internalField.Append(new UnsignedField<4>(generalData.stickReverse)); + internalField.Append(new SpareBitsField<4>()); + } internalField.Append(new SignedField<3>(generalData.beeperLength)); internalField.Append(new UnsignedField<3>(generalData.hapticStrength)); diff --git a/companion/src/generaledit.cpp b/companion/src/generaledit.cpp index 403a4b8e8..558c78b69 100644 --- a/companion/src/generaledit.cpp +++ b/companion/src/generaledit.cpp @@ -215,7 +215,8 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) : if (renumber==0) { ui->re_label->hide(); ui->re_CB->hide(); - } else { + } + else { populateRotEncCB(ui->re_CB, g_eeGeneral.reNavigation, renumber); } ui->contrastSB->setValue(g_eeGeneral.contrast); diff --git a/radio/src/Makefile b/radio/src/Makefile index 110f03c04..c21d0564b 100644 --- a/radio/src/Makefile +++ b/radio/src/Makefile @@ -97,10 +97,9 @@ NAVIGATION = NO # Values = YES, NO AUTOSWITCH = NO -# Swap Stick Inputs for AIL,ELE,RUD,THR -# Used in some scenarios where stick/pot entries -# cannot be changed by soldering the pots. - +# Stock sticks replaced by FrSky ones +# Values = YES, NO +FRSKY_STICKS = NO # Sources automatic selection # Values = YES, NO @@ -791,8 +790,8 @@ ifeq ($(AUTOSOURCE), YES) CPPDEFS += -DAUTOSOURCE endif -ifeq ($(TARANIS_STICKS), YES) - CPPDEFS += -DTARANIS_STICKS +ifeq ($(FRSKY_STICKS), YES) + CPPDEFS += -DFRSKY_STICKS endif diff --git a/radio/src/gui/menu_general.cpp b/radio/src/gui/menu_general.cpp index 35dfdc987..1d61730d9 100644 --- a/radio/src/gui/menu_general.cpp +++ b/radio/src/gui/menu_general.cpp @@ -197,6 +197,12 @@ enum menuGeneralSetupItems { ITEM_SETUP_MAX }; +#if defined(FRSKY_STICKS) + #define COL_TX_MODE 0 +#else + #define COL_TX_MODE LABEL(TX_MODE) +#endif + void menuGeneralSetup(uint8_t event) { #if defined(RTCLOCK) @@ -219,7 +225,7 @@ void menuGeneralSetup(uint8_t event) } #endif - MENU(STR_MENURADIOSETUP, menuTabDiag, e_Setup, ITEM_SETUP_MAX+1, {0, IF_RTCLOCK(2) IF_RTCLOCK(2) IF_BATTGRAPH(1) LABEL(SOUND), IF_AUDIO(0) IF_BUZZER(0) IF_VOICE(0) IF_CPUARM(0) IF_CPUARM(0) IF_CPUARM(0) 0, IF_AUDIO(0) IF_VARIO_CPUARM(LABEL(VARIO)) IF_VARIO_CPUARM(0) IF_VARIO_CPUARM(0) IF_VARIO_CPUARM(0) IF_VARIO_CPUARM(0) IF_HAPTIC(LABEL(HAPTIC)) IF_HAPTIC(0) IF_HAPTIC(0) IF_HAPTIC(0) 0, LABEL(ALARMS), 0, CASE_PCBSKY9X(0) CASE_PCBSKY9X(0) 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, IF_CPUARM(0) CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, IF_SPLASH_PARAM(0) IF_GPS(0) IF_GPS(0) IF_PXX(0) IF_CPUARM(0) IF_CPUARM(0) IF_FAI_CHOICE(0) 0, LABEL(TX_MODE), CASE_PCBTARANIS(0) 1/*to force edit mode*/}); + MENU(STR_MENURADIOSETUP, menuTabDiag, e_Setup, ITEM_SETUP_MAX+1, {0, IF_RTCLOCK(2) IF_RTCLOCK(2) IF_BATTGRAPH(1) LABEL(SOUND), IF_AUDIO(0) IF_BUZZER(0) IF_VOICE(0) IF_CPUARM(0) IF_CPUARM(0) IF_CPUARM(0) 0, IF_AUDIO(0) IF_VARIO_CPUARM(LABEL(VARIO)) IF_VARIO_CPUARM(0) IF_VARIO_CPUARM(0) IF_VARIO_CPUARM(0) IF_VARIO_CPUARM(0) IF_HAPTIC(LABEL(HAPTIC)) IF_HAPTIC(0) IF_HAPTIC(0) IF_HAPTIC(0) 0, LABEL(ALARMS), 0, CASE_PCBSKY9X(0) CASE_PCBSKY9X(0) 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, IF_CPUARM(0) CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, IF_SPLASH_PARAM(0) IF_GPS(0) IF_GPS(0) IF_PXX(0) IF_CPUARM(0) IF_CPUARM(0) IF_FAI_CHOICE(0) 0, COL_TX_MODE, CASE_PCBTARANIS(0) 1/*to force edit mode*/}); uint8_t sub = m_posVert - 1; @@ -628,7 +634,21 @@ void menuGeneralSetup(uint8_t event) case ITEM_SETUP_STICK_MODE_LABELS: lcd_putsLeft(y, NO_INDENT(STR_MODE)); - for (uint8_t i=0; i<4; i++) lcd_img((6+4*i)*FW, y, sticks, i, 0); + for (uint8_t i=0; i<4; i++) { + lcd_img((6+4*i)*FW, y, sticks, i, 0); +#if defined(FRSKY_STICKS) + if (g_eeGeneral.stickReverse & (1< Date: Tue, 29 Apr 2014 15:42:41 +0200 Subject: [PATCH 02/79] Replaced hard coded switches with Bertrands new defines --- companion/src/wizarddata.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/companion/src/wizarddata.cpp b/companion/src/wizarddata.cpp index 7c020a037..52ed3ed29 100644 --- a/companion/src/wizarddata.cpp +++ b/companion/src/wizarddata.cpp @@ -12,6 +12,7 @@ * */ #include +#include "eeprominterface.h" #include "wizarddata.h" Channel::Channel() @@ -67,13 +68,13 @@ void WizMix::addMix(ModelData &model, Input input, int weight, int channel, int } else if (input==FLAPS_INPUT){ // There ought to be some kind of constants for switches somewhere... - maxMixSwitch((char *)"Flaps Up", model.mixData[mixIndex++], channel+1, isTaranis ? 1 :-3 , weight); //Taranis SA-UP, 9X ELE-UP - maxMixSwitch((char *)"Flaps Down", model.mixData[mixIndex++], channel+1, isTaranis ? 3 : 3 , -weight); //Taranis SA-DOWN, 9X ELE-DOWN + maxMixSwitch((char *)"Flaps Up", model.mixData[mixIndex++], channel+1, isTaranis ? SWITCH_SA0 :-SWITCH_ELE , weight); //Taranis SA-UP, 9X ELE-UP + maxMixSwitch((char *)"Flaps Down", model.mixData[mixIndex++], channel+1, isTaranis ? SWITCH_SA2 : SWITCH_ELE , -weight); //Taranis SA-DOWN, 9X ELE-DOWN } else if (input==AIRBRAKES_INPUT){ - maxMixSwitch((char *)"Airbrk Off", model.mixData[mixIndex++], channel+1, isTaranis ? 13 :-2 , -weight); //Taranis SE-UP, 9X RUD-UP - maxMixSwitch((char *)"Airbrk On", model.mixData[mixIndex++], channel+1, isTaranis ? 15 : 2 , weight); //Tatanis SE-DOWN, 9X RUD-DOWN + maxMixSwitch((char *)"Airbrk Off", model.mixData[mixIndex++], channel+1, isTaranis ? SWITCH_SE0 :-SWITCH_RUD , -weight); //Taranis SE-UP, 9X RUD-UP + maxMixSwitch((char *)"Airbrk On", model.mixData[mixIndex++], channel+1, isTaranis ? SWITCH_SE2 : SWITCH_RUD , weight); //Tatanis SE-DOWN, 9X RUD-DOWN } } } @@ -110,7 +111,7 @@ WizMix::operator ModelData() // Add the Throttle Cut option if( options[THROTTLE_CUT_OPTION] && throttleChannel >=0 ){ model.funcSw[switchIndex].swtch.type = SWITCH_TYPE_SWITCH; - model.funcSw[switchIndex].swtch.index = isTaranis ? 16 : 1; // Taranis SF-UP, 9X THR-UP + model.funcSw[switchIndex].swtch.index = isTaranis ? SWITCH_SF0 : SWITCH_THR; model.funcSw[switchIndex].enabled = 1; model.funcSw[switchIndex].func = (AssignFunc)throttleChannel; model.funcSw[switchIndex].param = -100; @@ -119,7 +120,7 @@ WizMix::operator ModelData() // Add the Throttle Timer option if (options[THROTTLE_TIMER_OPTION] && throttleChannel >=0 ){ model.timers[timerIndex].mode.type = SWITCH_TYPE_SWITCH; - model.timers[timerIndex].mode.index = isTaranis ? -16 : -1; // Taranis !SF-UP, 9X THR-DOWN + model.timers[timerIndex].mode.index = isTaranis ? -SWITCH_SF0 : -SWITCH_THR; // Taranis !SF-UP, 9X THR-DOWN timerIndex++; } return model; From 802c7fdb4ca350ed574a4e3a683294c91ace0db4 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 29 Apr 2014 16:33:05 +0200 Subject: [PATCH 03/79] Update DONATIONS.txt --- DONATIONS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/DONATIONS.txt b/DONATIONS.txt index a34049488..3b9ebe1de 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -383,3 +383,4 @@ Gordon Stahl Serge Michaux Robert Young Wilco Hijink +Roy Nixon From 8baa2b3887831c6bd6e98b19a2079345642698cd Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Tue, 29 Apr 2014 19:59:24 +0200 Subject: [PATCH 04/79] Bug: setting gvar to "same as flight mode X" caused endless loop if X > current flight mode --- companion/src/modeledit/flightmodes.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/companion/src/modeledit/flightmodes.cpp b/companion/src/modeledit/flightmodes.cpp index fa437a6bd..08b8fd226 100644 --- a/companion/src/modeledit/flightmodes.cpp +++ b/companion/src/modeledit/flightmodes.cpp @@ -205,7 +205,7 @@ void FlightMode::update() gvValues[i]->setDisabled(false); int idx = phase.gvars[i]; PhaseData *phasegvar = &phase; - while (idx >= 1024) { + while (idx > 1024) { idx -= 1025; phasegvar = &model.phaseData[idx]; idx = phasegvar->gvars[i]; @@ -221,7 +221,7 @@ void FlightMode::update() reValues[i]->setDisabled(false); int idx = phase.rotaryEncoders[i]; PhaseData *phasere = &phase; - while (idx >= 1024) { + while (idx > 1024) { idx -= 1025; phasere = &model.phaseData[idx]; idx = phasere->rotaryEncoders[i]; @@ -321,7 +321,7 @@ void FlightMode::phaseGVUse_currentIndexChanged(int index) phase.gvars[gvar]=0; } else { - phase.gvars[gvar] = 1024+index; + phase.gvars[gvar] = 1024+index+(index>phaseIdx?1:0); } update(); emit modified(); From 926ad88b738a0461850a20de2d1c2d988ad4976e Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Tue, 29 Apr 2014 20:06:25 +0200 Subject: [PATCH 05/79] Hided "popup enabled" checkbox for FM>0. They have taken precious space and severely limited width of GVAR names filed. --- companion/src/modeledit/flightmodes.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/companion/src/modeledit/flightmodes.cpp b/companion/src/modeledit/flightmodes.cpp index 08b8fd226..fee46f2ea 100644 --- a/companion/src/modeledit/flightmodes.cpp +++ b/companion/src/modeledit/flightmodes.cpp @@ -158,7 +158,7 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera gvLayout->addWidget(gvValues[i], i, col++, 1, 1); // Popups - if (IS_TARANIS(GetEepromInterface()->getBoard())) { + if (IS_TARANIS(GetEepromInterface()->getBoard()) && (phaseIdx == 0)) { gvPopups[i] = new QCheckBox(ui->gvGB); gvPopups[i]->setProperty("index", i); gvPopups[i]->setText(tr("Popup enabled")); @@ -213,7 +213,8 @@ void FlightMode::update() } if (IS_TARANIS(GetEepromInterface()->getBoard())) { gvValues[i]->setValue(phasegvar->gvars[i]); - gvPopups[i]->setChecked(model.gvars_popups[i]); + if (phaseIdx == 0) + gvPopups[i]->setChecked(model.gvars_popups[i]); } } From a2dbee7d983cc6432634203c6db4c3ef341ad769 Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 30 Apr 2014 15:54:57 +0200 Subject: [PATCH 06/79] Fixes #1012 --- radio/src/eeprom_conversions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/eeprom_conversions.cpp b/radio/src/eeprom_conversions.cpp index 1454b12ce..cff0b1dae 100644 --- a/radio/src/eeprom_conversions.cpp +++ b/radio/src/eeprom_conversions.cpp @@ -387,8 +387,8 @@ int ConvertSwitch_215_to_216(int swtch) return -ConvertSwitch_215_to_216(-swtch); else if (swtch <= SWSRC_LAST_SWITCH) return swtch; - else if (swtch > SWSRC_LAST_SWITCH + 32) { - swtch -= (22+32); + else if (swtch > SWSRC_LAST_SWITCH + 32 + 1) { + swtch -= (SWSRC_LAST_SWITCH + 32 + 1); if (swtch > SWSRC_ON) swtch = 0; return swtch; From e2cfaf67421bc85d4e072ab7bea5c345555525ef Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 30 Apr 2014 16:12:53 +0200 Subject: [PATCH 07/79] Fixes #1031 --- companion/src/modeledit/curves.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/companion/src/modeledit/curves.cpp b/companion/src/modeledit/curves.cpp index 0e5f903e7..31b7eb64f 100644 --- a/companion/src/modeledit/curves.cpp +++ b/companion/src/modeledit/curves.cpp @@ -386,6 +386,10 @@ void Curves::onNodeMoved(int x, int y) model.curves[currentCurve].points[index].y = y; spnx[index]->setValue(x); spny[index]->setValue(y); + if (index > 0) + spnx[index-1]->setMaximum(x); + if (index < model.curves[currentCurve].count-1) + spnx[index+1]->setMinimum(x); emit modified(); lock = false; } From 3cd070ee38ff02376348da6748782507db200a77 Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 30 Apr 2014 20:10:13 +0200 Subject: [PATCH 08/79] Cosmetics --- companion/src/firmwares/opentx/opentxeeprom.cpp | 2 +- companion/src/mainwindow.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index b74433cff..fd29cb24c 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -1590,7 +1590,7 @@ class CustomFunctionsConversionTable: public ConversionTable { int val=0; if (version >= 216) { - for (int i=0; i<32; i++) { + for (int i=0; iaddMenu(tr("File")); fileMenu->addAction(newAct); From 6b1afde47e2054547b884cf8fe8128e0aae396ea Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Wed, 30 Apr 2014 21:20:07 +0200 Subject: [PATCH 09/79] bugfix: commit 5c8504add6beb538822f71b9d4b6f9e6e4c75ba5 broke importing of trim values for FM0 - they were all set to zero. --- companion/src/firmwares/opentx/opentxeeprom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index fd29cb24c..475460ba7 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -777,7 +777,7 @@ class FlightModeField: public TransformedField { } } else { - if (phase.swtch == RawSwitch(SWITCH_TYPE_NONE)) { + if (phase.swtch == RawSwitch(SWITCH_TYPE_NONE) && index > 0) { phase.trimRef[i] = 0; phase.trimMode[i] = 0; phase.trim[i] = 0; From 168ec19ef4169cf44064c21deb506fb163949698 Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 30 Apr 2014 22:07:13 +0200 Subject: [PATCH 10/79] Fixes #1036 --- companion/src/printdialog.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/companion/src/printdialog.ui b/companion/src/printdialog.ui index 0f4b05111..20e2a7b63 100644 --- a/companion/src/printdialog.ui +++ b/companion/src/printdialog.ui @@ -80,7 +80,7 @@ closeButton clicked() - printDialog + PrintDialog reject() From 1a6906bbb3ce5919a2fb152a106247a3af7c7f04 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Wed, 30 Apr 2014 22:58:54 +0200 Subject: [PATCH 11/79] Input name missing from mixer sources --- companion/src/modeledit/mixes.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/companion/src/modeledit/mixes.cpp b/companion/src/modeledit/mixes.cpp index 56bf98c47..7b01d83e6 100644 --- a/companion/src/modeledit/mixes.cpp +++ b/companion/src/modeledit/mixes.cpp @@ -170,6 +170,10 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch) default: str += " "; break; }; + //set mixer src model if it is unset (srcRaw needs this to generate proper toString() for input source type) + if (md->srcRaw.model == 0) + md->srcRaw.model = &model; + //highlight source if needed if ( (md->srcRaw.type == SOURCE_TYPE_CH) && (md->srcRaw.index+1 == (int)highlightedSource) ) { str += " " + Qt::escape(md->srcRaw.toString()) + ""; From 88e7ad4b8cb820f0fc80f2b6390faf13e2afa8c3 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Wed, 30 Apr 2014 23:16:49 +0200 Subject: [PATCH 12/79] Better display of inputs with assigned name --- companion/src/helpers.cpp | 7 +++++-- companion/src/modeledit/inputs.cpp | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp index cc9dc5740..836dee391 100644 --- a/companion/src/helpers.cpp +++ b/companion/src/helpers.cpp @@ -63,8 +63,11 @@ QString getInputStr(ModelData & model, int index) QString result; if (GetCurrentFirmware()->getCapability(VirtualInputs)) { - result = model.inputNames[index]; - if (result.isEmpty()) { + if (strlen(model.inputNames[index]) > 0) { + result = QObject::tr("[I%1]").arg(index+1); + result += QString(model.inputNames[index]); + } + else { result = QObject::tr("Input%1").arg(index+1, 2, 10, QChar('0')); } } diff --git a/companion/src/modeledit/inputs.cpp b/companion/src/modeledit/inputs.cpp index 3852264c7..9c7d8d5f3 100644 --- a/companion/src/modeledit/inputs.cpp +++ b/companion/src/modeledit/inputs.cpp @@ -144,13 +144,13 @@ QString InputsPanel::getInputText(int dest, bool * new_ch) if ((dest == 0) || (model.expoData[dest-1].chn != md->chn)) { if (new_ch) *new_ch = 1; if (firmware->getCapability(VirtualInputs)) - str = QString("%1").arg(getInputStr(model, md->chn), -8, ' '); + str = QString("%1").arg(getInputStr(model, md->chn), -10, ' '); else str = getInputStr(model, md->chn); } else { if (firmware->getCapability(VirtualInputs)) - str = " "; + str = " "; else str = " "; } From d2c42c780ff4732b3dba591669c0d6cdac862f96 Mon Sep 17 00:00:00 2001 From: bsongis Date: Thu, 1 May 2014 09:19:34 +0200 Subject: [PATCH 13/79] Fixes #1026 (VC++ compiler only). Would someone check that this fix doesn't increase flash usage on 9x stock? Thanks! --- radio/src/myeeprom.h | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 60635602b..8bbd030e9 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -906,23 +906,22 @@ PACK(typedef struct t_CustomFnData { // Function Switches data #else PACK(typedef struct t_CustomFnData { PACK(union { - struct { - int8_t swtch:6; - uint16_t func:4; - uint8_t mode:2; - uint8_t param:3; - uint8_t active:1; - } gvar; + PACK(struct { + int16_t swtch:6; + uint16_t func:4; + uint16_t mode:2; + uint16_t param:3; + uint16_t active:1; + }) gvar; - struct { - int8_t swtch:6; - uint16_t func:4; - uint8_t param:4; - uint8_t spare:1; - uint8_t active:1; - } all; + PACK(struct { + int16_t swtch:6; + uint16_t func:4; + uint16_t param:4; + uint16_t spare:1; + uint16_t active:1; + }) all; }); - uint8_t value; }) CustomFnData; #define CFN_SWITCH(p) ((p)->all.swtch) From b092607553b9223d7b7bf8d3de1a2653dabe6184 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Thu, 1 May 2014 09:46:38 +0200 Subject: [PATCH 14/79] Save/restore of simulator switches, fixes #1034 --- companion/src/simulation/simulatordialog.cpp | 95 ++++++++++++++++++++ companion/src/simulation/simulatordialog.h | 6 ++ 2 files changed, 101 insertions(+) diff --git a/companion/src/simulation/simulatordialog.cpp b/companion/src/simulation/simulatordialog.cpp index be7346be5..6fac50450 100644 --- a/companion/src/simulation/simulatordialog.cpp +++ b/companion/src/simulation/simulatordialog.cpp @@ -25,6 +25,8 @@ SimulatorDialog::SimulatorDialog(QWidget * parent, unsigned int flags): { } +uint32_t SimulatorDialog9X::switchstatus = 0; + SimulatorDialog9X::SimulatorDialog9X(QWidget * parent, unsigned int flags): SimulatorDialog(parent, flags), ui(new Ui::SimulatorDialog9X), @@ -56,6 +58,10 @@ SimulatorDialog9X::SimulatorDialog9X(QWidget * parent, unsigned int flags): break; } + //restore switches + if (settings.value("simuSW",false).toBool()) + restoreSwitches(); + ui->trimHR_L->setText(QString::fromUtf8(leftArrow)); ui->trimHR_R->setText(QString::fromUtf8(rightArrow)); ui->trimVR_U->setText(QString::fromUtf8(upArrow)); @@ -90,9 +96,12 @@ SimulatorDialog9X::SimulatorDialog9X(QWidget * parent, unsigned int flags): SimulatorDialog9X::~SimulatorDialog9X() { + saveSwitches(); delete ui; } +uint32_t SimulatorDialogTaranis::switchstatus = 0; + SimulatorDialogTaranis::SimulatorDialogTaranis(QWidget * parent, unsigned int flags): SimulatorDialog(parent, flags), ui(new Ui::SimulatorDialogTaranis) @@ -105,6 +114,11 @@ SimulatorDialogTaranis::SimulatorDialogTaranis(QWidget * parent, unsigned int fl ui->lcd->setBackgroundColor(47, 123, 227); + //restore switches + QSettings settings; + if (settings.value("simuSW",false).toBool()) + restoreSwitches(); + ui->trimHR_L->setText(QString::fromUtf8(leftArrow)); ui->trimHR_R->setText(QString::fromUtf8(rightArrow)); ui->trimVR_U->setText(QString::fromUtf8(upArrow)); @@ -136,6 +150,7 @@ SimulatorDialogTaranis::SimulatorDialogTaranis(QWidget * parent, unsigned int fl SimulatorDialogTaranis::~SimulatorDialogTaranis() { + saveSwitches(); delete ui; } @@ -592,6 +607,46 @@ void SimulatorDialog9X::getValues() simulator->setValues(inputs); } +void SimulatorDialog9X::saveSwitches(void) +{ + qDebug() << "SimulatorDialog9X::saveSwitches()"; + switchstatus=ui->switchTHR->isChecked(); + switchstatus<<=1; + switchstatus+=(ui->switchRUD->isChecked()&0x1); + switchstatus<<=1; + switchstatus+=(ui->switchID2->isChecked()&0x1); + switchstatus<<=1; + switchstatus+=(ui->switchID1->isChecked()&0x1); + switchstatus<<=1; + switchstatus+=(ui->switchID0->isChecked()&0x1); + switchstatus<<=1; + switchstatus+=(ui->switchGEA->isChecked()&0x1); + switchstatus<<=1; + switchstatus+=(ui->switchELE->isChecked()&0x1); + switchstatus<<=1; + switchstatus+=(ui->switchAIL->isChecked()&0x1); +} + +void SimulatorDialog9X::restoreSwitches(void) +{ + qDebug() << "SimulatorDialog9X::restoreSwitches()"; + ui->switchAIL->setChecked(switchstatus & 0x1); + switchstatus >>=1; + ui->switchELE->setChecked(switchstatus & 0x1); + switchstatus >>=1; + ui->switchGEA->setChecked(switchstatus & 0x1); + switchstatus >>=1; + ui->switchID0->setChecked(switchstatus & 0x1); + switchstatus >>=1; + ui->switchID1->setChecked(switchstatus & 0x1); + switchstatus >>=1; + ui->switchID2->setChecked(switchstatus & 0x1); + switchstatus >>=1; + ui->switchRUD->setChecked(switchstatus & 0x1); + switchstatus >>=1; + ui->switchTHR->setChecked(switchstatus & 0x1); +} + void SimulatorDialogTaranis::resetSH() { ui->switchH->setValue(0); @@ -657,6 +712,46 @@ void SimulatorDialogTaranis::getValues() simulator->setValues(inputs); } +void SimulatorDialogTaranis::saveSwitches(void) +{ + qDebug() << "SimulatorDialogTaranis::saveSwitches()"; + switchstatus=ui->switchA->value(); + switchstatus<<=2; + switchstatus+=ui->switchB->value(); + switchstatus<<=2; + switchstatus+=ui->switchC->value(); + switchstatus<<=2; + switchstatus+=ui->switchD->value(); + switchstatus<<=2; + switchstatus+=ui->switchE->value(); + switchstatus<<=2; + switchstatus+=ui->switchF->value(); + switchstatus<<=2; + switchstatus+=ui->switchG->value(); + switchstatus<<=2; + switchstatus+=ui->switchH->value(); +} + +void SimulatorDialogTaranis::restoreSwitches(void) +{ + qDebug() << "SimulatorDialogTaranis::restoreSwitches()"; + ui->switchH->setValue(switchstatus & 0x3); + switchstatus>>=2; + ui->switchG->setValue(switchstatus & 0x3); + switchstatus>>=2; + ui->switchF->setValue(switchstatus & 0x3); + switchstatus>>=2; + ui->switchE->setValue(switchstatus & 0x3); + switchstatus>>=2; + ui->switchD->setValue(switchstatus & 0x3); + switchstatus>>=2; + ui->switchC->setValue(switchstatus & 0x3); + switchstatus>>=2; + ui->switchB->setValue(switchstatus & 0x3); + switchstatus>>=2; + ui->switchA->setValue(switchstatus & 0x3); +} + inline int chVal(int val) { return qMin(1024, qMax(-1024, val)); diff --git a/companion/src/simulation/simulatordialog.h b/companion/src/simulation/simulatordialog.h index ab4128da7..0425c7361 100644 --- a/companion/src/simulation/simulatordialog.h +++ b/companion/src/simulation/simulatordialog.h @@ -141,12 +141,15 @@ class SimulatorDialog9X: public SimulatorDialog virtual void getValues(); virtual void setLightOn(bool enable); virtual void updateBeepButton(); + void saveSwitches(void); + void restoreSwitches(void); private slots: void dialChanged(); private: Ui::SimulatorDialog9X * ui; + static uint32_t switchstatus; int beepShow; }; @@ -161,9 +164,12 @@ class SimulatorDialogTaranis: public SimulatorDialog protected: virtual void getValues(); + void saveSwitches(void); + void restoreSwitches(void); private: Ui::SimulatorDialogTaranis * ui; + static uint32_t switchstatus; private slots: void resetSH(); From 624bdf4a937bb65a352da30f5bcbdef4346ed091 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 1 May 2014 15:02:05 +0200 Subject: [PATCH 15/79] Update DONATIONS.txt --- DONATIONS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/DONATIONS.txt b/DONATIONS.txt index 3b9ebe1de..ff498e5f2 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -384,3 +384,4 @@ Serge Michaux Robert Young Wilco Hijink Roy Nixon +Lexington S Morley From a3b47625f593bcb0308cb0a40a6d28056361e591 Mon Sep 17 00:00:00 2001 From: Kjell Kernen Date: Thu, 1 May 2014 20:08:29 +0200 Subject: [PATCH 16/79] This commit removes the direct use of QSettings from the simulator and replaces it with references to the protected global variable g --- companion/src/simulation/simulatordialog.cpp | 35 ++++++++------------ companion/src/simulator.cpp | 1 - 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/companion/src/simulation/simulatordialog.cpp b/companion/src/simulation/simulatordialog.cpp index 6fac50450..2003abf18 100644 --- a/companion/src/simulation/simulatordialog.cpp +++ b/companion/src/simulation/simulatordialog.cpp @@ -37,8 +37,7 @@ SimulatorDialog9X::SimulatorDialog9X(QWidget * parent, unsigned int flags): initUi(ui); - QSettings settings; - backLight = settings.value("backLight", 0).toInt(); + backLight = g.backLight(); if (backLight > 4) backLight = 0; switch (backLight) { case 1: @@ -59,7 +58,7 @@ SimulatorDialog9X::SimulatorDialog9X(QWidget * parent, unsigned int flags): } //restore switches - if (settings.value("simuSW",false).toBool()) + if (g.simuSW()) restoreSwitches(); ui->trimHR_L->setText(QString::fromUtf8(leftArrow)); @@ -115,8 +114,7 @@ SimulatorDialogTaranis::SimulatorDialogTaranis(QWidget * parent, unsigned int fl ui->lcd->setBackgroundColor(47, 123, 227); //restore switches - QSettings settings; - if (settings.value("simuSW",false).toBool()) + if (g.simuSW()) restoreSwitches(); ui->trimHR_L->setText(QString::fromUtf8(leftArrow)); @@ -297,31 +295,26 @@ void SimulatorDialog::initUi(T * ui) setFixedSize(width(), height()); #ifdef JOYSTICKS - QSettings settings; - bool js_enable = settings.value("js_support",false).toBool(); - int js_ctrl=settings.value("js_ctrl",-1).toInt(); - if (js_enable) { - settings.beginGroup("JsCalibration"); + if (g.jsSupport()) { int count=0; - for (int j=0; j<8;j++){ - int axe=settings.value(QString("stick%1_axe").arg(j),-1).toInt(); + for (int j=0; j<8; j++){ + int axe = g.joystick[j].stick_axe(); if (axe>=0 && axe<8) { jsmap[axe]=j; - jscal[axe][0]=settings.value(QString("stick%1_min").arg(j),-32767).toInt(); - jscal[axe][1]=settings.value(QString("stick%1_med").arg(j),0).toInt(); - jscal[axe][2]=settings.value(QString("stick%1_max").arg(j),0).toInt(); - jscal[axe][3]=settings.value(QString("stick%1_inv").arg(j),0).toInt(); + jscal[axe][0] = g.joystick[j].stick_min(); + jscal[axe][1] = g.joystick[j].stick_med(); + jscal[axe][2] = g.joystick[j].stick_max(); + jscal[axe][3] = g.joystick[j].stick_inv(); count++; } } - settings.endGroup(); if (count<3) { QMessageBox::critical(this, tr("Warning"), tr("Joystick enabled but not configured correctly")); } - if (js_ctrl!=-1) { + if (g.jsCtrl()!=-1) { joystick = new Joystick(this); if (joystick) { - if (joystick->open(js_ctrl)) { + if (joystick->open(g.jsCtrl())) { int numAxes=std::min(joystick->numAxes,8); for (int j=0; jsensitivities[j] = 0; @@ -433,10 +426,8 @@ void SimulatorDialog::initUi(T * ui) void SimulatorDialog::onButtonPressed(int value) { if (value == Qt::Key_Print) { - QSettings settings; - bool toclipboard = settings.value("snapshot_to_clipboard", false).toBool(); QString fileName = ""; - if (!toclipboard) { + if (!g.snapToClpbrd()) { fileName = QString("screenshot-%1.png").arg(++screenshotIdx); } lcd->makeScreenshot(fileName); diff --git a/companion/src/simulator.cpp b/companion/src/simulator.cpp index 0bd5e4649..32758de7c 100644 --- a/companion/src/simulator.cpp +++ b/companion/src/simulator.cpp @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include From ab23afa5fda433788a743b3768054df4a4060da3 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 1 May 2014 21:15:35 +0200 Subject: [PATCH 17/79] Update DONATIONS.txt --- DONATIONS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/DONATIONS.txt b/DONATIONS.txt index ff498e5f2..102ad1541 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -385,3 +385,4 @@ Robert Young Wilco Hijink Roy Nixon Lexington S Morley +Daryl Dacko From 044ceb37accb7c3fcaff2f2929c6ff1c0bbdde36 Mon Sep 17 00:00:00 2001 From: mhotar Date: Thu, 1 May 2014 22:44:22 +0200 Subject: [PATCH 18/79] radio cz translations --- radio/src/translations/cz.h.txt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index fd08d6828..412963934 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -449,7 +449,7 @@ #define TR_POPUPS TR_ENTER"\010[EXIT]" #define OFS_EXIT sizeof(TR_ENTER) -#define TR_MENUWHENDONE CENTER "\007"TR_ENTER" > DALŠÍ" +#define TR_MENUWHENDONE CENTER "\011"TR_ENTER" > DALŠÍ" #define TR_FREE TR("volné:", "volných") #define TR_DELETEMODEL "SMAZAT MODEL" #define TR_COPYINGMODEL "Kopíruji model.." @@ -481,7 +481,7 @@ #define TR_FADEIN "Přechod Zap" #define TR_FADEOUT "Přechod Vyp" #define TR_DEFAULT "(výchozí)" -#define TR_CHECKTRIMS "\006Kont.\012Trimy" +#define TR_CHECKTRIMS "\011Kont.\010Trimy" #define OFS_CHECKTRIMS (9*FW) #define TR_SWASHTYPE "Typ cykliky" #define TR_COLLECTIVE "Kolektiv" @@ -556,9 +556,9 @@ #define TR_CAL "Kal." #define TR_VTRIM "Trim- +" #define TR_BG "BG:" -#define TR_MENUTOSTART CENTER "\010" TR_ENTER " = START" -#define TR_SETMIDPOINT TR(CENTER "\003Nastav páky na střed", CENTER "\004Nastav páky na střed") -#define TR_MOVESTICKSPOTS TR(CENTER "\005Hýbej pákami/poty", "\010Hýbej pákami i potenciometry") +#define TR_MENUTOSTART CENTER "\011" TR_ENTER " = START" +#define TR_SETMIDPOINT CENTER "\004Nastav páky na střed" +#define TR_MOVESTICKSPOTS TR(CENTER "\006Hýbej pákami/poty", "\014Hýbej pákami i potenciometry") #define TR_RXBATT "Rx Bat.:" #define TR_TXnRX "Tx:\0Rx:" #define OFS_RX 4 @@ -586,12 +586,12 @@ #define TR_MIX "MIX" #define TR_EEPROMLOWMEM "Dochází EEPROM" #define TR_ALERT "\006 POZOR" -#define TR_PRESSANYKEYTOSKIP "Klávesa >>> přeskočit" -#define TR_THROTTLENOTIDLE TR("Páka plynu je pohnutá", "Páka plynu není na nule") +#define TR_PRESSANYKEYTOSKIP TR("\003Klávesa >>> přeskočit", "Klávesa >>> přeskočit") +#define TR_THROTTLENOTIDLE TR("\003Páka plynu je pohnutá", "Páka plynu není na nule") #define TR_ALARMSDISABLED "Alarmy jsou zakázány" -#define TR_PRESSANYKEY "\006Stiskni klávesu" -#define TR_BADEEPROMDATA "\006Chyba dat EEPROM" -#define TR_EEPROMFORMATTING "\004Formatování EEPROM" +#define TR_PRESSANYKEY TR("\006Stiskni klávesu", "Stiskni klávesu") +#define TR_BADEEPROMDATA TR("\006Chyba dat EEPROM", "Chyba dat EEPROM") +#define TR_EEPROMFORMATTING TR("\004Formatování EEPROM", "Formatování EEPROM") #define TR_EEPROMOVERFLOW "Přetekla EEPROM" #define TR_MENURADIOSETUP "NASTAVENÍ RÁDIA" #define TR_MENUDATEANDTIME "DATUM A čAS" @@ -600,7 +600,7 @@ #define TR_MENUDIAG "DIAG" #define TR_MENUANA "ANALOGY" #define TR_MENUCALIBRATION "KALIBRACE" -#define TR_TRIMS2OFFSETS "\004Trimy => Subtrimy" +#define TR_TRIMS2OFFSETS "\006Trimy => Subtrimy" #define TR_MENUMODELSEL "MODEL" #define TR_MENUSETUP "NASTAVENÍ" #define TR_MENUFLIGHTPHASE "LETOVÝ REŽIM" @@ -775,7 +775,7 @@ #define TR_SCRIPT "Skript" #define TR_INPUTS "Vstupy" #define TR_OUTPUTS "Výstupy" -#define TR_EEBACKUP "\004[ENTER Long] to backup the EEPROM" +#define TR_EEBACKUP "\010[dlouze ENTER] zálohuje EEPROM" #if defined(MAVLINK) #define TR_MAVLINK_RC_RSSI_SCALE_LABEL "Max RSSI" From ad0e497d177cc77a33c0015766338461261f7906 Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 2 May 2014 09:26:04 +0200 Subject: [PATCH 19/79] PLAY_NOW cannot be used with wav files! --- radio/src/audio_arm.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/radio/src/audio_arm.cpp b/radio/src/audio_arm.cpp index 70aca2915..8fd43e9b4 100644 --- a/radio/src/audio_arm.cpp +++ b/radio/src/audio_arm.cpp @@ -879,16 +879,6 @@ void AudioQueue::playFile(const char *filename, uint8_t flags, uint8_t id) strcpy(fragment.file, filename); fragment.id = id; } - else if (flags & PLAY_NOW) { - AudioFragment & fragment = priorityContext.fragment; - if (fragment.type == FRAGMENT_EMPTY) { - priorityContext.clear(); - fragment.type = FRAGMENT_FILE; - strcpy(fragment.file, filename); - fragment.repeat = flags & 0x0f; - fragment.id = id; - } - } else { uint8_t next_widx = (widx + 1) % AUDIO_QUEUE_LENGTH; if (next_widx != ridx) { From e30cd901409e3369f9bc6db181925bc56a26861e Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 2 May 2014 10:09:52 +0200 Subject: [PATCH 20/79] AudioQueue::stopAll() instead of AudioQueue::reset() --- radio/src/audio_arm.cpp | 4 ++-- radio/src/audio_arm.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/radio/src/audio_arm.cpp b/radio/src/audio_arm.cpp index 8fd43e9b4..8b1c3457c 100644 --- a/radio/src/audio_arm.cpp +++ b/radio/src/audio_arm.cpp @@ -912,13 +912,13 @@ void AudioQueue::stopPlay(uint8_t id) void AudioQueue::stopSD() { sdAvailableSystemAudioFiles = 0; - reset(); + stopAll(); playTone(0, 0, 100, PLAY_NOW); // insert a 100ms pause } #endif -void AudioQueue::reset() +void AudioQueue::stopAll() { CoEnterMutexSection(audioMutex); widx = ridx; // clean the queue diff --git a/radio/src/audio_arm.h b/radio/src/audio_arm.h index 65a9d6233..825f82fd7 100644 --- a/radio/src/audio_arm.h +++ b/radio/src/audio_arm.h @@ -161,6 +161,8 @@ class AudioQueue { void stopPlay(uint8_t id); + void stopAll(); + void pause(uint16_t tLen); void stopSD(); @@ -177,8 +179,6 @@ class AudioQueue { return ridx == widx; } - void reset(); - inline AudioBuffer * getNextFilledBuffer() { if (buffers[bufferRIdx].state == AUDIO_BUFFER_PLAYING) { @@ -322,7 +322,7 @@ void pushPrompt(uint16_t prompt, uint8_t id=0); #define PLAY_VALUE(v, id) playValue((v), (id)) #define PLAY_FILE(f, flags, id) audioQueue.playFile((f), (flags), (id)) #define STOP_PLAY(id) audioQueue.stopPlay((id)) -#define AUDIO_RESET() audioQueue.reset() +#define AUDIO_RESET() audioQueue.stopAll() #if defined(SDCARD) extern tmr10ms_t timeAutomaticPromptsSilence; From 16c05c21b6bc385fdfe34a103d7e4c4f9422520d Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 2 May 2014 10:11:01 +0200 Subject: [PATCH 21/79] Fixes #1044 --- radio/src/gui/menu_general.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radio/src/gui/menu_general.cpp b/radio/src/gui/menu_general.cpp index 2459bfd04..0f070bbfe 100644 --- a/radio/src/gui/menu_general.cpp +++ b/radio/src/gui/menu_general.cpp @@ -815,7 +815,8 @@ void onSdManagerMenu(const char *result) f_getcwd(lfn, _MAX_LFN); strcat(lfn, "/"); strcat(lfn, reusableBuffer.sdmanager.lines[index]); - audioQueue.playFile(lfn, PLAY_BACKGROUND, 255); + audioQueue.stopAll(); + audioQueue.playFile(lfn, 0, 255); } #endif #if defined(PCBTARANIS) From 363bc745ce1224d7287ebe88ca497065706ff8d8 Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 2 May 2014 10:38:54 +0200 Subject: [PATCH 22/79] Fixes #1035 --- radio/src/opentx.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index fe8dd65ce..e436b9678 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -765,7 +765,7 @@ int intpol(int x, uint8_t idx) // -100, -75, -50, -25, 0 ,25 ,50, 75, 100 #if defined(PCBTARANIS) int applyCurve(int x, CurveRef & curve) { - switch(curve.type) { + switch (curve.type) { case CURVE_REF_DIFF: { int curveParam = calc100to256(GET_GVAR(curve.value, -100, 100, s_perout_flight_phase)); @@ -780,7 +780,7 @@ int applyCurve(int x, CurveRef & curve) return expo(x, GET_GVAR(curve.value, -100, 100, s_perout_flight_phase)); case CURVE_REF_FUNC: - switch(curve.value) { + switch (curve.value) { case CURVE_X_GT0: if (x < 0) x = 0; //x|x>0 return x; @@ -3057,7 +3057,7 @@ uint16_t isqrt32(uint32_t n) uint16_t c = 0x8000; uint16_t g = 0x8000; - for(;;) { + for (;;) { if ((uint32_t)g*g > n) g ^= c; c >>= 1; @@ -3973,8 +3973,7 @@ void perOut(uint8_t mode, uint8_t tick10ms) //========== CURVES =============== #if defined(PCBTARANIS) - // TODO something cleaner ... - if (apply_offset_and_curve && md->curve.value) { + if (apply_offset_and_curve && md->curve.type != CURVE_REF_DIFF && md->curve.value) { v = applyCurve(v, md->curve); } #else @@ -3994,8 +3993,12 @@ void perOut(uint8_t mode, uint8_t tick10ms) } #endif -#if !defined(PCBTARANIS) // TODO move before WEIGHT for readability //========== DIFFERENTIAL ========= +#if defined(PCBTARANIS) + if (md->curve.type == CURVE_REF_DIFF && md->curve.value) { + dv = applyCurve(dv, md->curve); + } +#else if (md->curveMode == MODE_DIFFERENTIAL) { // @@@2 also recalculate curveParam to a 256 basis which ease the calculation later a lot int16_t curveParam = calc100to256(GET_GVAR(md->curveParam, -100, 100, s_perout_flight_phase)); From 72d0f2e6f6b45480d41caf7a20d002be82c7745e Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 2 May 2014 11:04:57 +0200 Subject: [PATCH 23/79] Fixes #1043 --- companion/src/firmwares/opentx/opentxeeprom.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 475460ba7..61ea043a4 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -1750,11 +1750,11 @@ class ArmCustomFunctionField: public TransformedField { internalField.Append(new CharField<6>(_param, false)); if (version >= 216) { - internalField.Append(new UnsignedField<8>(_active)); + internalField.Append(new SignedField<8>(_active)); } else if (version >= 214) { internalField.Append(new UnsignedField<2>(_mode)); - internalField.Append(new UnsignedField<6>(_active)); + internalField.Append(new UnsignedField<6>((unsigned int &)_active)); } else { internalField.Append(new UnsignedField<8>((unsigned int &)_active)); @@ -1915,7 +1915,7 @@ class ArmCustomFunctionField: public TransformedField { CustomFunctionsConversionTable functionsConversionTable; SourcesConversionTable * sourcesConversionTable; char _param[10]; - unsigned int _active; + int _active; unsigned int _mode; }; From 48328a7f8ab87a5933b5a4eca102de8d626ec0c6 Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 2 May 2014 13:11:15 +0200 Subject: [PATCH 24/79] Fixes #1013 - ~ and \t added to the mapped chars in notes --- radio/src/gui/view_text.cpp | 11 ++++++++++- radio/src/lcd.cpp | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/radio/src/gui/view_text.cpp b/radio/src/gui/view_text.cpp index 4bd54f97e..8d86623cf 100644 --- a/radio/src/gui/view_text.cpp +++ b/radio/src/gui/view_text.cpp @@ -37,7 +37,7 @@ #include "../opentx.h" #define TEXT_FILENAME_MAXLEN 40 -#define TEXT_FILE_MAXSIZE 1000 +#define TEXT_FILE_MAXSIZE 2048 char s_text_file[TEXT_FILENAME_MAXLEN]; char s_text_screen[LCD_LINES-1][LCD_COLS+1]; @@ -72,15 +72,24 @@ void readTextFile(int & lines_count) escape_chars[escape-1] = c; if (escape == 2 && !strncmp(escape_chars, "up", 2)) { c = '\300'; + escape = 0; } else if (escape == 2 && !strncmp(escape_chars, "dn", 2)) { c = '\301'; + escape = 0; + } + else if (escape == 1 && escape_chars[0] == 't') { + c = 0x09; // tab + escape = 0; } else { escape++; continue; } } + else if (c=='~') { + c = 'z'+1; + } escape = 0; s_text_screen[current_line-s_pgOfs][line_length++] = c; } diff --git a/radio/src/lcd.cpp b/radio/src/lcd.cpp index fd998a50c..24347e956 100644 --- a/radio/src/lcd.cpp +++ b/radio/src/lcd.cpp @@ -368,13 +368,13 @@ void lcd_putsnAtt(xcoord_t x, uint8_t y, const pm_char * s, uint8_t len, LcdFlag if (y >= LCD_H) break; } #if defined(CPUARM) - else if (c == 0x1D) { //TAB + else if (c == 0x1D) { // TAB x |= 0x3F; x += 1; } #endif else { - x += (c*FW/2); //EXTENDED SPACE + x += (c*FW/2); // EXTENDED SPACE } s++; } From 3b4053d850636fb499056ba60f1c3fa3e187e1a8 Mon Sep 17 00:00:00 2001 From: Andre Bernet Date: Fri, 2 May 2014 14:40:18 +0200 Subject: [PATCH 25/79] Companion support - DON'T FORGET COMPILE SCRIPT! --- .../opentx/opentxGruvin9xsimulator.cpp | 1 + .../firmwares/opentx/opentxM128simulator.cpp | 1 + .../firmwares/opentx/opentxSky9xsimulator.cpp | 1 + .../src/firmwares/opentx/opentxinterface.cpp | 2 + .../src/firmwares/opentx/opentxsimulator.cpp | 1 + companion/src/generaledit.cpp | 24 + companion/src/generaledit.h | 1 + companion/src/generaledit.ui | 688 ++++++++++-------- 8 files changed, 397 insertions(+), 322 deletions(-) diff --git a/companion/src/firmwares/opentx/opentxGruvin9xsimulator.cpp b/companion/src/firmwares/opentx/opentxGruvin9xsimulator.cpp index bca5842ad..fec38521b 100644 --- a/companion/src/firmwares/opentx/opentxGruvin9xsimulator.cpp +++ b/companion/src/firmwares/opentx/opentxGruvin9xsimulator.cpp @@ -47,6 +47,7 @@ #define GAUGES #define GPS #define FAI_CHOICE +#define FRSKY_STICKS #define EEPROM_VARIANT 3 diff --git a/companion/src/firmwares/opentx/opentxM128simulator.cpp b/companion/src/firmwares/opentx/opentxM128simulator.cpp index 14100e857..708a4273b 100644 --- a/companion/src/firmwares/opentx/opentxM128simulator.cpp +++ b/companion/src/firmwares/opentx/opentxM128simulator.cpp @@ -45,6 +45,7 @@ #define GAUGES #define GPS #define FAI_CHOICE +#define FRSKY_STICKS #define EEPROM_VARIANT SIMU_M128_VARIANTS #define GAUGES diff --git a/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp b/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp index 21d9df740..3a45875b1 100644 --- a/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp +++ b/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp @@ -53,6 +53,7 @@ #define GAUGES #define GPS #define FAI_CHOICE +#define FRSKY_STICKS #define NUM_POTS 3 #define EEPROM_VARIANT 3 diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index b80113ad5..dd30f5db3 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -1055,6 +1055,7 @@ void RegisterOpen9xFirmwares() open9x->addOption("nogps", QObject::tr("No GPS support")); open9x->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen")); open9x->addOption("fasoffset", QObject::tr("Allow compensating for offset errors in FrSky FAS current sensors")); + open9x->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)")); open9x->addOptions(fai_options); firmwares.push_back(open9x); @@ -1121,6 +1122,7 @@ void RegisterOpen9xFirmwares() open9x->addOption("novario", QObject::tr("No vario support")); open9x->addOption("nogps", QObject::tr("No GPS support")); open9x->addOption("nogauges", QObject::tr("No gauges in the custom telemetry screen")); + open9x->addOption("stickrev", QObject::tr("Add support for reversing stick inputs (e.g. needed for FrSky gimbals)")); open9x->addOptions(fai_options); firmwares.push_back(open9x); diff --git a/companion/src/firmwares/opentx/opentxsimulator.cpp b/companion/src/firmwares/opentx/opentxsimulator.cpp index 05e680073..933b78b86 100644 --- a/companion/src/firmwares/opentx/opentxsimulator.cpp +++ b/companion/src/firmwares/opentx/opentxsimulator.cpp @@ -49,6 +49,7 @@ #define GAUGES #define GPS #define FAI_CHOICE +#define FRSKY_STICKS #define EEPROM_VARIANT SIMU_STOCK_VARIANTS #define GAUGES diff --git a/companion/src/generaledit.cpp b/companion/src/generaledit.cpp index 558c78b69..1efb43e65 100644 --- a/companion/src/generaledit.cpp +++ b/companion/src/generaledit.cpp @@ -284,6 +284,24 @@ GeneralEdit::GeneralEdit(RadioData &radioData, QWidget *parent) : ui->serialPortMode->hide(); ui->serialPortLabel->hide(); } + + if (!IS_TARANIS(eepromInterface->getBoard())) { + ui->stickReverse1->setChecked(g_eeGeneral.stickReverse & (1 << 0)); + ui->stickReverse2->setChecked(g_eeGeneral.stickReverse & (1 << 1)); + ui->stickReverse3->setChecked(g_eeGeneral.stickReverse & (1 << 2)); + ui->stickReverse4->setChecked(g_eeGeneral.stickReverse & (1 << 3)); + connect(ui->stickReverse1, SIGNAL(toggled(bool)), this, SLOT(stickReverseEdited())); + connect(ui->stickReverse2, SIGNAL(toggled(bool)), this, SLOT(stickReverseEdited())); + connect(ui->stickReverse3, SIGNAL(toggled(bool)), this, SLOT(stickReverseEdited())); + connect(ui->stickReverse4, SIGNAL(toggled(bool)), this, SLOT(stickReverseEdited())); + } + else { + ui->stickReverseLB->hide(); + ui->stickReverse1->hide(); + ui->stickReverse2->hide(); + ui->stickReverse3->hide(); + ui->stickReverse4->hide(); + } } GeneralEdit::~GeneralEdit() @@ -291,6 +309,12 @@ GeneralEdit::~GeneralEdit() delete ui; } +void GeneralEdit::stickReverseEdited() +{ + g_eeGeneral.stickReverse = ((int)ui->stickReverse1->isChecked()) | ((int)ui->stickReverse2->isChecked()<<1) | ((int)ui->stickReverse3->isChecked()<<2) | ((int)ui->stickReverse4->isChecked()<<3); + updateSettings(); +} + void GeneralEdit::on_pot1Type_currentIndexChanged(int index) { g_eeGeneral.potsType[0] = index; diff --git a/companion/src/generaledit.h b/companion/src/generaledit.h index 395adc24c..221ea02d1 100644 --- a/companion/src/generaledit.h +++ b/companion/src/generaledit.h @@ -130,6 +130,7 @@ private slots: void unlockSwitchEdited(); void setValues(); void shrink(); + void stickReverseEdited(); }; #endif // GENERALEDIT_H diff --git a/companion/src/generaledit.ui b/companion/src/generaledit.ui index 1b59ef886..16b2b7d81 100644 --- a/companion/src/generaledit.ui +++ b/companion/src/generaledit.ui @@ -113,134 +113,6 @@ These will be relevant for all models in the same EEPROM. Setup - - - - - - Country Code - - - - - - - - America - - - - - Japan - - - - - Europe - - - - - - - - - - - - - - - - Mode selection: - -Mode 1: - Left stick: Elevator, Rudder - Right stick: Throttle, Aileron - -Mode 2: - Left stick: Throttle, Rudder - Right stick: Elevator, Aileron - -Mode 3: - Left stick: Elevator, Aileron - Right stick: Throttle, Rudder - -Mode 4: - Left stick: Throttle, Aileron - Right stick: Elevator, Rudder - - - - - 1 - - - - Mode 1 (RUD ELE THR AIL) - - - - - Mode 2 (RUD THR ELE AIL) - - - - - Mode 3 (AIL ELE THR RUD) - - - - - Mode 4 (AIL THR ELE RUD) - - - - - - - - - 4800 Baud - - - - - 9600 Baud - - - - - 14400 Baud - - - - - 19200 Baud - - - - - 38400 Baud - - - - - 57600 Baud - - - - - 76800 Baud - - - - - 115200 Baud - - - - @@ -248,6 +120,52 @@ Mode 4: + + + + If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. + + + + + + + + + + Speaker Pitch (spkr only) + + + + + + + + X-Short + + + + + Short + + + + + Normal + + + + + Long + + + + + X-Long + + + + @@ -344,6 +262,80 @@ Mode 4: + + + + + + Country Code + + + + + + + + America + + + + + Japan + + + + + Europe + + + + + + + + + + + 4800 Baud + + + + + 9600 Baud + + + + + 14400 Baud + + + + + 19200 Baud + + + + + 38400 Baud + + + + + 57600 Baud + + + + + 76800 Baud + + + + + 115200 Baud + + + + @@ -396,7 +388,7 @@ Mode 4: - + Qt::Vertical @@ -524,15 +516,8 @@ Mode 4: - - - - Stick Mode - - - - - + + 0 @@ -540,7 +525,7 @@ Mode 4: - Default Channel Order + Stick reverse @@ -638,188 +623,6 @@ Mode 4: - - - - - X-Short - - - - - Short - - - - - Normal - - - - - Long - - - - - X-Long - - - - - - - - Speaker Pitch (spkr only) - - - - - - - - - - - - - <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> - - - 0 - - - - R E T A - - - - - R E A T - - - - - R T E A - - - - - R T A E - - - - - R A E T - - - - - R A T E - - - - - E R T A - - - - - E R A T - - - - - E T R A - - - - - E T A R - - - - - E A R T - - - - - E A T R - - - - - T R E A - - - - - T R A E - - - - - T E R A - - - - - T E A R - - - - - T A R E - - - - - T A E R - - - - - A R E T - - - - - A R T E - - - - - A E R T - - - - - A E T R - - - - - A T R E - - - - - A T E R - - - - - - - - If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. - - - - - - @@ -1897,6 +1700,248 @@ Acceptable values are 5v..10v + + + + + 0 + 0 + + + + Default Channel Order + + + + + + + + + + + + + <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> + + + 0 + + + + R E T A + + + + + R E A T + + + + + R T E A + + + + + R T A E + + + + + R A E T + + + + + R A T E + + + + + E R T A + + + + + E R A T + + + + + E T R A + + + + + E T A R + + + + + E A R T + + + + + E A T R + + + + + T R E A + + + + + T R A E + + + + + T E R A + + + + + T E A R + + + + + T A R E + + + + + T A E R + + + + + A R E T + + + + + A R T E + + + + + A E R T + + + + + A E T R + + + + + A T R E + + + + + A T E R + + + + + + + + + + 1 + + + + + + + 2 + + + + + + + 3 + + + + + + + 4 + + + + + + + + + + + + + + + Mode selection: + +Mode 1: + Left stick: Elevator, Rudder + Right stick: Throttle, Aileron + +Mode 2: + Left stick: Throttle, Rudder + Right stick: Elevator, Aileron + +Mode 3: + Left stick: Elevator, Aileron + Right stick: Throttle, Rudder + +Mode 4: + Left stick: Throttle, Aileron + Right stick: Elevator, Rudder + + + + + 1 + + + + Mode 1 (RUD ELE THR AIL) + + + + + Mode 2 (RUD THR ELE AIL) + + + + + Mode 3 (AIL ELE THR RUD) + + + + + Mode 4 (AIL THR ELE RUD) + + + + + + + + Stick Mode + + + @@ -3199,7 +3244,6 @@ Acceptable values are 5v..10v - channelorderCB trnMode_1 trnChn_1 trnWeight_1 From 219e0ef5d5070c16e74b64bd4b1a6894874bb0a1 Mon Sep 17 00:00:00 2001 From: Andre Bernet Date: Fri, 2 May 2014 20:07:11 +0200 Subject: [PATCH 26/79] Better location for stick reverse as mapping is shown above --- companion/src/generaledit.ui | 90 ++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/companion/src/generaledit.ui b/companion/src/generaledit.ui index 16b2b7d81..7ec08d04c 100644 --- a/companion/src/generaledit.ui +++ b/companion/src/generaledit.ui @@ -516,19 +516,6 @@ These will be relevant for all models in the same EEPROM. - - - - - 0 - 0 - - - - Stick reverse - - - @@ -1849,38 +1836,6 @@ Acceptable values are 5v..10v - - - - - - 1 - - - - - - - 2 - - - - - - - 3 - - - - - - - 4 - - - - - @@ -1942,6 +1897,51 @@ Mode 4: + + + + + 0 + 0 + + + + Stick reverse (order as above) + + + + + + + + + 1 + + + + + + + 2 + + + + + + + 3 + + + + + + + 4 + + + + + From 0440bc6f34b8a54318d8c1e473f25838b65fc9be Mon Sep 17 00:00:00 2001 From: Andre Bernet Date: Fri, 2 May 2014 20:11:01 +0200 Subject: [PATCH 27/79] French translations --- companion/src/translations/companion_fr.ts | 1358 ++++++++++---------- 1 file changed, 705 insertions(+), 653 deletions(-) diff --git a/companion/src/translations/companion_fr.ts b/companion/src/translations/companion_fr.ts index 2099b5861..45b879b9d 100644 --- a/companion/src/translations/companion_fr.ts +++ b/companion/src/translations/companion_fr.ts @@ -4,27 +4,27 @@ AileronsPage - + No Non - + Yes, controlled by a single channel Oui, contrôlés par un seul canal - + Yes, controlled by two channels Oui, contrôlés par 2 canaux - + <br>First Aileron Channel: <br>Premier canal d'ailerons: - + Second Aileron Channel: Deuxième canal d'ailerons: @@ -32,27 +32,27 @@ AirbrakesPage - + No Non - + Yes, controlled by a single channel Oui, contrôlés par un seul canal - + Yes, controlled by two channels Oui, contrôlés par 2 canaux - + <br>First Airbrake Channel: <br>Premier canal de volets: - + Second Airbrake Channel: Deuxième canal de volets: @@ -565,22 +565,22 @@ Peut être différente de la langue du firmware BankPage - + One Un - + Two Deux - + <br>First Elevon Channel: <br>Premier canal d'élevons: - + Second Elevon Channel: Deuxième canal d'élevons: @@ -1160,7 +1160,7 @@ Peut être différente de la langue du firmware ConclusionPage - + OK, I understand. OK, compris! @@ -1168,22 +1168,22 @@ Peut être différente de la langue du firmware CurveGroup - + Diff - + Expo - + Func Fonc - + Curve Courbe @@ -1312,7 +1312,7 @@ Peut être différente de la langue du firmware Édition de la courbe %1 - + Not enough free points in EEPROM to store the curve. Pas assez de points disponibles en mémoire pour enregistrer la courbe. @@ -1403,22 +1403,22 @@ Peut être différente de la langue du firmware CyclicPage - + 90 - + 120 - + 120x - + 140 @@ -1552,22 +1552,22 @@ Si vide, la ligne est toujours active. FblPage - + Throttle Channel: Canal des gaz: - + Yaw Channel: Canal du lacet: - + Pitch Channel: Canal du tangage: - + Roll Channel: Canal du roulis: @@ -1665,27 +1665,27 @@ Peut être différente de la langue du firmware FlapsPage - + No Non - + Yes, controlled by a single channel Oui, contrôlés par un seul canal - + Yes, controlled by two channels Oui, contrôlés par 2 canaux - + <br>First Flap Channel: <br>Premier canal de volets: - + Second Flap Channel: Deuxième canal de volets: @@ -1751,17 +1751,17 @@ Peut être différente de la langue du firmware FlightModes - + Flight Mode %1 Phase de vol %1 - + (%1) - + (default) (par défaut) @@ -1769,17 +1769,17 @@ Peut être différente de la langue du firmware FlybarSelectionPage - + Has Flybar Avec barre de Bell - + Flybarless Sans barre de Bell - + Flybar: Barre de Bell: @@ -1787,17 +1787,17 @@ Peut être différente de la langue du firmware GeneralEdit - + v - + min - + sec @@ -1807,7 +1807,7 @@ Peut être différente de la langue du firmware Configuration - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -1822,12 +1822,12 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Plage de valeurs: 20...45</span></p></body></html> - + Inactivity Timer Alerte d'inactivité - + If not zero will sound beeps if the transmitter has been left without inputs for the specified number of minutes. Si différent de 0, émission d'un bip sonore régulier si aucune action n'a été effectuée sur l'émetteur depuis le temps spécifié (en minutes). Réinitialisation en agissant sur n'importe lequel des manches / touches de navigation. @@ -1838,30 +1838,30 @@ Réinitialisation en agissant sur n'importe lequel des manches / touches de Paramètres généraux - + This is the switch selectrion for turning on the backlight (if installed). Interrupteur déclenchant le rétroéclairage' (si installé). - + Mode 2 (RUD THR ELE AIL) Mode 2 (DIR GAZ PROF AIL) - - - - - - - - - - - - + + + + + + + + + + + + Beeper volume 0 - Quiet. No beeps at all. @@ -1878,22 +1878,22 @@ Long : bips plus longs. Extra long : bips extra longs. - + Battery Warning Alerte batterie - + Contrast Contraste - + Mode 4 (AIL THR ELE RUD) Mode 4 (AIL GAZ PROF DIR) - + Mode selection: Mode 1: @@ -1934,7 +1934,7 @@ Manche Droit: Profondeur, Direction - + Mode 3 (AIL ELE THR RUD) Mode 3 (AIL PROF GAZ DIR) @@ -1946,7 +1946,7 @@ These will be relevant for all models in the same EEPROM. Communs à tous les modèles d'une même EEPROM. - + Battery warning voltage. This is the threashhold where the battery warning sounds. @@ -1957,28 +1957,28 @@ Seuil auquel se déclenche l'alarme de batterie. Plage de valeurs: 5v...10v - + Calibration Étalonnage - + Stick Mode Mode - + If this value is not 0, any keypress will turn on the backlight and turn it off after the specified number of seconds. Si cette valeur est différente de 0, l'appui sur une touche de navigation déclenche le rétroéclairage qui s'éteint après la durée spécifiée (en secondes). - + Beeper Mode Réglage des bips - - + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -2003,191 +2003,191 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Alerte mode silencieux - Avertissement si les bips sont désactivés</p></body></html> - + Mode 1 (RUD ELE THR AIL) Mode 1 (DIR PROF GAZ AIL) - + Show Splash Screen on Startup Afficher l'écran de démarrage - - + + Show splash screen on startup Affiche l'écran d'accueil au démarrage - - + + Quiet Mode silencieux - - + + No Keys Touches silencieuses - - + + Normal - - + + Long - + Rud Dir - + Ele Prf - + Thr Gaz - + Ail Ail - + PPM Multiplier Coeff. multiplicateur PPM - - - - + + + + Off Désactivé - + Trainer Ecolage - + PPM 1 - - - - + + + + chn1 Can. 1 - - - - + + + + chn2 Can. 2 - - - - + + + + chn3 Can. 3 - - - - + + + + chn4 Can. 4 - + Mode Mode - + Sound Mode Mode Son - + Beeper Bipeur - + Speaker Pitch (spkr only) Tonalité (HP uniquement) - + Only Alarms Seulement les alarmes - - + + All Tous - + Beeper Length Durée des bips - - + + X-Short X-court - - + + Short Court - - + + X-Long X-long - + Haptic Mode Mode du vibreur - + Alarms Only Seulement les Alarmes - + Haptic Length Durée vibreur - + GPS Coordinates Coordonnées GPS @@ -2202,641 +2202,646 @@ p, li { white-space: pre-wrap; } Lire étalonnage et réglages hw du profil - + Speaker Haut-parleur - + BeeperVoice Bipeur/Voix - + SpeakerVoice Haut-parleur/Voix - + hh° (N/S) mm' ss''.dd - + NMEA - + Timeshift from UTC Décalage horaire (UTC) - + LCD Display Type Type de LCD - + Standard - + Optrex - + Speaker Volume Volume haut-parleur - + Haptic Strength Puissance vibreur - + BackLight Brightness Luminosité rétroéclairage - + RotEnc Navigation Navigation avec encodeur rot. - + BackLight Auto OFF after Durée rétroéclairage - + BackLight Switch Inter rétroéclairage - + Country Code Zone géograhpique RF - + Europe - + Japan Japon - + America Amérique - + Metric Métrique - + Imperial Impérial - + Measurement Units Unités de mesure - + Voice Language Langue audio - + Beep volume Volume des bips - + Wav volume Volume des fichiers audio - + Vario volume Volume du variomètre - + Background volume Volume de la musique d'ambiance - + FAI Mode Mode FAI - + If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. Lorsque le mode FAI est activé, le variomètre ainsi que l'écran et la lecture des valeurs de télémesure sont désactivés. Ce mode ne peut pas être désactivé sur la radio. - + MAVLink Baud Rate Baudrate Mavlink - + 4800 Baud - + 9600 Baud - + 14400 Baud - + 19200 Baud - + 38400 Baud - + 57600 Baud - + 76800 Baud - + 115200 Baud - + Vario pitch at zero Tonalité du vario à 0 - + Default Channel Order Ordre des voies par défaut - + <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> <html><head/><body><p>Ordre des voies</p><p><br/></p><p>Détermine l'ordre des mixages par défaut sur un nouveau modèle.</p></body></html> - + R E T A D P G A - + R E A T D P A G - + R T E A D G P A - + R T A E D G A P - + R A E T D A P G - + R A T E D A G P - + E R T A P D G A - + E R A T P D A G - + E T R A P G D A - + E T A R P G A D - + E A R T P A D G - + E A T R P A G D - + T R E A G D P A - + T R A E G D A P - + T E R A G P D A - + T E A R G P A D - + T A R E G A D P - + T A E R G A P D - + A R E T A D P G - + A R T E A D G P - + A E R T A P D G - + A E T R A P G D - + A T R E A G D P - + A T E R A G P D - + + Stick reverse (order as above) + Inversion manche (ordre ci-dessus) + + + Pot. 4 - + Pot. 3 - + Pot. 2 - + Pot. 1 - + Stick 3 Manche 3 - + Stick 1 Manche 1 - + Stick 2 Manche 2 - + Stick 4 Manche 4 - + S3 Type Type S3 - + OFF - + S-Port Mirror Recopie S. Port - + Debug Débogage - + Serial Port Port série - + Readonly Unlock Débloquage lecture seule - + SC - + SE - + SA - + SF - + SH - + SD - + SB - + SG - - + + Hz - + "No Sound" Warning Alerte "son coupé" - + Low Memory Warning Alerte mémoire pleine - + --- --- - + 2s - + 3s - + 4s - + 6s - + 8s - + 10s - + 15s - + Vario pitch at max Tonalité du vario au max - + ms - + Vario repeat at zero Répétition du vario à 0 - + Input Entrée - + Weight Ratio - - - - + + + + += (Sum) += (Additionne) - - - - + + + + := (Replace) := (Remplace) - + PPM 2 - + PPM 3 PPM 3 - + PPM 4 PPM 4 - - + + Negative span Amplitude nég. - - + + Mid value Centre - - + + Positive span Amplitude pos. - + Current Courant - - - + + + None Aucun - - - + + + Pot (normal) Potentiomètre (normal) - - - + + + Multipos Switch Inter multipos. - + S1 Type Type S1 - + S2 Type Type S2 - + Battery Batterie - + If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. Are you sure ? Lorsque le mode FAI est activé, le variomètre ainsi que l'écran et la lecture des valeurs de télémesure sont désactivés.\nCe mode ne peut pas être désactivé sur la radio.\nEtes-vous sûr? - - + + Warning Avertissement - + Wrong data in profile, radio calibration was not retrieved Données du profil erronnées, l'étalonnage n'a pas été lu - + Wrong data in profile, hw related parameters were not retrieved Données du profil erronnées, les paramètres hw n'ont pas été lus - + Do you want to store calibration in %1 profile<br>overwriting existing calibration? Voulez-vous stocker l'étalonnage dans le profil %1<br> et écraser l'étalonnage existant? - + Calibration and HW parameters saved. Etalonnage et paramètres hw enregistrés avec succès. @@ -2844,17 +2849,17 @@ Are you sure ? GyroPage - + No Non - + Yes, controled by a switch Oui, contrôlé par un inter - + Yes, controlled by a pot Oui, contrôlé par un potentiomètre @@ -2925,22 +2930,22 @@ Are you sure ? HeliPage - + Throttle Channel: Canal des gaz: - + Yaw Channel: Canal du lacet: - + Pitch Channel: Canal du tangage: - + Roll Channel: Canal du roulis: @@ -3168,14 +3173,14 @@ Are you sure ? MainWindow - - + + Edit Edition - - + + File Fichier @@ -3195,23 +3200,23 @@ Are you sure ? - - - - - - - - + + + + + + + + Error Erreur - - - + + + Error opening file %1: %2. Erreur à l'ouverture du fichier %1: @@ -3591,37 +3596,37 @@ Are you sure ? Remerciements à tout ceux qui ont contribué à OpenTX et Companion - + Recent Files Fichiers récents - + Recent Models+Settings Fichiers de réglages et modèles récents - + Set Icon Theme Choisir le thème d'icônes - + Set Icon Size Choisir la taille des icônes - + Write Ecrire - + Unable to find file %1! Fichier %1 introuvable! - + Error reading file %1: %2. Fichier %1 corrompu: @@ -3659,12 +3664,12 @@ Are you sure ? - + Show the list of radio profiles Voir la liste des profils de radio - + Ready Prêt @@ -3677,7 +3682,7 @@ Are you sure ? - + File loaded Fichier chargé @@ -4061,8 +4066,8 @@ Voulez vous la télécharger maintenant ? Ignorer cette version (r%1)? - - + + Help Aide @@ -4132,44 +4137,49 @@ Ecrire quand même? A propos de companion - + Set Menu Language Choisir la langue des menus - + Settings Réglages - + Read/Write Transfert - - + + Radio Profile Profil de radio - + Show recent Models+Settings documents Voir les fichiers récents - + %2 - - + + New Radio + Nouvelle radio + + + + Invalid Models and Settings File %1 Fichier de réglages et modèles invalide: %1 - + Invalid binary Models and Settings File %1 Fichier binaire de réglages et modèles invalide: %1 @@ -4579,25 +4589,25 @@ p, li { white-space: pre-wrap; } MixesPanel - + Move Up Monter - + Ctrl+Up Ctrl+Haut - + Move Down Descendre - + Ctrl+Down Ctrl+Bas @@ -4607,142 +4617,142 @@ p, li { white-space: pre-wrap; } Effacer tous les mixages - + Weight(%1) Ratio(%1) - + Switch(%1) Inter(%1) - + No Trim Pas de Trim - + No DR/Expo Pas d'expo/DR - + Offset(%1) Décalage(%1) - + Delay(u%1:d%2) Délai(h%1:b%2) - + Slow(u%1:d%2) Ralenti(h%1:b%2) - + Warn(%1) Alerte(%1) - + Not enough available mixers! Plus de mixages disponibles ! - + Delete Selected Mixes? Supprimer mixages sélectionnés ? - + &Add &Ajouter - + Ctrl+A - + &Edit Éditio&n - + Enter Entrée - + Ctrl+T - + &Toggle highlight (Dé)&sélectionner - + &Delete &Supprimer - + Delete Supprimer - + &Copy &Copier - + Ctrl+C - + Ctrl+X - + C&ut Co&uper - + &Paste Co&ller - + Ctrl+V - + Du&plicate Du&pliquer - + Ctrl+U - + Clear Mixes? Effacer tous les mixages ? - + Really clear all the mixes? Êtes-vous sûr de vraiment vouloir effacer tous les mixages ? @@ -4795,12 +4805,12 @@ p, li { white-space: pre-wrap; } Dialogue - + Clear Curves? Effacer les courbes ? - + Really clear all the curves? Êtes-vous sûr de vraiment vouloir effacer toutes les courbes ? @@ -4823,27 +4833,27 @@ p, li { white-space: pre-wrap; } ModelSelectionPage - + Plane Avion - + Multirotor - + Helicopter Hélicoptère - + Model Name: Nom du modèle: - + Model Type: Type de modèle: @@ -5112,26 +5122,39 @@ p, li { white-space: pre-wrap; } MultirotorPage - + Throttle Channel: Canal des gaz: - + Yaw Channel: Canal du lacet: - + Pitch Channel: Canal du tangage: - + Roll Channel: Canal du roulis: + + OptionsPage + + + Throttle Cut + Coupure de gaz + + + + Throttle Timer + Chrono de gaz + + PrintDialog @@ -5584,12 +5607,12 @@ p, li { white-space: pre-wrap; } PV%1 - + Input%1 Entrée %1 - + Polish Polonais @@ -5601,32 +5624,32 @@ p, li { white-space: pre-wrap; } VOIE%1 - + No Non - + RotEnc A Enc Rot A - + Rot Enc B Enc Rot B - + Rot Enc C Enc Rot C - + Rot Enc D Enc Rot D - + Rot Enc E Enc Rot E @@ -5980,6 +6003,7 @@ p, li { white-space: pre-wrap; } + [I%1] [E%1] @@ -6170,78 +6194,78 @@ p, li { white-space: pre-wrap; } - - + + --- - + Rud Trim Trim Dir - + Ele Trim Trim Prf - + Thr Trim Trim Gaz - + Ail Trim Trim Ail - + Rot Enc Enc. rot. - + English Anglais - + French Français - + Italian Italien - + German Allemand - + Czech Tchèque - + Slovak Slovaque - + Spanish Espagnol - + Portuguese Portugais - + Swedish Suédois @@ -6359,44 +6383,44 @@ p, li { white-space: pre-wrap; } Incrément - + !Flight mode %1 !Phase de vol %1 - + Flight mode %1 Phase de vol %1 - + Own value Valeur indépendante - + Flight mode %1 value Flight phase %1 value Valeur de la phase de vol %1 - + Keys Touches - + Sticks Manches - + Keys + Sticks Touches + manches - + -GV%1 -VG%1 @@ -6411,135 +6435,135 @@ p, li { white-space: pre-wrap; } Encodeur rotatif - + Finnish Finlandais - + Yellow Jaune - + Orange Orange - + Red Rouge - + Winged Shadow How High Winged Shadow How High - + Winged Shadow How High (not supported) Winged Shadow How High (non supporté) - + FrSky Sensor Hub Sensor Hub FrSky - - + + None Aucun - + Imperial Impérial - + Metric Métrique - + Extra Fine Extra fin - + Fine Fin - + Medium Moyen - + Coarse Grossier - + Exponential Exponentiel - + Count Up Croissant - + Count Down Décroissant - + %1:%2, - + : %1 Channels, %2usec Delay : %1 voies, délai de %2us - + Flight modes(%1) Phases de vol(%1) - + Flight mode(%1) Phase de vol(%1) - + Rudder Direction - + Elevator Profondeur - + Throttle Gaz - + Aileron Ailerons - + GV%1 VG%1 @@ -6547,7 +6571,7 @@ p, li { white-space: pre-wrap; } - + ---- @@ -6569,21 +6593,21 @@ p, li { white-space: pre-wrap; } - + P1 - + P2 - + P3 @@ -6745,25 +6769,25 @@ p, li { white-space: pre-wrap; } - + Rud Dir - + Ele Prf - + Thr Gaz - + Ail Ail @@ -6947,279 +6971,291 @@ p, li { white-space: pre-wrap; } - + ON - + OFF - - + + Support for frsky telemetry mod Support de la télémétrie FrSky - - + + Support for jeti telemetry mod Support de la télémétrie JETI - - + + Support for receiving ardupilot data Support de la télémétrie ARDUPILOT - - + + Support for receiving NMEA data Support de la télémétrie NMEA - + Support for telemetry easy board Support de la carte TelemetrEZ - - + + Support for MAVLINK devices Support du protocole MAVLINK - + Rotary Encoder use in menus navigation Utiliser un encodeur rotatif pour la navigation - + Possibility to enable FAI MODE at field Possibilité d'activer le mode FAI sur le terrain - + FAI MODE always enabled Mode FAI toujours actif - - - - - + + + + + Enable heli menu and cyclic mix support Activer le menu hélico et les mixages CCPM - - - - - - + + + + + + Enable TEMPLATES menu Inclure les gabarits - - - - + + + + No splash screen Pas d'écran de démarrage - - - - - - + + + + + + Disable curves menus Désactiver le menu des courbes - - - - + + + + Support for radio modified with regular speaker Haut-parleur au lieu du buzzer d'origine - - - - - + + + + + Used if you have modified your radio with voice mode Support du module vocal - - - - + + + + Used if you have modified your radio with haptic mode Support du vibreur - - - - - - - - + + + + + + + + Channel values displayed in us Positions de canaux affichées en us - - - - - - + + + + + + Battery graph Graphique de batterie - - - - - - - - + + + + + + + + Use alternative SQT5 font Utiliser la police alternative SQT5 - - - - + + + + Enable the throttle trace in Statistics Activer l'historique du manche des gaz dans les statistiques - + EEprom write progress bar Barre de progression pour l'écriture de l'EEPROM - - + + No Winged Shadow How High support Supprimer le support du variomètre Winged Shadow How High - - + + No vario support Supprimer la fonction variomètre audio - - + + No GPS support Supprimer le support du GPS - - + + No gauges in the custom telemetry screen Supprimer l'affichage des valeurs de télémesure par barres - + Allow compensating for offset errors in FrSky FAS current sensors Permettre la compensation d'un décalage des capteurs de courant FASxx FrSky - + + + Add support for reversing stick inputs (e.g. needed for FrSky gimbals) + Ajoute le support de l'inversion des manches (nécessaire pour l'utilisation de manches FrSky) + + + + + Haptic module installed + Module vibreur installé + + + OpenTX for FrSky Taranis Rev4a OpenTX pour FrSky Taranis Rev4a - + Support of FrSky PXX protocol Support du protocole PXX FrSky - + Use FrSky Taranis sticks in a 9X/9XR Use FrSky's taranis like sticks Manches de FrSky Taranis installés dans une 9X/9XR - + OpenTX for FrSky Taranis OpenTX pour FrSky Taranis - - + + Disable HELI menu and cyclic mix support Supprimer le menu HELICO et les mixages cycliques - - + + Disable TEMPLATES menu Supprimer le menu des gabarits - - + + Disable Global variables Supprimer le support des variables globales - - - - - + + + + + Support for DSM2 modules Support du protocole DSM2 - - - - - - + + + + + + PPM center adjustment in limits Neutres PPM ajustables - - - - - - + + + + + + Symetrical Limits Limites symétriques - - - - - + + + + + Pots use in menus navigation Support de la navigation dans les menus avec les POTS @@ -7230,143 +7266,143 @@ p, li { white-space: pre-wrap; } Il semblerait que votre radio utilise le mauvais firmware. La taille de l'EEPROM est de 4096, mais seulement les 2048 premiers sont utilisés. Pensez à charger la version pour m128. - + OpenTX for 9X board OpenTX pour 9X - - - - - - + + + + + + No flight modes Pas de phases de vol - - + + SmartieParts 2.2 Backlight support Support du rétroéclairage pour la carte SmartieParts 2.2 - - - - + + + + Enable resetting values by pressing up and down at the same time Permet la remise à zéro des valeurs en pressant haut-bas en même temps, valeur min avec gauche/bas, valeur max avec haut/droite, inversion avec gauche/droite - - - - - - + + + + + + No graphical check boxes and sliders Pas de cases à cocher et de curseurs graphiques - - - - - - + + + + + + Don't use bold font for highlighting active items Ne pas mettre les lignes actives en gras - + OpenTX for M128 / 9X board OpenTX pour 9X avec m128 - - - - + + + + EEprom write Progress bar Barre de progression affichée lors des écritures EEPROM - - - - - + + + + + Imperial units Unités Impériales - + Bluetooth interface Interface Bluetooth - - - - - - + + + + + + Global variables Variables globales - - - - - - + + + + + + In model setup menus automatically set source by moving the control Sélectionner les sources des mixeurs en bougeant le contrôle désiré - - - - - - + + + + + + In model setup menus automatically set switch by moving the control Sélectionner les interrupteurs en bougeant le contrôle désiré - + OpenTX for 9XR OpenTX pour 9XR - + OpenTX for 9XR with M128 chip OpenTX pour 9XR avec m128 - + OpenTX for Gruvin9x board / 9X OpenTX pour carte Gruvin9x - + Support for SD memory card Support de la carte SD - + Support for DSM2 modules using ppm instead of true serial Support pour les modules DSM2 par le signal PPM - + OpenTX for Sky9x board / 9X OpenTX pour carte Sky9x - + Enable HELI menu and cyclic mix support Activer le menu hélico et les mixages CCPM @@ -7414,7 +7450,7 @@ p, li { white-space: pre-wrap; } - + Warning Avertissement @@ -7424,7 +7460,7 @@ p, li { white-space: pre-wrap; } EEPROM enregistrée avec les avertissements suivants: - + Simulator for this firmware is not yet available Le simulateur n'est pas encore disponible pour ce firmware @@ -7510,17 +7546,17 @@ L'équipe OpenTX. RudderPage - + No Non - + Yes Oui - + <br>Rudder Channel: <br>Canal de dérive: @@ -7662,7 +7698,7 @@ Si cette option est cochée, la voie des gaz est inversée: le ralenti est &apo SimpleTailPage - + Elevator Channel: Canal de profondeur: @@ -7670,28 +7706,28 @@ Si cette option est cochée, la voie des gaz est inversée: le ralenti est &apo SimulatorDialog - - + + Warning Avertissement - + Joystick enabled but not configured correctly Joystick activé, mais non configuré - + Cannot open joystick, joystick disabled Impossible d'accéder au joystick. Joystick désactivé - + Simulating Radio (%1) Simulation de la radio (%1) - + Firmware %1 error: %2 Firmware %1 erreur : %2 @@ -7804,7 +7840,7 @@ Si cette option est cochée, la voie des gaz est inversée: le ralenti est &apo StandardPage - + Channel %1 Canal %1 @@ -7812,12 +7848,12 @@ Si cette option est cochée, la voie des gaz est inversée: le ralenti est &apo TailPage - + Rudder Channel: Canal de dérive: - + Elevator Channel: Canal de profondeur: @@ -7825,22 +7861,22 @@ Si cette option est cochée, la voie des gaz est inversée: le ralenti est &apo TailSelectionPage - + Elevator and Rudder Profondeur et dérive - + Only Elevator Profondeur uniquement - + V-tail Empennage en V - + Tail Type: Type d'empennage: @@ -8257,17 +8293,17 @@ Si cette option est cochée, la voie des gaz est inversée: le ralenti est &apo ThrottlePage - + Yes Oui - + No Non - + <br>Throttle Channel: <br>Canal des gaz: @@ -8311,12 +8347,12 @@ Si cette option est cochée, la voie des gaz est inversée: le ralenti est &apo VTailPage - + First Tail Channel: Premier canal d'empennage: - + Second Tail Channel: Deuxième canal d'empennage: @@ -8324,12 +8360,12 @@ Si cette option est cochée, la voie des gaz est inversée: le ralenti est &apo WingtypeSelectionPage - + Standard Wing Aile standard - + Flying Wing / Deltawing Aile delta @@ -8507,92 +8543,103 @@ Si cette option est cochée, la voie des gaz est inversée: le ralenti est &apo + Model Options + Options de modèle + + + + Select additional options + Sélectionner les options additionnelles + + + Save Changes Sauvegarder les changements - + Manually check the direction of each control surface and reverse any channels that make controls move in the wrong direction. Remove the propeller/propellers before you try to control your model for the first time.<br>Please note that continuing removes all old model settings! Vérifiez manuellement la direction de mouvement de chaque surface de commande, et inversez les canaux de celles qui répondent dans le faux sens.Attention à bien enlever les hélices du modèle avant de l'alimenter la première fois!<br>Veuillez noter que continuer effacera tous les réglages existants du modèle actuel. - + Enter a name for your model and select model type. Entrer un nom pour le modèle et sélectionnez son type. - + Select the receiver channel that is connected to your ESC or throttle servo.<br><br>Throttle - Spektrum: CH1, Futaba: CH3 Sélectionnez le canal du récepteur auquel le contrôleur/servo de gaz est connecté.<br><br>Gaz - Spektrum: CH1, Futaba: CH3 - + Most aircraft have a main wing and a tail with control surfaces. Flying wings and delta winged aircraft only have a single wing. The main control surface on a standard wing controls the roll of the aircraft. This surface is called an aileron.<br>The control surface of a delta wing controls both roll and pitch. This surface is called an elevon. La plupart des aéronefs possèdent une aile principale et un empennage avec des surfaces de contrôle. Les ailes volantes et delat ne possèdent qu'une aile. Les surfaces de contrôle sur une aile standard qui contrôlent le roulis de l'aéronef sont appelées ailerons.<br>Les surfaces de contrôle d'une aile delta contrôlent le roulis ET le tangage, et sont appelées élevons. - + Models use one or two channels to control the ailerons.<br>A so called Y-cable can be used to connect a single receiver channel to two separate aileron servos. If your servos are connected by a Y-cable you should select the single-servo option.<br><br>Aileron - Spektrum: CH2, Futaba: CH1 On utilise en général soit un, soit 2 canaux pour contrôler les ailerons. Un câble en Y peut être utilisé pour connecter 2 servos à un seul canal, auquel cas il convient de choisir l'option "un seul canal".<br><br>Ailerons - Spektrum: CH2, Futaba: CH1 - + Models use one or two channels to control the elevons.<br>A so called Y-cable can be used to connect single a receiver channel to two separate elevon servos. If your servos are connected by a Y-cable you should select the single-servo option. On utilise en général soit un, soit 2 canaux pour contrôler les élevons. Un câble en Y peut être utilisé pour connecter 2 servos à un seul canal, auquel cas il convient de choisir l'option "un seul canal". - + This wizard assumes that your flaps are controlled by a switch. If your flaps are controlled by a potentiometer you can change that manually later. Cet assistant suppose que les volets sont commandés par un interrupteur. Si vous souhaitez les commander par un potentiomètre il est possible de le changer manuellement plus tard. - + Air brakes are used to reduce the speed of advanced sail planes.<br>They are very uncommon on other types of planes. Les aérofreins sont utilisés pour augmenter le taux de descente des planeurs performants.<br>Ils ne sont pas courants sur les autres types d'aéronefs. - + Select the receiver channel that is connected to your rudder.<br><br>Rudder - Spektrum: CH4, Futaba: CH4 Sélectionnez le canal du récepteur auquel le servo de dérive est connecté.<br><br>Dérive - Spektrum: CH4, Futaba: CH4 - + Select the tail type of your plane. Sélectionnez le type d'empennage de votre avion. - - + + Select the Rudder and Elevator channels.<br><br>Rudder - Spektrum: CH4, Futaba: CH4<br>Elevator - Spektrum: CH3, Futaba: CH2 Sélectionnez les canaux du récepteur auquel les servos de profondeur et dérive sont connectés.<br><br>Dérive - Spektrum: CH4, Futaba: CH4<br>Profondeur - Spektrum: CH3, Futaba: CH2 - + Select the Elevator channel.<br><br>Elevator - Spektrum: CH3, Futaba: CH2 Sélectionnez le canal du récepteur auquel le servo de profondeur est connecté.<br><br>Profondeur - Spektrum: CH3, Futaba: CH2 - - - - - - + + + + + + + TBD. - + Select the control channels for your multirotor.<br><br>Throttle - Spektrum: CH1, Futaba: CH3<br>Yaw - Spektrum: CH4, Futaba: CH4<br>Pitch - Spektrum: CH3, Futaba: CH2<br>Roll - Spektrum: CH2, Futaba: CH1 Sélectionnez les canaux de votre multirotor.<br><br>Gaz - Spektrum: CH1, Futaba: CH3<br>Lacet - Spektrum: CH4, Futaba: CH4<br>Tangage - Spektrum: CH3, Futaba: CH2<br>Roulis - Spektrum: CH2, Futaba: CH1 - + There is no help available for the current page. Aucune aide disponible pour cette page. - + Model Wizard Help Aide de l'assistant de configuration @@ -8600,17 +8647,22 @@ Si cette option est cochée, la voie des gaz est inversée: le ralenti est &apo WizardPrinter - + Model Name: Nom du modèle: - + Model Type: Type de modèle: - + + Options: + + + + Channel %1: Canal %1: From bee347b291b4a398b765c014e24252c15d0d1390 Mon Sep 17 00:00:00 2001 From: mhotar Date: Fri, 2 May 2014 21:32:35 +0200 Subject: [PATCH 28/79] Tab in notes file --- radio/src/gui/view_text.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/radio/src/gui/view_text.cpp b/radio/src/gui/view_text.cpp index 8d86623cf..cce537045 100644 --- a/radio/src/gui/view_text.cpp +++ b/radio/src/gui/view_text.cpp @@ -78,10 +78,6 @@ void readTextFile(int & lines_count) c = '\301'; escape = 0; } - else if (escape == 1 && escape_chars[0] == 't') { - c = 0x09; // tab - escape = 0; - } else { escape++; continue; @@ -90,6 +86,9 @@ void readTextFile(int & lines_count) else if (c=='~') { c = 'z'+1; } + else if (c=='\t') { + c = 0x1D; //tab + } escape = 0; s_text_screen[current_line-s_pgOfs][line_length++] = c; } From 9f487a86dab00d92e942c8560d96966efb259143 Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 2 May 2014 22:06:15 +0200 Subject: [PATCH 29/79] Issue #1048 - First in Inputs menu, it was impossible to copy a line from Input4 to Input5 --- radio/src/gui/menu_model.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index 92f8f8678..e28373975 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -2808,7 +2808,7 @@ bool swapExpoMix(uint8_t expo, uint8_t &idx, uint8_t up) } if (tgt_idx == MAX_EXPOS) { - if (((ExpoData *)x)->chn == NUM_STICKS-1) + if (((ExpoData *)x)->chn == NUM_INPUTS-1) return false; ((ExpoData *)x)->chn++; return true; @@ -2821,7 +2821,7 @@ bool swapExpoMix(uint8_t expo, uint8_t &idx, uint8_t up) else return false; } else { - if (((ExpoData *)x)->chnchn++; + if (((ExpoData *)x)->chnchn++; else return false; } return true; From 1fb115d3b1e610e6eebda219e87fa6c5b1bda85b Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 2 May 2014 22:43:29 +0200 Subject: [PATCH 30/79] Fixes #1048 --- radio/src/opentx.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index e4423efe4..7f49ba785 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -960,7 +960,10 @@ int expo(int x, int k) void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) { -#if !defined(PCBTARANIS) +#if defined(PCBTARANIS) + int16_t heliAnasCopy[4]; + memcpy(heliAnasCopy, heliAnas, sizeof(heliAnasCopy)); +#else int16_t anas2[NUM_INPUTS]; // values before expo, to ensure same expo base when multiple expo lines are used memcpy(anas2, anas, sizeof(anas2)); #endif @@ -984,9 +987,9 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) v = ovwrValue; #if defined(HELI) else if (ed->srcRaw == MIXSRC_Ele) - v = heliAnas[ELE_STICK]; + v = heliAnasCopy[ELE_STICK]; else if (ed->srcRaw == MIXSRC_Ail) - v = heliAnas[AIL_STICK]; + v = heliAnasCopy[AIL_STICK]; #endif else { v = getValue(ed->srcRaw); From 8799e370f2b29f77df14ab57d7665e6954e1559e Mon Sep 17 00:00:00 2001 From: mhotar Date: Fri, 2 May 2014 23:00:54 +0200 Subject: [PATCH 31/79] cz translations --- companion/src/translations/companion_cs.ts | 2262 ++++++++++---------- radio/src/translations/cz.h.txt | 4 +- 2 files changed, 1167 insertions(+), 1099 deletions(-) diff --git a/companion/src/translations/companion_cs.ts b/companion/src/translations/companion_cs.ts index 39b443c27..2b6c00acd 100644 --- a/companion/src/translations/companion_cs.ts +++ b/companion/src/translations/companion_cs.ts @@ -4,27 +4,27 @@ AileronsPage - + No Ne - + Yes, controlled by a single channel Ano, ovládané jedním kanálem - + Yes, controlled by two channels Ano, ovládané dvěma kanály - + <br>First Aileron Channel: <br>První kanál křidélek: - + Second Aileron Channel: <br>Druhý kanál křidélek: @@ -32,27 +32,27 @@ AirbrakesPage - + No Ne - + Yes, controlled by a single channel Ano, ovládané jedním kanálem - + Yes, controlled by two channels Ano, ovládané dvěma kanály - + <br>First Airbrake Channel: <br>První kanál brzdících klapek: - + Second Airbrake Channel: <br>Druhý kanál brzdících klapek: @@ -325,8 +325,19 @@ Mode 4: + Radio Type + Typ rádia + + + + Set voice language. +May be different from firmware language + Vyberte jazykovou verzi hlasu tts(voice). +Může být jiná než verze firmwaru + + Radio Firmware - Firmware rádia + Firmware rádia @@ -344,10 +355,9 @@ Mode 4: Cesta k obsahu SD karty - Set language of voice. May be different from firmware language - Vyberte jazykovou verzi hlasu tts(voice). + Vyberte jazykovou verzi hlasu tts(voice). Může být jiná než verze firmwaru @@ -565,22 +575,22 @@ Může být jiná než verze firmwaru BankPage - + One Jedním - + Two Dvěma - + <br>First Elevon Channel: <br>První kanál elevonů: - + Second Elevon Channel: <br>Druhý kanál elevonů: @@ -676,483 +686,483 @@ Může být jiná než verze firmwaru Tisk do souboru - - + + No name Model nepojmenován - + General Model Settings Obecná nastavení modelu - - - + + + Name Název - - + + EEprom Size Velikost EEPROM - - + + Timer1 Stopky1 - - + + Timer2 Stopky2 - - + + Protocol Protokol - - + + Pulse Polarity Polarita pulzů - - + + Throttle Trim Trim volnoběhu plynu - - + + Enabled Povoleno - - + + Disabled Zakázáno - - + + Throttle Expo Expo plynu - - + + Trim Increment Krok trimu - - + + Center Beep Zvuk ve středové poloze - + Flight modes Settings Nastavení letových fází - - + + Fades Přechody - - + + Trims Trimy - - - - - - - - + + + + + + + + Switch Spínač - - - - + + + + Flight mode name Název režimu - - + + IN (+) - - + + OUT (-) - - - - - - - - - - + + + + + + + + + + FM LR - - + + Gvars GP - - + + Rot. Enc. Rot.Enkoder - + Limits Limity - - - - - - - + + + + + + + Offset Subtrim - - - - - + + + + + Min - - - - - + + + + + Max - - - + + + Invert Invertovat - - - - - + + + + + CH - - + + INV - - + + NOR --- - + Global Variables Globální proměnné - - + + GV GP - + Expo/Dr Settings DR/Expo - - + + Weight Váha - - - - + + + + Flight modes Letové režimy - - - - + + + + Flight mode Letový režim - - - - + + + + DISABLED ZAKÁZÁN - + Mixers Mixy - - + + noTrim Žádný trim - - + + Delay(u%1:d%2) Zpoždění(u%1:d%2) - - + + Slow(u%1:d%2) Zpomalení(u%1:d%2) - - + + Warn Varování - + Curves Křivky - + 5 Point Curves 5ti bodové křivky - - + + pt %1 bod %1 - - + + Curve Křivka - + 9 Point Curves 9ti bodové křivky - + Logical Switches Logické spínače - - + + LS - + Special Functions Speciální funkce - - + + Function Funkce - - + + Param Parametr - - + + Repeat Opakování - - + + Enable Povolit - + SF - + Telemetry Settings Nastavení telemetrie - - + + Analog - - + + Unit Jednotky - - + + Scale Měřítko - - - - + + + + A%1 - - + + Alarm 1 - - + + Alarm 2 - - + + Type Typ - - + + Condition Podmínka - - + + Value Hodnota - - + + RSSI Alarm - - + + Custom Telemetry View Vlastní zobrazení telemetrie - - + + Telemetry Bars Telemetrické ukazatele - - + + Bar Number Číslo ukazatele - - + + Source Zdroj - + Print Document Vytisknout dokument - + Select PDF output file Vyberte cílový PDF soubor @@ -1160,7 +1170,7 @@ Může být jiná než verze firmwaru ConclusionPage - + OK, I understand. OK, rozuměl jsem. @@ -1168,22 +1178,22 @@ Může být jiná než verze firmwaru CurveGroup - + Diff Diferenciace - + Expo Exponenciála - + Func Funkce - + Curve Křivka @@ -1320,7 +1330,7 @@ Může být jiná než verze firmwaru Upravit křivku k%1 - + Not enough free points in EEPROM to store the curve. V nastavení modelu již nejsou volné body k uložení této křivky. @@ -1412,22 +1422,22 @@ Může být jiná než verze firmwaru CyclicPage - + 90 - + 120 - + 120x - + 140 @@ -1599,22 +1609,22 @@ Pokud není použito, vstup je AKTIVNÍ stále. FblPage - + Throttle Channel: Kanál plynu: - + Yaw Channel: Kanál bočení: - + Pitch Channel: Kanál klopení: - + Roll Channel: Kanál klonění: @@ -1637,8 +1647,14 @@ Pokud není použito, vstup je AKTIVNÍ stále. Hlas tts - Set language of voice. +May be different from firmware language + Vyberte jazykovou verzi hlasu tts(voice). +Může být jiná než verze firmwaru + + + + Set voice language. May be different from firmware language Vyberte jazykovou verzi hlasu tts(voice). Může být jiná než verze firmwaru @@ -1703,11 +1719,6 @@ Může být jiná než verze firmwaru Firmware - - - - - - Latest Download @@ -1717,27 +1728,27 @@ Může být jiná než verze firmwaru FlapsPage - + No Ne - + Yes, controlled by a single channel Ano, ovládané jedním kanálem - + Yes, controlled by two channels Ano, ovládané dvěma kanály - + <br>First Flap Channel: <br>První kanál klapek: - + Second Flap Channel: <br>Druhý kanál klapek: @@ -1803,17 +1814,17 @@ Může být jiná než verze firmwaru FlightModes - + Flight Mode %1 Letový režim %1 - + (%1) - + (default) (výchozí) @@ -1821,19 +1832,19 @@ Může být jiná než verze firmwaru FlybarSelectionPage - + Has Flybar - - - - - Flybarless - + Má stabilizátor(Flybar) + Flybarless + Bez stabilizátoru (Flybarless) + + + Flybar: - + Stabilizátor: @@ -1866,7 +1877,7 @@ Tyto volby jsou platné pro všechny modely v jedné EEPROM. Nastevní - + Contrast Kontrast @@ -1875,7 +1886,7 @@ Tyto volby jsou platné pro všechny modely v jedné EEPROM. Pořadí kanálů (pro šablony) - + Mode selection: Mode 1: @@ -1916,116 +1927,116 @@ Mode 4: - + Mode 1 (RUD ELE THR AIL) Mód1 (Směr.Výšk.Plyn.Křid) - + Mode 2 (RUD THR ELE AIL) Mód2 (Směr.Plyn.Výšk.Křid) - + Mode 3 (AIL ELE THR RUD) Mód3 (Křid.Výšk.Plyn.Směr) - + Mode 4 (AIL THR ELE RUD) Mód4 (Křid.Plyn.Výšk.Směr) - - + + Quiet Tichý - + Only Alarms Jen alarm - - + + No Keys Bez kláves - - + + All Vše - + MAVLink Baud Rate - + 4800 Baud - + 9600 Baud - + 14400 Baud - + 19200 Baud - + 38400 Baud - + 57600 Baud - + 76800 Baud - + 115200 Baud - + If this value is not 0, any keypress will turn on the backlight and turn it off after the specified number of seconds. Pokud tato hodnota není nula, každé stisknutí klávesy zapne podsvétlení a vypne ho až po uplynutí nastaveného počtu sekund. - + sec s - - - - - - - - - - - - + + + + + + + + + + + + Beeper volume 0 - Quiet. No beeps at all. @@ -2042,13 +2053,13 @@ Mode 4: 4 - Extra Hlasitý. - + Alarms Only Jen alarmy - - + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -2063,20 +2074,20 @@ p, li { white-space: pre-wrap; } - + Beeper Mode Mód zvuku - - - - + + + + Off Vypnuto - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -2086,37 +2097,37 @@ p, li { white-space: pre-wrap; } - - + + X-Short Extra krátký - - + + Short Krátký - - + + Normal Normální - - + + Long Dlouhý - - + + X-Long Extra dlouhý - + Battery warning voltage. This is the threashhold where the battery warning sounds. @@ -2125,83 +2136,83 @@ Acceptable values are 5v..10v Použitelné hodnoty jsou 5v..10v - + Battery Warning Alarm baterie - + Sound Mode Mód zvuku - + If not zero will sound beeps if the transmitter has been left without inputs for the specified number of minutes. Pokud není nastaveno na nulu, bude zapnuto zvukové upozornění, že jste rádio nechali bez povšimnutí nastavený počet minut. - + min - - + + Show splash screen on startup Zobrazit úvodní logo při zapnutí vysílčky - + Show Splash Screen on Startup Zobrazit úvodní logo - + Inactivity Timer Časovač nečinnosti - + Beeper Bzučák - + Speaker Reproduktor - + BeeperVoice Bzučák+Hlas - + SpeakerVoice Repro+Hlas - + Beeper Length Délka zvuku - + GPS Coordinates Souřadnice GPS - + hh° (N/S) mm' ss''.dd - + NMEA - + Timeshift from UTC Časový posun od UTC @@ -2215,557 +2226,562 @@ Toto je použito šablonami k určení který kanál patří ke kterému výstupu. - + Speaker Pitch (spkr only) Tón zvuku (pouze spkr) - + Haptic Mode Mód vibrací - + Stick Mode Výchozí mód vysílačky - + LCD Display Type Typ LCD zobrazovače - + Standard Běžný - + Optrex - + This is the switch selectrion for turning on the backlight (if installed). Toto je volba spínače který zapne podsvětlení (pokud je nainstalováno). - + Speaker Volume Hlasitost reproduktoru - + Haptic Length Délka vibrací - + Haptic Strength Síla vibrací - + BackLight Brightness Jas podsvětlení - + BackLight Auto OFF after Auto. vypnutí podsvětlení po - + RotEnc Navigation Navigace otočným enkodérem - + BackLight Switch Spínač podsvětlení - + Country Code Kód země - + Europe Evropa - + Japan Japonsko - + America Amerika - + Metric Metrické - + Imperial Imperiální - + Measurement Units Měrné jednotky - + Voice Language Jazyk hlasových zpráv - + Beep volume Upozornění - + Wav volume Wav soubor - + Vario volume Vario - + Background volume Zvuk v pozadí - + FAI Mode FAI mód - + If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. FAI je soutéžní mód (www.fai.org), zablokuje vario, zobrazení telemetrie a funkce hlasového hlášení. Tuto funkci nelze vypnout v menu rádia. - + R E T A S V P K - + Vario pitch at zero Tón varia na nule - + R E A T S V K P - + R T E A S P V K - + R T A E S P K V - + R A E T S K V P - + R A T E S K P V - + E R T A V S P K - + E R A T V S K P - + E T R A V P S K - + E T A R V P K S - + E A R T V K S P - + E A T R V K P S - + T R E A P S V K - + T R A E P S K V - + T E R A P V S K - + T E A R P V K S - + T A R E P K S V - + T A E R P K V S - + A R E T K S V P - + A R T E K S P V - + A E R T K V S P - + A E T R K V P S - + A T R E K P S V - + A T E R K P V S - + Readonly Unlock - + Default Channel Order Výchozí pořadí kanálů - + <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> <html><head/><body><p>Pořadí kanálů</p><p><br/></p><p>Definuje výchozí pořadí kanálů použité při vytvoření nového modelu.</p></body></html> - + SC - + + Stick reverse + Revers os kniplů + + + SE - + SA - + SF - + SH - + SD - + SB - + SG - - + + Hz - + "No Sound" Warning Upozornění na vypnutý zvuk - + Low Memory Warning Upozornit na nedostatek paměti - + --- - + 2s - + 3s - + 4s - + 6s - + 8s - + 10s - + 15s - + Vario pitch at max Tón varia na maximu - + ms - + Vario repeat at zero Opakování varia na nule - + Trainer Trenér - + Mode Mód - + Input Vstup - + Weight Váha - + Pot. 4 - + Pot. 3 - + Pot. 2 - + Pot. 1 - + Stick 3 Páka 3 - + Stick 1 Páka 1 - + Stick 2 Páka 2 - + Stick 4 Páka 4 - + S3 Type Typ S3 - + OFF VYP - + S-Port Mirror - + Debug - + Serial Port Seriový port - + PPM 1 - - - - + + + + chn1 Kanál 1 - + Rud Směrovka - - - - + + + + chn2 Kanál 2 - - - - + + + + chn3 Kanál 3 - - - - + + + + chn4 Kanál 4 - + Ele Výškovka - + Thr Plyn - + Ail Křidélka - + PPM 2 - + PPM 3 - + PPM 4 - + Calibration Kalibrace @@ -2774,20 +2790,20 @@ který kanál patří ke kterému výstupu. PÁKA 3 - - + + Negative span Negativní - - + + Mid value Střed - - + + Positive span Pozitivní @@ -2804,74 +2820,74 @@ který kanál patří ke kterému výstupu. PÁKA 4 - - - + + + None Žádný - - - + + + Pot (normal) Potenciometr (klasický) - - - + + + Multipos Switch Vícepolohový přepínač - + S1 Type Typ S1 - + S2 Type Typ S2 - - - - + + + + += (Sum) += (Sečíst) - - - - + + + + := (Replace) := (Nahradit) - + Battery Baterie - + v V - + PPM Multiplier PPM Násobič - + Current Proud - + If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. Are you sure ? @@ -2881,28 +2897,28 @@ Tuto funkci nelze vypnout v menu rádia. Opravdu to takto chcete ? - - + + Warning Pozor - + Wrong data in profile, radio calibration was not retrieved Špatná data v profilu, není možné získat parametry kalibrace - + Wrong data in profile, hw related parameters were not retrieved Špatná data v profilu, není možné získat HW parametry - + Do you want to store calibration in %1 profile<br>overwriting existing calibration? Chcete uložit kalibraci do profilu %1<br>Přepsat existující kalibraci? - + Calibration and HW parameters saved. Kalibrace a HW parametry byly uloženy. @@ -2910,17 +2926,17 @@ Opravdu to takto chcete ? GyroPage - + No Ne - + Yes, controled by a switch Ano, ovládané spínačem - + Yes, controlled by a pot Ano, ovládané potenciomerem @@ -2991,22 +3007,22 @@ Opravdu to takto chcete ? HeliPage - + Throttle Channel: Kanál plynu: - + Yaw Channel: Kanál bočení: - + Pitch Channel: Kanál klopení: - + Roll Channel: Kanál klonění: @@ -3015,26 +3031,26 @@ Opravdu to takto chcete ? InputsPanel - + Move Up Posunout nahoru - + Ctrl+Up Ctrl+Nahoru Ctrl+Up - + Move Down Posunout dolů - + Ctrl+Down Ctrl+Dolů @@ -3048,112 +3064,112 @@ Opravdu to takto chcete ? Vymazat všechny vstupy - + Source(%1) Zdroj(%1) - + No Trim Žádný trim - + Weight(%1) Váha(%1) - + Switch(%1) Spínač(%1) - + Not enough available inputs! Již nejsou další volné vstupy! - + Delete Selected Inputs? Vymazat vybrané vstupy? - + &Add &Přidat - + Ctrl+A - + &Edit &Upravit - + Enter - + &Delete V&ymazat - + Delete - + &Copy &Kopírovat - + Ctrl+C - + &Cut Vyj&mout - + Ctrl+X - + &Paste &Vložit - + Ctrl+V - + Du&plicate &Duplikovat - + Ctrl+U - + Clear Inputs? Vymazat vstupy? - + Really clear all the inputs? Opravdu chcete vymazat všechny vstupy? @@ -3239,85 +3255,85 @@ Opravdu to takto chcete ? MainWindow - - - - + + + + File loaded Soubor byl načten - + Display previous warning again at startup ? Chcete zobrazit předchozí upozornění i příště ? - + Checking for updates Kontroluji aktualizace - - - - - + + + + + Unable to check for updates. Nelze ověřit aktualizace. - - - - - + + + + + Save As Uložit jako - + Executable (*.exe) Spustitelný (*.exe) - + New release available Je dostupné nové vydání - - + + No updates available at this time. Žádné aktualizace nejsou nyní dostupné. - + Would you like to launch the installer? Chcete spustit instalátor? - - - - - - - - - - - - - + + + + + + + + + + + + + Error Chyba - - - - - + + + + + Error opening file %1: %2. Chyba při otevírání souboru %1: @@ -3332,50 +3348,50 @@ Opravdu to takto chcete ? Firmware se zvolenými vlastnostmi nevejde do rádia - + Compilation server termporary failure, try later Server companion je dočasně nedostupný, zkuste to později - + Display previous message again at startup ? Chcete zobrazit předchozí zprávu i příště ? - + A new release of Companion is available, please check the OpenTX website! Je dostupná nová verze Companion, prosím navštivte internetové stránky OpenTX! - - + + Not enough memory for all the selected firmware options Není dostatek paměti pro všechny zvolené vlastnosti firmwaru - + Compilation server temporary failure, try later Dočasná chyba kompilačního serveru, zkuste to prosím později znovu - - + + Compilation server too busy, try later Server companion je zaneprázdněn, zkuste to později - - + + Unknown server failure, try later Neznámá chyba serveru, zkuste to později - + Do you want to write the firmware to the radio now ? Chcete zapsat firmware do rádia nyní? - + Firmware %1 does not seem to have ever been downloaded. Version %2 is available. Do you want to download it now ? @@ -3384,31 +3400,31 @@ Verze %2 je dostupná. Chcete ho nyní stáhnout ? - - + + Yes Ano - - + + No Ne - - + + Release Notes Poznámky k vydání - - + + Do you want to download release %1 now ? Chcete nyní stáhnout vydání %1 ? - + A new version of %1 firmware is available (current %2 - newer %3). Do you want to download it now ? Nová verze firmware %1 je dostupná. @@ -3416,108 +3432,108 @@ Do you want to download it now ? Chcete ji stáhnout nyní ? - + Ignore this version (r%1)? Ignorovat tuto verzi (r%1)? - + Release notes contain very important informations. Do you want to see them now ? Poznámky k vydání mohou obsahovat důležité informace. Chcete si je přečíst nyní ? - - + + File saved Soubor byl uložen - + Firmware updates Aktualizace firmwaru - + Current firmware does not provide release notes informations. K tomuto firmwaru nejsou poznámky k vydání. - + Cannot write file %1: %2. Nelze zapsat soubor %1: %2. - - - + + + Backup is impossible Není možné zálohovat - - - + + + The backup dir set in preferences does not exist Složka pro zálohování zvolená v předvolbách neexistuje - - + + Warning Varování - + Conversion failed Porovnání selhalo - + Restore failed Zápis selhal - + Backup failed Zálohování selhalo - + A new version of Companion is available (version %1)<br>Would you like to download it? Je dostupná nová verze Companion (verze %1)<br>Chcete ji nyní stáhnout? - - + + Compilation server requires registration, please check OpenTX web site Kompilační server vyžaduje registraci, prosím navštivte internetové stránky OpenTX - + The selected language will be used the next time you start Companion. Zvolený jazyk bude použit při příštím spuštění Companion. - - - + + + OK - + The new theme will be loaded the next time you start Companion. Nové téma bude použito při příštím spuštění Companion. - + The icon size will be used the next time you start Companion. Zvolená velikost ikon bude použita při příštím spuštění Companion. - + The file %1 has not been recognized as a valid Models and Settings file Write anyway ? @@ -3526,27 +3542,27 @@ neobsahuje platná data modelů a nastavení Chcete ho přesto zapsat ? - + Cannot check Models and Settings compatibility! Continue anyway? Nelze ověřit kompatibilitu dat modelů a nastavení! Chcete přesto pokračovat? - + Cannot convert Models and Settings for use with this firmware, original data will be used Nemohu konvertovat modely a nastavení pro použití s tímto firmwarem, budou použita původní data - + Firmware write failed Zápis firmware selhal - + Copyright - + Load backup from file Načíst zálohu ze souboru @@ -3555,212 +3571,212 @@ Chcete ho přesto zapsat ? Je dostupná nová verze Companion, prosím navštivte internetové stránky OpenTX! - - + + Open Models and Settings file Otevřít soubor modelů a nastavení - - - - + + + + Read Models and Settings From Radio Načíst modely a nastavení z rádia - + Write Radio Backup from %1 to the radio? Zapsat zálohu z %1 do rádia? - - - - - - + + + + + + Backup Models and Settings From Radio Zálohovat modely a nastavení z rádia - + The radio firmware belongs to another product family, check file and preferences! Firmware rádia je z jiné rodiny produktů , zkontrolujte nastavení předvoleb! - + The radio firmware is outdated, please upgrade! Firmware rádia je zastaralý, aktualizujte ho prosím! - + Write Backup To Radio Zapsat zálohu do rádia - - + + Write Firmware To Radio Zapsat firmware do rádia - + Restore Models and Settings To Radio Obnovit modely a nastavení rádia - + Could not restore Models and Settings to Radio. The models and settings data file can be found at: %1 Nelze obnovit modely a nastavení rádia. Data modelů a nastavení naleznete v %1 - + Could not write firmware to radio. The models and settings data file can be found at: %1 Nelze zapsat firmware do rádia. Data modelů a nastavení naleznete v %1 - + Cannot backup existing Models and Settings from Radio. Firmware write process aborted Nelze zálohovat stávající modely a nastavení z rádia. Zápis firmware byl přerušen - + Save Radio Backup to File Uložit zálohu rádia do souboru - + Read Radio Backup Načíst zálohu rádia - + Read Radio Firmware to File Načíst firmware rádia do souboru - + OpenTX Home Page: <a href='%1'>%1</a> Internetová stránka OpenTX : <a href='%1'>%1</a> - + The OpenTX Companion project was originally forked from <a href='%2'>eePe</a> Projekt OpenTX Companion vznikl oddělením z <a href='%2'>eePe</a> - + If you've found this program useful, please support by <a href='%1'>donating</a> Pokud vám byl tento program užitečný, podpořte jej <a href='%1'>darem</a> - + Version %1, %3 Verze %1, %3 - + About Companion O aplikaci Companion - + New Nový - + Open... Otevřít - + Save Uložit - + Save As... Uložit jako... - + Copy Model Kopírovat model - + Paste Model Vložit model - + Compare models Porovnat modely - + Exit the application Ukončit aplikaci - + A monochrome black icon theme Černé mono téma - + A monochrome white icon theme Bílé mono téma - + A monochrome blue icon theme Modré mono téma - + Small Malá - + Use small toolbar icons Použít malé ikony nástrojové lišty - + Use normal size toolbar icons Použít normální velikost ikon nástrojové lišty - + Normal Normální - + Use big toolbar icons Použít velké ikony nástrojové lišty - + Big Velká - + Use huge toolbar icons Použít největší ikony nástrojové lišty - + Huge Největší - + OpenTX Companion - FW: %1 - Profile: %2 OpenTX Companion - FW: %1 - Profil: %2 @@ -3769,7 +3785,7 @@ Chcete ho přesto zapsat ? Nový - + Create a new Models and Settings file Vytvořit nový soubor modelů a nastavení @@ -3782,8 +3798,8 @@ Chcete ho přesto zapsat ? Uložit - - + + Save Models and Settings file Uložit soubor modelů a nastavení @@ -3792,17 +3808,17 @@ Chcete ho přesto zapsat ? Uložit jako ... - + Exit Ukončit - + Cut Model Vyjmout model - + Cut current model to the clipboard Vyjmout aktuální model a uložit do schránky @@ -3811,7 +3827,7 @@ Chcete ho přesto zapsat ? Kopírovat - + Copy current model to the clipboard Kopírovat aktuální model do schránky @@ -3820,442 +3836,447 @@ Chcete ho přesto zapsat ? Vložit - + Paste model from clipboard Vložit obsah schránky na aktuální pozici - + Classical Klasik9x - + The classic companion9x icon theme Původní téma companion9x - + Yerico - + Yellow round honey sweet icon theme Žluté medové téma - + Monochrome Mono - + MonoWhite Mono-bílé - + MonoBlue Mono-modré - + System language Výchozí jazyk prostředí - + Use system language in menus Použít systémový jazyk - + Czech Čeština - + Use Czech in menus Aplikace v českém jazyce - + German - + Use German in menus - + English - + Use English in menus - + Finnish - + Use Finnish in menus - + French - + Use French in menus - + Italian - + Use Italian in menus - + Polish - + Use Polish in menus - + Swedish - + Use Swedish in menus - + About... O aplikaci - + Print... Tisk - + Print current model Vytisknout zvolený model - + Simulate... Simulace - + Simulate current model Simulace vybraného modelu - + Load Backup... Načíst zálohu... - + View Log File... Zobrazit Log - + Open and view log file Otevře a zobrazí soubor logu rádia - + Settings... Předvolby... - + Edit Settings Upravit nastavení předvoleb - + Download... Stáhnout - + Download firmware and voice files Stáhnout firmware a hlasové soubory - + Check for Updates... Zkontrolovat aktualizace - + Check OpenTX and Companion updates Zkontrolovat aktualizace OpenTX a Companion - + Companion Changes... Změny Companion - + Show Companion change log Zobrazí seznam změn jednotlivých vydání Companion - + Firmware Changes... Změny Firmwaru - + Show firmware change log Zobrazí seznam změn jednotlivých vydání Firmware - + Compare Models... Porovnat modely... - + Edit Radio Splash Image... Upravit úvodní logo rádia... - + Edit the splash image of your Radio Upravit úvodní grafické logo rádia - + List programmers... Seznam programátorů... - + Fuses... Pojistky mikrokontroléru... - + Read Firmware from Radio Načíst firmware z rádia - + Read firmware from Radio Načíst firmware z rádia - + Write Firmware to Radio Zapsat firmware do rádia - + Write firmware to Radio Zapsat firmware do rádia - + Add Radio Profile Nový profil rádia - + Create a new Radio Setting Profile Vytvořit nový profil nastavení rádia - + Manuals and other Documents Manuály a jiné dokumenty - + Open the OpenTX document page in a web browser Otevřít stránku s dokumenty OpenTX v prohlížeči - + Write Models and Settings To Radio Zapsat modely a nastavení do rádia - + Write Models and Settings to Radio Zapsat modely a nastavení do rádia - + Read Models and Settings from Radio Načíst modely a nastavení z rádia - + Configure Communications... Nastavení propojení - + Configure software for communicating with the Radio Nastavení softwaru pro komunikaci s rádiem - + Write Backup to Radio Zapsat zálohu do rádia - + Write Backup from file to to Radio Zapsat zálohu ze souboru do rádia - + Backup Radio to File Zálohovat rádio do souboru - + Save a complete backup file of all settings and model data in the Radio Uložit kompletní zálohu modelů a nastavení rádia - + Contributors... Přispěvatelé - + A tribute to those who have contributed to OpenTX and Companion Hold těm, kteří přispěli k OpenTX a Companion - + Recent Files Nedávné soubory - + Recent Models+Settings Nedávné modely a nastavení - + Set Icon Theme Téma ikon - + Set Icon Size Velikost ikon - + Show the list of radio profiles Výběr profilů rádia - + Write Zápis - - + + New Radio + Nové rádio + + + + Invalid Models and Settings File %1 Neplatný soubor modelů a nastavení %1 - + Invalid binary Models and Settings File %1 Neplatný binární soubor modelů a nastavení %1 - + List available programmers Seznam použitelných programátorů - + Show fuses dialog Zobrazit dialog nastavení pojistek mikrokontroléru - + Show the application's About box O aplikaci Companion - + Set Menu Language Nastavení jazyka - - + + File Soubor - - + + Edit Úpravy - + Settings Nastavení - + Read/Write Čtení/Zápis - - + + Help Nápověda - - + + Radio Profile Profil rádia - + Show recent Models+Settings documents Nedávné dokumenty modelů a nastavení rádia @@ -4264,22 +4285,22 @@ Chcete ho přesto zapsat ? Výběr profilů rádia - + Ready Připraven - + %2 - + Unable to find file %1! Nemohu nalézt soubor %1! - + Error reading file %1: %2. Chyba při otevírání souboru %1: @@ -4690,25 +4711,25 @@ p, li { white-space: pre-wrap; } MixesPanel - + Move Up Posunout nahoru - + Ctrl+Up Ctrl+Nahoru - + Move Down Posunout dolů - + Ctrl+Down Ctrl+Dolů @@ -4718,102 +4739,102 @@ p, li { white-space: pre-wrap; } Vymazat všechny mixy - + Weight(%1) Váha(%1) - + Switch(%1) Spínač(%1) - + No Trim Žádný trim - + No DR/Expo Bez DR/Expo - + Offset(%1) Ofset(%1) - + Delay(u%1:d%2) Zpoždění(u%1:d%2) - + Slow(u%1:d%2) Zpomalení(u%1:d%2) - + Warn(%1) Varování(%1) - + Not enough available mixers! Není k dispozici dostatek mixů! - + Delete Selected Mixes? Odstranit vybrané mixy? - + &Add &Přidat - + Ctrl+A - + &Edit &Upravit - + Enter - + &Toggle highlight Přepnout &zvýraznění - + Ctrl+T - + &Delete &Odstranit - + Delete - + &Copy &Kopírovat - + Ctrl+C @@ -4822,42 +4843,42 @@ p, li { white-space: pre-wrap; } &Vyjmout - + Ctrl+X - + C&ut &Vyjmout - + &Paste &Vložit - + Ctrl+V - + Du&plicate &Duplikovat - + Ctrl+U - + Clear Mixes? Vymazat mixy? - + Really clear all the mixes? Opravdu vymazat všechny mixy? @@ -4925,12 +4946,12 @@ p, li { white-space: pre-wrap; } Telemetrie - + Clear Curves? Vymazat křivky? - + Really clear all the curves? Opravdu vymazat všechny křivky? @@ -4938,27 +4959,27 @@ p, li { white-space: pre-wrap; } ModelSelectionPage - + Plane Letadlo - + Multirotor - + Helicopter Helikoptéra - + Model Name: Název modelu: - + Model Type: Typ modelu: @@ -5234,26 +5255,39 @@ p, li { white-space: pre-wrap; } MultirotorPage - + Throttle Channel: Kanál plynu: - + Yaw Channel: Kanál bočení: - + Pitch Channel: Kanál klopení: - + Roll Channel: Kanál klonění: + + OptionsPage + + + Throttle Cut + Zámek plynu (spínač THR) + + + + Throttle Timer + Stopky na plynu + + PrintDialog @@ -5651,9 +5685,13 @@ p, li { white-space: pre-wrap; } - System of units + Units system Systém jednotek + + System of units + Systém jednotek + Blades @@ -5700,45 +5738,45 @@ p, li { white-space: pre-wrap; } QObject - + Rud Směrovka - + Ele Výškovka - + Thr Plyn - + Ail Křidélka - + P1 Potenciometr P1 - + P2 Potenciometr P2 - + P3 Potenciometr P3 @@ -6020,7 +6058,7 @@ p, li { white-space: pre-wrap; } - + ---- @@ -6032,14 +6070,14 @@ p, li { white-space: pre-wrap; } - + ON ZAPNUTO - + OFF VYPNUTO @@ -6069,96 +6107,96 @@ p, li { white-space: pre-wrap; } !Křivka(%1) - - + + Support for frsky telemetry mod Podpora frsky telemetrie tj. zobrazení telemetrických dat na displeji rádia (je potřeba upravit HW, bez této úpravy nebudou fungovat dva přepínače! a pochopitelně nebudou zobrazena žádná telem. data.) - - + + Support for jeti telemetry mod Podpora telemetrie JETI - - + + Support for receiving ardupilot data telemetrie - podpora pro příjem ardupilot dat - - + + Support for receiving NMEA data telemetrie - podpora pro příjem NMEA dat - + Support for telemetry easy board Podpora pro desku TelemetrEZ - - + + Support for MAVLINK devices Podpora pro zařízení s MAVLINK - + Rotary Encoder use in menus navigation Použít Rotary Encoder pro navigaci v menu - + Possibility to enable FAI MODE at field Možnost povolit FAI MODE v menu rádia. FAI je soutěžní mód (www.fai.org), zablokuje vario, zobrazení telemetrie a funkce hlasového hlášení. - + FAI MODE always enabled FAI MODE vždy aktivní (nelze vypnout v menu rádia) FAI je soutěžní mód (www.fai.org), zablokuje vario, zobrazení telemetrie a funkce hlasového hlášení. - - - - - + + + + + Enable heli menu and cyclic mix support Funkce pro heli, nastavení typu mechaniky - - - - - - + + + + + + Enable TEMPLATES menu Přidá menu s jednoduchými šablonami modelu - - - - + + + + No splash screen Bez úvodního loga Firmware nebude obsahovat žádné logo, ani podporu pro něj. Toto se hodí pokud je potřeba ušetřit místo v paměti FLASH pro jiné funkce - - - - - - + + + + + + No flight modes Firmware nebude obsahovat podporu Letových Režimů @@ -6167,126 +6205,139 @@ Toto se hodí pokud je potřeba ušetřit místo v paměti FLASH pro jiné funkc V menu nastavení modelu automaticky nastavíte Zdroj jeho pohybem - - - - - - - - + + + + + + + + Use alternative SQT5 font Použít alternativní znakovou sadu písma (jiný font) - + EEprom write progress bar Progresbar zobrazující zápis do EEPROM (tj. ukládání nastavení) - - + + No Winged Shadow How High support Bez podpory - Winged Shadow How High - - + + No vario support Bez podpory varia - - + + No GPS support Bez podpory GPS - - + + No gauges in the custom telemetry screen Bez grafických ukazatelů hodnoty na obrazovkách telemetrie - + Allow compensating for offset errors in FrSky FAS current sensors Povolit možnost kompenzace chyby ofsetu u Frsky FAS proudového senzoru, pokud je to potřeba - + + + Add support for reversing stick inputs (e.g. needed for FrSky gimbals) + Přidá podporu pro revers os kniplů. +To je nutné zejména pro osazení FrSky kniplů do 9X. + + + OpenTX for M128 / 9X board OpenTX pro M128 / 9X - + OpenTX for 9XR OpenTX pro 9XR - + OpenTX for 9XR with M128 chip OpenTX pro 9XR s M128 čipem - + OpenTX for Gruvin9x board / 9X OpenTX pro Gruvin9x desku / 9X - + OpenTX for Sky9x board / 9X OpenTX pro Sky9x desku / 9X - + + + Haptic module installed + Podpora pro vibrační modul + + + OpenTX for FrSky Taranis Rev4a OpenTX pro FrSky Taranis Rev4a - + Use FrSky Taranis sticks in a 9X/9XR Použití pák z Taranis (hardware) v rádiu 9X/9XR - + OpenTX for FrSky Taranis OpenTX pro FrSky Taranis - - + + Disable HELI menu and cyclic mix support Odstranit funkce pro heli a nastavení typu mechaniky - - + + Disable TEMPLATES menu Odstranit menu s jednoduchými šablonami modelu - - + + Disable Global variables Odstranit Globální proměnné - - - - - - + + + + + + Disable curves menus Bez uživatelsky definovatelných křivek - - - - + + + + Support for radio modified with regular speaker Vylepšený zvukový výstup, funkční i s origo pípákem, @@ -6294,87 +6345,87 @@ ale doporučuje se provést instalaci reproduktoru - - - - - + + + + + Used if you have modified your radio with voice mode Hlasový výstup pro telemetrii, nutno zastavět hlasový modul - - - - + + + + Used if you have modified your radio with haptic mode Výstrahy pomocí vibračního motoru (je třeba osadit) - - - - - - - - + + + + + + + + Channel values displayed in us Hodnoty kanálů budou zobrazeny v us (mikrosekundy) místo procent - - - - - - + + + + + + In model setup menus automatically set source by moving the control Výběr spínače v mixu atd. se provádí jeho sepnutím - - - - - - + + + + + + In model setup menus automatically set switch by moving the control Výběr spínače v mixu atd. se provádí jeho sepnutím - - - - - - + + + + + + Battery graph Grafické znázornění stavu baterie - - - - + + + + Enable the throttle trace in Statistics Přidat Stopu Plynu (Throttle-trace) v panelu STATISTIKA - + Support of FrSky PXX protocol Podpora pro Frsky PXX protokol - - - - - + + + + + Support for DSM2 modules Podpora DSM2 modulů @@ -6386,17 +6437,17 @@ se provádí jeho sepnutím velikost eeprom je 4096B, ale pouze prvních 2048B je použito - + OpenTX for 9X board OpenTX pro 9X desku - - - - - - + + + + + + PPM center adjustment in limits Možnost nastavovat střed serva šířkou pulzu @@ -6405,12 +6456,12 @@ velikost eeprom je 4096B, ale pouze prvních 2048B je použito hodnoty PPM budou zobrazeny v us (mikrosekundy) - - - - - - + + + + + + Symetrical Limits Symetrické limity Přidá možnost volby mezi @@ -6421,19 +6472,19 @@ Přidá možnost volby mezi nastavené limity tedy nemusí být rovny hodnotě -100% a 100%, ale budou pouze maximem výchylky) - - - - - + + + + + Pots use in menus navigation Moznost zadávat hodnoty a pohybovat se v menu pomocí potenciometrů - - + + SmartieParts 2.2 Backlight support Podpora pro modul SmartieParts 2.2 (programátor/podsvícení) @@ -6445,10 +6496,10 @@ Není určeno pro starší verze Smartie Parts se provádí jeho sepnutím - - - - + + + + Enable resetting values by pressing up and down at the same time Rychlé nastavení hodnoty současným stiskem dvou tlačítek. (+) a (-) invertuje hodnotu @@ -6457,22 +6508,22 @@ se provádí jeho sepnutím (UP) a (DN) vastaví výchozí hodnotu - - - - - - + + + + + + No graphical check boxes and sliders Nahrazeni posuvníku a zatržítek (checkboxu) textem - - - - - - + + + + + + Don't use bold font for highlighting active items Vypnout zvýraznění aktivních mixů/spínačů tučným písmem. Pokud není tato volby vybrána, @@ -6481,36 +6532,36 @@ zobrazovány tučným pismem. Neaktivní mixy/spínače budou zobrazeny normálním písmem - - - - + + + + EEprom write Progress bar Progresbar zobrazující zápis do EEPROM (tj. ukládání nastavení) - - - - - + + + + + Imperial units Imerialní jednotky pro telemetrii (stopy, palce, míle atd.) - + Bluetooth interface - - - - - - + + + + + + Global variables Aktivuje Globální Proměnné Jsou to proměnné, které lze použít pro konfiguraci místo některých pevných číselných hodnot. @@ -6519,23 +6570,23 @@ Jejich hodnoty naleznete u originální 9x desky v seznamu křivek. U ostatních Nastavení hodnoty se provádí přímo v seznamu proměnných, nebo pomocí Funkce - + Support for SD memory card Podpora paměťové karty SD - + Support for DSM2 modules using ppm instead of true serial Podpora DSM2 modulů s použitím PPM místo sériového protokolu - + Enable HELI menu and cyclic mix support Funkce pro heli, nastavení typu mechaniky - + Warning Varování @@ -6552,87 +6603,87 @@ Nastavení hodnoty se provádí přímo v seznamu proměnných, nebo pomocí Fun FM%1 - + Input%1 Vstup%1 - + English - + French - + Italian - + German - + Czech - + Slovak - + Spanish - + Portuguese - + Swedish - + Finnish - + No Žádný - + RotEnc A Otočný enkodér :A - + Rot Enc B Otočný enkodér :B - + Rot Enc C Otočný enkodér :C - + Rot Enc D Otočný enkodér :D - + Rot Enc E Otočný enkodér :E @@ -6952,6 +7003,7 @@ Nastavení hodnoty se provádí přímo v seznamu proměnných, nebo pomocí Fun + [I%1] @@ -7038,17 +7090,17 @@ Nastavení hodnoty se provádí přímo v seznamu proměnných, nebo pomocí Fun THs - + PL> TH% - + PL% THt - + PL* @@ -7271,133 +7323,133 @@ Nastavení hodnoty se provádí přímo v seznamu proměnných, nebo pomocí Fun Rotační enkodér - + !Flight mode %1 !Letový režim %1 - + Flight mode %1 Letový režim %1 - + Yellow Žlutá - + Orange Oranžová - + Red Červená - + Winged Shadow How High - + Winged Shadow How High (not supported) Winged Shadow How High (nepodporován) - + FrSky Sensor Hub FrSky Senzor Hub - - + + None Žádný - + Imperial Imperiální - + Metric Metrické - + Extra Fine Extra jemný - + Fine Jemný - + Medium Střední - + Coarse Hrubý - + Exponential Exponenciální - + Count Up Přičítat - + Count Down Odečítat - + %1:%2, - + : %1 Channels, %2usec Delay : %1 Kanálů, %2us pauza - + Flight modes(%1) Letové režimy(%1) - + Flight mode(%1) Letový režim(%1) - + Rudder Směrovka - + Elevator Výškovka - + Throttle Plyn - + Aileron Křidélka @@ -7408,38 +7460,38 @@ Nastavení hodnoty se provádí přímo v seznamu proměnných, nebo pomocí Fun - - + + --- - + Rud Trim Trim směrovky - + Ele Trim Trim výškovky - + Thr Trim Trim plynu - + Ail Trim Trim křidélek - + Rot Enc - + Polish @@ -7554,46 +7606,46 @@ Nastavení hodnoty se provádí přímo v seznamu proměnných, nebo pomocí Fun Upravit - + Own value Vlastní hodnota - + Flight mode %1 value Flight phase %1 value Hodnota režimu LR%1 - + Keys Klávesy - + Sticks Páky - + Keys + Sticks Klávesy i páky - + -GV%1 -GP%1 - + GV%1 GP%1 - + Simulator for this firmware is not yet available Simulátor pro tuto verzi firmware zatím není dostupný @@ -7689,17 +7741,17 @@ Tým OpenTX. RudderPage - + No Ne - + Yes Ano - + <br>Rudder Channel: <br>Kanál směrovky: @@ -7842,7 +7894,7 @@ Funkce trimu bude opačná, stejně tak i varování polohy páky plynu. SimpleTailPage - + Elevator Channel: Kanál výškovky: @@ -7850,28 +7902,28 @@ Funkce trimu bude opačná, stejně tak i varování polohy páky plynu. SimulatorDialog - - + + Warning Varování - + Joystick enabled but not configured correctly Joystick je povolen, ale není nakonfigurován - + Cannot open joystick, joystick disabled Nelze otevřít joystick, není povolený - + Simulating Radio (%1) Simulace rádia (%1) - + Firmware %1 error: %2 Firmware %1 chyba: %2 @@ -8000,7 +8052,7 @@ Funkce trimu bude opačná, stejně tak i varování polohy páky plynu. StandardPage - + Channel %1 Kanál %1 @@ -8008,12 +8060,12 @@ Funkce trimu bude opačná, stejně tak i varování polohy páky plynu. TailPage - + Rudder Channel: Kanál směrovky: - + Elevator Channel: Kanál výškovky: @@ -8021,22 +8073,22 @@ Funkce trimu bude opačná, stejně tak i varování polohy páky plynu. TailSelectionPage - + Elevator and Rudder Výškovka a směrovka - + Only Elevator Jen výškovka - + V-tail Ocas - V - + Tail Type: Typ ocasu: @@ -8457,17 +8509,17 @@ Funkce trimu bude opačná, stejně tak i varování polohy páky plynu. ThrottlePage - + Yes Ano - + No Ne - + <br>Throttle Channel: <br>Kanál plynu: @@ -8511,12 +8563,12 @@ Funkce trimu bude opačná, stejně tak i varování polohy páky plynu. VTailPage - + First Tail Channel: První kanál: - + Second Tail Channel: Druhý kanál: @@ -8524,12 +8576,12 @@ Funkce trimu bude opačná, stejně tak i varování polohy páky plynu. WingtypeSelectionPage - + Standard Wing Běžné křídlo - + Flying Wing / Deltawing Samokřídlo / Delta @@ -8707,92 +8759,103 @@ Funkce trimu bude opačná, stejně tak i varování polohy páky plynu. + Model Options + + + + + Select additional options + + + + Save Changes Uložit změny - + Manually check the direction of each control surface and reverse any channels that make controls move in the wrong direction. Remove the propeller/propellers before you try to control your model for the first time.<br>Please note that continuing removes all old model settings! Ručně zkontrolujte směr každé řídicí plochy a nastavte revers těch co se pohybují v opačném směru. Raději odstraňte vrtuli / vrtule, než se poprvé pokusíte ovládat svůj model.<br>Vezměte prosím na vědomí, že pokud budete pokračovat, dojde k odstranění všech starých nastavení tohoto modelu! - + Enter a name for your model and select model type. Zvolte název a typ modelu. - + Select the receiver channel that is connected to your ESC or throttle servo.<br><br>Throttle - Spektrum: CH1, Futaba: CH3 Zvolte kanál přijímače, který je připojen k ESC, nebo servu plynu.<br><br>Spektrum: CH1, Futaba: CH3 - + Most aircraft have a main wing and a tail with control surfaces. Flying wings and delta winged aircraft only have a single wing. The main control surface on a standard wing controls the roll of the aircraft. This surface is called an aileron.<br>The control surface of a delta wing controls both roll and pitch. This surface is called an elevon. Většina letadel má hlavní křídlo a ocas s ovládacími plochami. Samokřídla a delty mají jen jedno křídlo. Hlavní řídicí plochy na standardním křídle ovládájí klonění letadla. Tyto plochy se nazývají křidélka. <br> Ovládací plochy delta křídla řídí podélný i příčný náklon. Tyto plochy se nazývají elevony. - + Models use one or two channels to control the ailerons.<br>A so called Y-cable can be used to connect a single receiver channel to two separate aileron servos. If your servos are connected by a Y-cable you should select the single-servo option.<br><br>Aileron - Spektrum: CH2, Futaba: CH1 Modely používají jeden, nebo dva kanály pro ovládání křidélek.<br>Tzv. Y-kabel lze použít pro připojení dvou samostatných serv křidélek do jednoho kanálu přijímače. Pokud jsou vaše serva spojeny Y-kabelem, měli byste zvolit možnost "jeden kanál"<br><br>Spektrum: CH2, Futaba: CH1 - + Models use one or two channels to control the elevons.<br>A so called Y-cable can be used to connect single a receiver channel to two separate elevon servos. If your servos are connected by a Y-cable you should select the single-servo option. Modely používají jeden, nebo dva kanály pro ovládání elevonů.<br>Tzv. Y-kabel lze použít pro připojení dvou samostatných serv elevonů do jednoho kanálu přijímače. Pokud jsou vaše serva spojeny Y-kabelem, měli byste zvolit možnost "jeden kanál". - + This wizard assumes that your flaps are controlled by a switch. If your flaps are controlled by a potentiometer you can change that manually later. Tento průvodce předpokládá, že vaše klapky jsou ovládány spínačem. Pokud jsou vaše klapky řízeny potenciometrem můžete toto změnit později ručně. - + Air brakes are used to reduce the speed of advanced sail planes.<br>They are very uncommon on other types of planes. Vzduchové brzdy se používají ke snížení rychlosti moderních kluzáků.<br>Na jiných typech letadel nejsou příliš obvyklé. - + Select the receiver channel that is connected to your rudder.<br><br>Rudder - Spektrum: CH4, Futaba: CH4 Zvolte kanál přijímače, který je připojen k vaší směrovce.<br>Spektrum:. CH4, Futaba: CH4 - + Select the tail type of your plane. Zvolte typ ocasu vašeho modelu. - - + + Select the Rudder and Elevator channels.<br><br>Rudder - Spektrum: CH4, Futaba: CH4<br>Elevator - Spektrum: CH3, Futaba: CH2 Zvolte kanály směrovky a výškovky.<br><br>Směrovka - Spektrum: CH4, Futaba: CH4<br>Výškovka - Spektrum: CH3, Futaba: CH2 - + Select the Elevator channel.<br><br>Elevator - Spektrum: CH3, Futaba: CH2 Zvolte kanál výškovky.<br><br>Spektrum: CH3, Futaba: CH2 - - - - - - + + + + + + + TBD. - + Select the control channels for your multirotor.<br><br>Throttle - Spektrum: CH1, Futaba: CH3<br>Yaw - Spektrum: CH4, Futaba: CH4<br>Pitch - Spektrum: CH3, Futaba: CH2<br>Roll - Spektrum: CH2, Futaba: CH1 Zvolte ovládací kanály vaší multikoptéry.<br><br>Plyn - Spektrum: CH1, Futaba: CH3<br>Bočení - Spektrum: CH4, Futaba: CH4<br>Klopení - Spektrum: CH3, Futaba: CH2<br>Klonění - Spektrum: CH2, Futaba: CH1 - + There is no help available for the current page. Pro tuto stránku není dostupná žádná nápověda. - + Model Wizard Help Nápověda průvodce nastavením modelu @@ -8800,17 +8863,22 @@ Funkce trimu bude opačná, stejně tak i varování polohy páky plynu. WizardPrinter - + Model Name: Název modelu: - + Model Type: Typ modelu: - + + Options: + Volby: + + + Channel %1: Kanál %1: @@ -9995,37 +10063,37 @@ Thomasi Hustererovi (th9x) a také Erazovi Ravivovi(er9x a eePe) Transmitter Splash Screen Editor - + Editor úvodního loga rádia Invert - Invertovat + Invertovat Load FW - + Otevřít FW Load Pict - + Otevřít obrázek Load Profile - + Otevřít profil Save - Uložit + Uložit @@ -10052,12 +10120,12 @@ Thomasi Hustererovi (th9x) a také Erazovi Ravivovi(er9x a eePe) Open Firmware File - + Otevřít soubor firmwaru Can not load embedded image from firmware file %1. - + Nelze načíst vložený obrázek ze souboru firmwaru %1 @@ -10072,47 +10140,47 @@ Thomasi Hustererovi (th9x) a také Erazovi Ravivovi(er9x a eePe) Cannot load the image file %1. - + Nelze načíst obrázek %1. Cannot load profile image %1. - + Nelze načíst obrázek profilu %1. Cannot load the library image %1. - + Nelze načíst obrázek z knihovny %1. File Saved - + Soubor byl uložen The image was saved to the file %1 - + Obrázek byl uložen do souboru %1 Image Refresh Error - + Chyba čtení obrázku Failed to refresh image from file %1 - + Nelze číst obrázek ze souboru %1 File Save Error - + Nelze uložit Failed to write image to %1 - + Nelze uložit obrázek do %1 @@ -10496,7 +10564,7 @@ Tlačítkem Zrušit přerušíte kalibraci Companion Log Viewer - + Prohlížeč logu diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 412963934..6eb812f29 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -418,7 +418,7 @@ #define TR_VSRCRAW "---\0""Směr""Výšk""Plyn""Křid" TR_POTS_VSRCRAW TR_ROTARY_ENCODERS "MAX\0" TR_CYC_VSRCRAW "TrmS" "TrmV" "TrmP" "TrmK" TR_SW_VSRCRAW #define LEN_VTMRMODES "\003" -#define TR_VTMRMODES "VYP""ABS""THs""TH%""THt" +#define TR_VTMRMODES "VYP""ABS""PL>""PL%""PL*" #define LEN_VTRAINERMODES "\006" #define TR_VTRAINERMODES "Učitel""Žák\0 " @@ -470,7 +470,7 @@ #define TR_ELIMITS TR("Limit +25%", "Kanál +/- 125%") #define TR_ETRIMS TR("širší Trim", "Široký trim") #define TR_TRIMINC TR("Krok Trimu", "Krok trimu") -#define TR_TTRACE TR("TH stopek", INDENT "Stopa TH stopek") +#define TR_TTRACE TR("PL stopek", INDENT "Stopa PL stopek") #define TR_TTRIM TR("TrimPlynVol.", INDENT "Trim jen volnoběh") #define TR_BEEPCTR "Středy \221\222" #define TR_PROTO INDENT "Protokol" From 644f9753224fcb8ab1353497d1f7cc7df22760b1 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sat, 3 May 2014 11:26:19 +0200 Subject: [PATCH 32/79] Missed a spot for #1048, Jenkins was not happy --- radio/src/opentx.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 7f49ba785..fd08ea0e4 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -961,8 +961,10 @@ int expo(int x, int k) void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) { #if defined(PCBTARANIS) +#if defined(HELI) int16_t heliAnasCopy[4]; memcpy(heliAnasCopy, heliAnas, sizeof(heliAnasCopy)); +#endif #else int16_t anas2[NUM_INPUTS]; // values before expo, to ensure same expo base when multiple expo lines are used memcpy(anas2, anas, sizeof(anas2)); From c1d57f0b0c6aa2fb63dfdd5c2f71b3b5faa55149 Mon Sep 17 00:00:00 2001 From: bsongis Date: Sat, 3 May 2014 10:21:18 +0200 Subject: [PATCH 33/79] Issue #1052 - FW part --- radio/src/gui/menus.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/radio/src/gui/menus.cpp b/radio/src/gui/menus.cpp index 0c8e0a136..24f3b15bb 100644 --- a/radio/src/gui/menus.cpp +++ b/radio/src/gui/menus.cpp @@ -1360,7 +1360,15 @@ bool isSourceAvailable(int source) { #if defined(PCBTARANIS) if (source>=MIXSRC_FIRST_INPUT && source<=MIXSRC_LAST_INPUT) { - return ZEXIST(g_model.inputNames[source-MIXSRC_FIRST_INPUT]); + int input = source - MIXSRC_FIRST_INPUT; + for (int i=0; ichn == input) + return true; + } + return false; } #endif From 573858552c7abf97bba5be4ce032af5857ba73b6 Mon Sep 17 00:00:00 2001 From: bsongis Date: Sat, 3 May 2014 11:00:56 +0200 Subject: [PATCH 34/79] Fixes #1052 --- companion/src/eeprominterface.cpp | 11 +++++++++++ companion/src/eeprominterface.h | 2 ++ companion/src/helpers.cpp | 8 +++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 868e107ce..5c3f6ff40 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -1003,6 +1003,17 @@ ExpoData * ModelData::insertInput(const int idx) return &expoData[idx]; } +bool ModelData::isInputValid(const unsigned int idx) const +{ + for (int i=0; imode == 0) break; + if (expo->chn == idx) + return true; + } + return false; +} + void ModelData::removeInput(const int idx) { memmove(&expoData[idx], &expoData[idx+1], (C9X_MAX_EXPOS-(idx+1))*sizeof(ExpoData)); diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index ddf770469..d7d655624 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -939,6 +939,8 @@ class ModelData { ExpoData * insertInput(const int idx); void removeInput(const int idx); + bool isInputValid(const unsigned int idx) const; + bool used; char name[12+1]; uint8_t modelVoice; diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp index 836dee391..8522773d4 100644 --- a/companion/src/helpers.cpp +++ b/companion/src/helpers.cpp @@ -548,9 +548,11 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData & if (flags & POPULATE_VIRTUAL_INPUTS) { int virtualInputs = GetCurrentFirmware()->getCapability(VirtualInputs); for (int i=0; iaddItem(item.toString(), item.toValue()); - if (item == source) b->setCurrentIndex(b->count()-1); + if (model.isInputValid(i)) { + item = RawSource(SOURCE_TYPE_VIRTUAL_INPUT, i, &model); + b->addItem(item.toString(), item.toValue()); + if (item == source) b->setCurrentIndex(b->count()-1); + } } } From cb0b6f1c1852af18850dd4b87e7ed2be8d8c6dba Mon Sep 17 00:00:00 2001 From: Jacek Drewniak Date: Sat, 3 May 2014 12:42:07 +0200 Subject: [PATCH 35/79] translation fixes --- companion/src/translations/companion_pl.ts | 4501 ++++++++++++-------- radio/src/translations/pl.h.txt | 4 +- 2 files changed, 2808 insertions(+), 1697 deletions(-) diff --git a/companion/src/translations/companion_pl.ts b/companion/src/translations/companion_pl.ts index c0fc29925..4a8e94b61 100644 --- a/companion/src/translations/companion_pl.ts +++ b/companion/src/translations/companion_pl.ts @@ -4,27 +4,27 @@ AileronsPage - + No Nie - + Yes, controlled by a single channel Tak, kontrolowane przez 1 kanał - + Yes, controlled by two channels Tak, kontrolowane przez 2 kanały - + <br>First Aileron Channel: <br> Pierwszy kanał lotek: - + Second Aileron Channel: Drugi kanał lotek: @@ -32,27 +32,27 @@ AirbrakesPage - + No Nie - + Yes, controlled by a single channel Tak, kontrolowane przez 1 kanał - + Yes, controlled by two channels Tak, kontrolowane przez 2 kanały - + <br>First Airbrake Channel: <br> Pierwszy kanał hamulców: - + Second Airbrake Channel: Drugi kanał hamulców: @@ -80,25 +80,522 @@ Drugi kanał hamulców: + + AppPreferencesDialog + + + Edit Settings + Edycja Ustawień + + + + Radio Profile + Profil radia + + + + + + + Open Folder + Otwórz katalog + + + + Default Channel Order + Bazowa kolejność kanałów + + + + Build Options + Opcje kompilacji + + + + Menu Language + Język Menu + + + + Default Stick Mode + Bazowy mod drążków + + + + Select Image + Wybierz obrazek + + + + Processor ID + ID procesora + + + + Mode selection: + +Mode 1: + Left stick: Elevator, Rudder + Right stick: Throttle, Aileron + +Mode 2: + Left stick: Throttle, Rudder + Right stick: Elevator, Aileron + +Mode 3: + Left stick: Elevator, Aileron + Right stick: Throttle, Rudder + +Mode 4: + Left stick: Throttle, Aileron + Right stick: Elevator, Rudder + + + + + + + Mode 1 (RUD ELE THR AIL) + Mod 1 (SK.SW.Gaz.Lot) + + + + Mode 2 (RUD THR ELE AIL) + Mod 2 (SK.Gaz.SW.Lot) + + + + Mode 3 (AIL ELE THR RUD) + + + + + Mode 4 (AIL THR ELE RUD) + Mod 4 (Lot.Gaz.SW.SK) + + + + Splash Screen + Ekran startowy + + + + <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> + <html><head/><body><p>Kolejność kanałów</p><p><br/></p><p>Definiuje kolejność standardowych mikserów dla nowego modelu.</p></body></html> + + + + R E T A + K W G L + + + + R E A T + K W L G + + + + R T E A + K G W L + + + + R T A E + K G L W + + + + R A E T + K L W G + + + + R A T E + + + + + E R T A + W K G L + + + + E R A T + W K L G + + + + E T R A + W G K L + + + + E T A R + W G L K + + + + E A R T + W L K G + + + + E A T R + W L G K + + + + T R E A + G K W L + + + + T R A E + G K L W + + + + T E R A + G W K L + + + + T E A R + + + + + T A R E + G L K W + + + + T A E R + G L W K + + + + A R E T + L K W G + + + + A R T E + L R G W + + + + A E R T + L W K G + + + + A E T R + L W G K + + + + A T R E + L G K W + + + + A T E R + L G W K + + + + Profile Name + Nazwa profilu + + + + Remove Profile + Usuń Profil + + + + Clear Image + Wyczyść obrazek + + + + Append version number to FW file name + Dodaj numer Firmware do nazwy pliku + + + + Offer to write FW to Tx after download + Zaproponuj zapisanie FirmWare do radia po pobraniu + + + + Radio Type + Typ Radia + + + + Set voice language. +May be different from firmware language + Ustaw język komuniaktów głosowych (). +Moze być inny od języka firmware + + + Radio Firmware + Firmware Radia + + + + Other Settings + Inne ustawienia + + + + General Settings + Główne ustawienia + + + + SD Structure path + Struktura karty SD + + + Set language of voice. +May be different from firmware language + Ustaw język komuniaktów głosowych (). +Moze być inny od języka firmware + + + + Voice Language + Język komunikatów + + + + Application Settings + Ustawienia Aplikacji + + + + Show splash screen when Companion starts + Pokaz ekran startowy przy uruchamianiu Companion + + + + Automatic check for Companion updates + Automatycznie sprawdź aktualizacje Companion + + + + Enable automatic backup before writing firmware + Uaktywnij automatyczny backup przed zapisem firmware + + + + Automatic check for OpenTX firmware updates + Automatycznie sprawdź aktualizacje firmware OpenTX + + + + Splash Screen Library + Biblioteka ekranół powitalnych + + + + Files to keep + Pkili to zapamiętania + + + + Find Executable + Wskaż plik wykonywalny + + + + Google Earth Executable + Plik wykonywalny Google Earth + + + + Only show user splash images + Pokaż tylko ekrany powitalne użytkownika + + + + Show user and companion splash images + Pokaż ekrany powitalne użytkownika i Companion + + + + User Splash Screens + Użyj ekranu powitalnego + + + + Automatic Backup Folder + Automatyczny Katalog Backupów + + + + Use model wizard when creating a new model + Użyj konfiguratora nowych modeli do stworzenia modelu + + + + Simulator Settings + Ustawienia Symulatora + + + + Simulator BackLight + Podświetlenie symularota + + + + Enable + Aktywuj + + + + Blue + Niebieskie + + + + Green + Zielone + + + + Red + Czerwony + + + + Orange + Pomarańczowy + + + + Yellow + Żółty + + + + Joystick + Joystick + + + + Calibrate + Kalibracja + + + + Simulator capture folder + Katalog zapisu symulatora + + + + Only capture to clipboard + Przechwyć tylko do schowka + + + + Remember simulator switch values + Zapamiętaj ustawienia przełączników w symulatorze + + + + My Radio + Moje Radio + + + + Select your snapshot folder + Katalog zrzutów + + + + + No joysticks found + Brak oysticka + + + + EMPTY: No radio settings stored in profile + PUSTY:Brak ustawień radia w profilu + + + + AVAILABLE: Radio settings of unknown age + DOSTĘPNY:Nieznany wiek ustawień radia + + + + AVAILABLE: Radio settings stored %1 + DOSTĘPNY:Zapamietane ustawienai radia %1 + + + + Select your library folder + Wybierz katalog bibliteki + + + + Select your Models and Settings backup folder + Wybierz folder do backupowania Modeli i Ustawień + + + + Select Google Earth executable + Wybierz wykonywalny plik Google Earth + + + + Select the folder replicating your SD structure + Wybierz folder do zreplikowania struktury Twojej karty SD + + + + Not possible to remove profile + Usunięcie profilu jest niemożliwe + + + + The default profile can not be removed. + Podstawowy profil nie moze być usunięty. + + + + Open Image to load + Otwórz obrazek do załadowania + + + + Images (%1) + Obrazki (%1) + + BankPage - + One Jeden - + Two Dwa - + <br>First Elevon Channel: <br> Pierwszy kanał Elevon: - + Second Elevon Channel: Drugi kanał Elevon: @@ -177,10 +674,524 @@ Odwr + + CompareDialog + + + Compare Models + Porównaj modele + + + + Drag first model here + Przeciągnij tutaj pierwszy model + + + + Drag second model here + Przeciągnij tutaj drugi model + + + + Close + Zamknij + + + + Print + Drukuj + + + + Print to file + Drukuj do pliku + + + + + No name + Model bez nazwy + + + + General Model Settings + Główne ustawienia modelu + + + + + + Name + Nazwa + + + + + EEprom Size + Wielkość EEPROM + + + + + Timer1 + Timer1 + + + + + Timer2 + Timer2 + + + + + Protocol + Protokół + + + + + Pulse Polarity + Polaryzacja impulsu + + + + + Throttle Trim + Trymer gazu + + + + + + + Enabled + Włączone + + + + + + + Disabled + Wyłączone + + + + + Throttle Expo + Expo gazu + + + + + Trim Increment + + + + + + Center Beep + + + + + Flight modes Settings + Ustawiania faz lotu + + + + + Fades + Przejścia + + + + + Trims + Trymery + + + + + + + + + + + Switch + Przełącznik + + + + + + + Flight mode name + Nazwa fazy lotu + + + + + IN + (+) + + + + + OUT + (-) + + + + + + + + + + + + + FM + FL + + + + + Gvars + Zm-Gl + + + + + Rot. Enc. + Pokrętło. + + + + Limits + Limity + + + + + + + + + + Offset + Wyrównanie + + + + + + + + Min + Min + + + + + + + + Max + Maks + + + + + + Invert + Odwróć + + + + + + + + CH + Kanał + + + + + INV + Odwr + + + + + NOR + NOR + + + + Global Variables + Zmienne globalne + + + + + GV + ZG + + + + Expo/Dr Settings + Expo/Ustawienia DR + + + + + Weight + Waga + + + + + + + Flight modes + Fazy lotu + + + + + + + Flight mode + Faza lotu + + + + + + + DISABLED + Wyłączone + + + + Mixers + Miksery + + + + + noTrim + Bez trymera + + + + + Delay(u%1:d%2) + Opóźnienie(u%1:d%2) + + + + + Slow(u%1:d%2) + Spowolnienie(u%1:d%2) + + + + + Warn + Ostrzeżenie + + + + Curves + Krzywe + + + + 5 Point Curves + 5-cio punktowe Krzywe + + + + + + + pt %1 + punkt %1 + + + + + Curve + Krzywa + + + + 9 Point Curves + 9-cio punktowe Krzywe + + + + Logical Switches + Przełączniki logiczne + + + + + LS + Lewy suwak + + + + Special Functions + Funkcje Specjalne + + + + + Function + Funkcja + + + + + Param + Parametr + + + + + Repeat + Powtórz + + + + + Enable + Aktywuj + + + + SF + SF + + + + Telemetry Settings + Ustawienia telemetrii + + + + + Analog + Analogowy + + + + + Unit + Jednostka + + + + + Scale + Skala + + + + + + + A%1 + A %1 + + + + + Alarm 1 + Alarm 1 + + + + + Alarm 2 + Alarm 2 + + + + + + + Type + Typ + + + + + + + Condition + Warunek + + + + + + + Value + Wartość + + + + + RSSI Alarm + Alarm RSSI + + + + + Custom Telemetry View + Własny ekran telemetrii + + + + + Telemetry Bars + Wskaźniki telemetryczne + + + + + Bar Number + Numer wskaźnika + + + + + Source + Źródło + + + + Print Document + Drukuj dokument + + + + Select PDF output file + Wybierz plik docelowy PDF + + ConclusionPage - + OK, I understand. OK, Rozumiem. @@ -188,22 +1199,22 @@ CurveGroup - + Diff Róźnicowość - + Expo Expo - + Func Funkcja - + Curve Krzywa @@ -344,7 +1355,7 @@ Edycja krzywej k%1 - + Not enough free points in EEPROM to store the curve. Za mało wolnych punktów w eepromie by zapamiętać krzywą. @@ -435,22 +1446,22 @@ CyclicPage - + 90 90 - + 120 120 - + 120x 9X {120x?} - + 140 140 @@ -596,27 +1607,27 @@ If blank then the input is considered to be "ON" all the time.Krzywa załączona do źródła. - + Edit %1 Edycja %1 - + Rud SK - + Ele SW - + Thr Gaz - + Ail Lotki @@ -628,50 +1639,150 @@ If blank then the input is considered to be "ON" all the time.Kanał gazu: - + Throttle Channel: Kanał gazu: - + Yaw Channel: Kanał odchylenia: - + Pitch Channel: Kanał kąta: - + Roll Channel: Kanał rotacji: + + FirmwarePreferencesDialog + + + Downloads + Pobrania + + + + Check for updates + Sprawdź aktualizacje + + + + Voice + Głos + + + Set language of voice. +May be different from firmware language + Ustaw język komuniaktów głosowych (). +Moze być inny od języka firmware + + + + Set voice language. +May be different from firmware language + Ustaw język komuniaktów głosowych (). +Moze być inny od języka firmware + + + + en + ang + + + + cz + cz + + + + de + niem + + + + es + Hisz + + + + fr + fr + + + + it + włos + + + + pl + pol + + + + pt + port + + + + se + szwe + + + + Download Voice + Pobierz Głos + + + + Download FW + Pobiesz Firmware + + + + Firmware + Firmware + + + - + - + + + + Latest Download + Ostatnie pobranie + + FlapsPage - + No Nie - + Yes, controlled by a single channel Tak, kontrolowane przez 1 kanał - + Yes, controlled by two channels Tak, kontrolowane przez 2 kanały - + <br>First Flap Channel: <br> Pierwszy kanał klap: - + Second Flap Channel: Drugi kanał Klap: @@ -757,17 +1868,17 @@ If blank then the input is considered to be "ON" all the time. FlightModes - + Flight Mode %1 Faza lotu %1 - + (%1) (%1) - + (default) (bazowa) @@ -775,17 +1886,17 @@ If blank then the input is considered to be "ON" all the time. FlybarSelectionPage - + Has Flybar Posiada flaybar - + Flybarless Bez flybara - + Flybar: Faybar: @@ -820,7 +1931,7 @@ Będą one obowiązywać dla wszystkich modeli w tym samym EEPROM-ie.Ustawienia - + Contrast Kontrast @@ -829,7 +1940,7 @@ Będą one obowiązywać dla wszystkich modeli w tym samym EEPROM-ie.Kolejność kanałów (dla szablonów) - + Mode selection: Mode 1: @@ -870,116 +1981,116 @@ Mode 4: - + Mode 1 (RUD ELE THR AIL) Mod 1 (SK.SW.Gaz.Lot) - + Mode 2 (RUD THR ELE AIL) Mod 2 (SK.Gaz.SW.Lot) - + Mode 3 (AIL ELE THR RUD) Mod 3 (Lot.SW.Gaz.SK) - + Mode 4 (AIL THR ELE RUD) Mod 4 (Lot.Gaz.SW.SK) - - + + Quiet Cichy - + Only Alarms Tylko Alarmy - - + + No Keys Bez przycisków - - + + All Wszystkie - + MAVLink Baud Rate Prędkość przesyłu MAVLink - + 4800 Baud 4800 bps - + 9600 Baud 9600 bps - + 14400 Baud 14400 bps - + 19200 Baud 19200 bps - + 38400 Baud 38400 bps - + 57600 Baud 57600 bps - + 76800 Baud 76800 bps - + 115200 Baud 115200 bps - + If this value is not 0, any keypress will turn on the backlight and turn it off after the specified number of seconds. Jeśli ta wartość jest różna od 0, każde naciśnięcie klawisza włączy podświetlenie, które zgaśnie po ustalonej liczbie sekund. - + sec s - - - - - - - - - - - - + + + + + + + + + + + + Beeper volume 0 - Quiet. No beeps at all. @@ -996,13 +2107,13 @@ Mode 4: 4 - Bardzo głośna. - + Alarms Only Tylko alarmy - - + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -1027,20 +2138,20 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Ostrzeżenie cichej pracy - będzie ostrzegało gdy pikanie jest ustawione na cicho(0)</p></body></html> - + Beeper Mode Tryb pikania - - - - + + + + Off Wyłączony - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } @@ -1059,37 +2170,37 @@ p, li { white-space: pre-wrap; } Ostrzeżenie o małym zapasie pamięci - - + + X-Short Bardzo krótka - - + + Short Krótka - - + + Normal Normalna - - + + Long Długa - - + + X-Long Bardzo długa - + Battery warning voltage. This is the threashhold where the battery warning sounds. @@ -1100,83 +2211,83 @@ Ustala próg ostrzeżenia. Dopuszczalne wartości 5v-10v - + Battery Warning Ostrzeżenie o zasilaniu - + Sound Mode Tryb dźwiękowy - + If not zero will sound beeps if the transmitter has been left without inputs for the specified number of minutes. Radio zasygnalizuje dźwiękiem brak aktywności po określonej liczbie minut. 0- wyłącza tę funkcję. - + min Min - - + + Show splash screen on startup Pokazuj ekran startowy z logo - + Show Splash Screen on Startup Pokazuj ekran startowy z logo - + Inactivity Timer Timer bezczynności - + Beeper Pikanie - + Speaker Głośnik - + BeeperVoice Pikanie i głosy - + SpeakerVoice Głośnik i głosy - + Beeper Length Długość piknięcia - + GPS Coordinates Koordynaty GPS - + hh° (N/S) mm' ss''.dd hh° (N/S) mm' ss''.dd - + NMEA - + Timeshift from UTC Strefa czasowa względem UTC @@ -1189,59 +2300,59 @@ This is used by the templated to determine which channel goes to what number out To ustawienie jest używane przez szablony, określa jakie wyjście przypisane jest do kanału. - + Speaker Pitch (spkr only) Wysokość tonów (tylko dźwięki) - + Haptic Mode Tryb wibracji - + Stick Mode Mod drążków - + LCD Display Type Typ ekranu LCD - + Standard Standard - + Optrex - + This is the switch selectrion for turning on the backlight (if installed). To jest przełącznik do włączenia podświetlenia (jeśli zainstalowane). - + Speaker Volume Głośność dźwięków - + Haptic Length Długość wibracji - + Haptic Strength Siła wibracji - + BackLight Brightness Jasność podświetlenia @@ -1250,495 +2361,500 @@ To ustawienie jest używane przez szablony, określa jakie wyjście przypisane j Ostrzeżenie alarmowe - + BackLight Auto OFF after Podświetlenie. Automatyczne wyłącznie po - + RotEnc Navigation Nawigacja pokrętłem - + BackLight Switch Przełącznik podświetlania - + Country Code Kod kraju - + Europe Europa - + Japan Japonia - + America Ameryka - + Metric Metryczne - + Imperial Imperialne - + Measurement Units Jednostki miar - + Voice Language Język komunikatów - + Beep volume Głośność sygnałów - + Wav volume Głośność WAV - + Vario volume Głośność wariometru - + Background volume Głośność tła - + FAI Mode Tryb FAI - + If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. Jeśli uaktywnisz tryb FAI, utracisz informacje o wariometrze, funkcje odtwarzania i ekrany telemetrii. Ten tryb nie może być dezaktywowany. - + R E T A K W G L - + Vario pitch at zero Ton Wario dla zera - + Vario pitch at max Ton Wario dla Maks - + R E A T K W L G - + Default Channel Order Bazowa kolejność kanałów - + <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> <html><head/><body><p>Kolejność kanałów</p><p><br/></p><p>Definiuje kolejność standardowych mikserów dla nowego modelu.</p></body></html> - + R T E A K G W L - + R T A E K G L W - + R A E T K L W G - + R A T E K L G W - + E R T A W K G L - + E R A T W K L G - + E T R A W G K L - + E T A R W G L K - + E A R T W L K G - + E A T R W L G K - + T R E A G K W L - + T R A E G K L W - + T E R A G W K L - + T E A R G W L K - + T A R E G L K W - + T A E R G L W K - + A R E T L K W G - + A R T E L R G W - + A E R T L W K G - + A E T R L W G K - + A T R E L G K W - + A T E R L G W K - + "No Sound" Warning Ostrzeżenie "Brak Dźwięku" - + Low Memory Warning Ostrzeżenie niski stan Pamięci - + --- --- - + 2s 2s - + 3s 3s - + 4s 4s - + 6s 6s - + 8s 8s - + 10s 10s - + 15s 15s - + + Stick reverse (order as above) + Odwrócenie drążków (kolejność jak wyżej) + + + Pot. 4 Potencj. 4 - + Pot. 3 Potencj. 3 - + Pot. 2 Potencj. 2 - + Pot. 1 Potencj. 1 - + Stick 3 Drążek 3 - + Stick 1 Drążek 1 - + Stick 2 Drążek 2 - + Stick 4 Drążek 4 - + OFF Wyłącz - + S-Port Mirror Lustro S-Port - + Debug Debugowanie - + Serial Port Port szeregowy - + Readonly Unlock Odblokuj "Tylko do odczytu" - + SC - + SE - + SA - + SF - + SH - + SD - + SB - + SG - + Vario repeat at zero Powtarzanie dla Wario zero - - + + Hz Hz - + ms ms - + Trainer Trener - + Mode Tryb - + Input Wejście - + Weight Waga - + PPM 1 PPM 1 - - - - + + + + chn1 Kanał 01 - + Rud SK - - - - + + + + chn2 Kanał 02 - - - - + + + + chn3 Kanał 03 - - - - + + + + chn4 Kanał 04 - + Ele SW - + Thr Gaz - + Ail Lotki - + PPM 2 PPM 2 - + PPM 3 PPM 3 - + PPM 4 PPM 4 - + Calibration Kalibracja @@ -1751,20 +2867,20 @@ To ustawienie jest używane przez szablony, określa jakie wyjście przypisane j Drążek 03 - - + + Negative span Ujemny zakres - - + + Mid value Wartość środkowa - - + + Positive span Dodatni zakres @@ -1781,38 +2897,38 @@ To ustawienie jest używane przez szablony, określa jakie wyjście przypisane j Drążek 04 - - - + + + None Żaden - - - + + + Pot (normal) Potencjometr (std) - - - + + + Multipos Switch Przeł. wielopoz - + S1 Type Typ P1 - + S2 Type Typ P2 - + S3 Type Typ P3 @@ -1829,43 +2945,43 @@ To ustawienie jest używane przez szablony, określa jakie wyjście przypisane j Potencjometr 03 - - - - + + + + += (Sum) += (Suma) - - - - + + + + := (Replace) := (Zastąpienie) - + Battery Zasilanie - + v V - + PPM Multiplier Mnożnik PPM - + Current Natężenie - + If you enable FAI, you loose the vario, the play functions, the telemetry screen. This function cannot be disabled by the radio. Are you sure ? @@ -1874,28 +2990,28 @@ funkcje odtwarzania i ekrany telemetrii. Ten tryb nie może być dezaktywowany. Jesteś pewien ? - - + + Warning Ostrzeżenie - + Wrong data in profile, radio calibration was not retrieved Błędne dane w profilu, kalibracja nie została odzyskana - + Wrong data in profile, hw related parameters were not retrieved Błędne dane w profilu, parametry HW nie zostały odzyskana - + Do you want to store calibration in %1 profile<br>overwriting existing calibration? Chcesz zapamiętać dane kalibracji profilu %1<br> Zastąpią one aktualne dane kalibracji? - + Calibration and HW parameters saved. Kalibracja i parametry HW zapamiętane. @@ -1903,17 +3019,17 @@ Jesteś pewien ? GyroPage - + No Nie - + Yes, controled by a switch Tak, kontrolowane przez przełącznik - + Yes, controlled by a pot Tak, kontrolowane przez potencjometr @@ -1992,22 +3108,22 @@ Jesteś pewien ? Kanał gazu: - + Throttle Channel: Kanał gazu: - + Yaw Channel: Kanał odchylenia: - + Pitch Channel: Kanał kąta: - + Roll Channel: Kanał rotacji: @@ -2016,25 +3132,25 @@ Jesteś pewien ? InputsPanel - + Move Up W górę - + Ctrl+Up Ctrl+Up - + Move Down W dół - + Ctrl+Down Ctrl+Down @@ -2048,112 +3164,112 @@ Jesteś pewien ? Wyczyść wszystkie wejścia - + Source(%1) Źródło(%1) - + No Trim Bez trymera - + Weight(%1) Waga(%1) - + Switch(%1) Przełącznik(%1) - + Not enough available inputs! Za mało dostępnych wejść! - + Delete Selected Inputs? Skasować Wybrane Wejścia? - + &Add &Dodaj - + Ctrl+A Ctrl+A - + &Edit &Edycja - + Enter Enter - + &Delete &Wykasuj - + Delete Wykasuj - + &Copy &Kopiuj - + Ctrl+C Ctrl+C - + &Cut &Wytnij - + Ctrl+X Ctrl+X - + &Paste &Wklej - + Ctrl+V Ctrl+V - + Du&plicate &Zduplikuj - + Ctrl+U Ctrl+U - + Clear Inputs? Wyczyść Wejścia? - + Really clear all the inputs? Czy na pewno wyczyścić wszystkie wejścia? @@ -2247,130 +3363,130 @@ Jesteś pewien ? MainWindow - - - - + + + + File loaded Plik załadowany - + Display previous warning again at startup ? Wyświetlić poprzednie ostrzeżenie przy uruchomieniu? - + Checking for updates Sprawdź aktualizacje - - - - - + + + + + Unable to check for updates. Nie mogę sprawdzić aktualizacji. - - - - + + + + Save As Zapisz jako - + Executable (*.exe) Wykonywalny (*.exe) - + New release available Dostępne jest nowe wydanie - - + + No updates available at this time. Brak aktualizacji dostępnych teraz. - + Would you like to launch the installer? Chcesz uruchomić instalator? - - - - - - - - - - - - - + + + + + + + + + + + + + Error Błąd - - - - - + + + + + Error opening file %1: %2. Błąd otwarcia pliku %1: %2. - + Compilation server termporary failure, try later Serwer kompilacji chwilowo nieczynny, spróbuj później - + Display previous message again at startup ? Czy ponownie wyświetlić poprzednią informację przy uruchomieniu? - + A new release of Companion is available, please check the OpenTX website! Nowe wydanie Companion jest dostępne, proszę sprawdzić stronę OpenTX! - - + + Not enough memory for all the selected firmware options Za mało pamięci dla wybranej konfiguracji firmware - + Compilation server temporary failure, try later Serwer kompilacji chwilowo nieczynny, spróbuj później - - + + Compilation server too busy, try later Serwer kompilacji zbyt zajęty, spróbuj później - - + + Unknown server failure, try later Nieznany błąd serwera, spróbuj później - + Firmware %1 does not seem to have ever been downloaded. Version %2 is available. Do you want to download it now ? @@ -2380,31 +3496,31 @@ Pobrać teraz? - - + + Yes Tak - - + + No Nie - - + + Release Notes Informacje o wydaniu - - + + Do you want to download release %1 now ? Chcesz pobrać wydanie %1 teraz? - + A new version of %1 firmware is available (current %2 - newer %3). Do you want to download it now ? Jest dostępna nowa wersja firmware %1 @@ -2412,55 +3528,55 @@ Do you want to download it now ? Chcesz pobrać teraz? - + Ignore this version (r%1)? Zignorować wersję (r%1)? - + Release notes contain very important informations. Do you want to see them now ? Opis wydania zawiera bardzo ważne informacje. Chcesz je przeczytać teraz? - - + + File saved Plik zapisany - + Firmware updates Aktualizacja firmware - + Current firmware does not provide release notes informations. Aktualny firmware nie zawiera opisu wydania. - + Cannot write file %1: %2. Nie mogę zapisać pliku %1: %2. - + Backup is impossible Backup jest niemożliwy do wykonania - + The backup dir set in preferences does not exist Brak ustawień ścieżki backupu - + Warning Ostrzeżenie @@ -2480,102 +3596,102 @@ Chcesz pobrać teraz? Backup nieudany - + Copyright - + OpenTX Companion - FW: %1 - Profile: %2 OpenTX Companion - FW: %1 - Profil: %2 - + New Nowy - + Open... Otwórz... - + Save Zapisz - + Save As... Zapisz jako... - + Copy Model Kopiuj Model - + Paste Model Wklej Model - + About... O aplikacji... - + Print... Drukuj... - + Simulate... Symulacja... - + Simulate current model Symulacja aktualnego modelu - + Load Backup... Załaduj backup... - + View Log File... Obejrzyj plik logów... - + Open and view log file Otwórz i obejrzyj plik logów - + Edit Settings Edycja Ustawień - + Settings... Ustawienia... - + Download firmware and voice files Pobierz firmware i pliki dźwiękowe - + Create a new Radio Setting Profile Utwórz nowy Profil Ustawień Radia - + A monochrome black icon theme Monochromatyczny czarny wygląd ikon @@ -2588,51 +3704,51 @@ Chcesz pobrać teraz? Firmware już nie mieści się w pamięci radia ze względu na wybrane parametry - + Do you want to write the firmware to the radio now ? Chcesz wgrać firmware do radia teraz? - - + + Open Models and Settings file Otwórz plik Modeli i Ustawień - - + + - + Read Models and Settings From Radio Wczytaj Modele i Ustawienia z radia - + Write Radio Backup from %1 to the radio? Czy zapisać Backup z %1 do radia ? - - - - + + + + Backup Models and Settings From Radio Zbakupuj Modele i Ustawienia z radia - + The radio firmware belongs to another product family, check file and preferences! Firmware radia nalezy do innej rodziny produktów, sprawdź plik i preferencje ! - + The radio firmware is outdated, please upgrade! Firmware w radiu jest przestarzały. Proszę zaktualizować! - + Write Backup To Radio Zapisz Backup do radia @@ -2682,7 +3798,7 @@ Chcesz pobrać teraz? Nowe Modele+Ustawienia - + Create a new Models and Settings file Utwórz nowy plik Modeli i Ustawień @@ -2695,8 +3811,8 @@ Chcesz pobrać teraz? Zapisz Modele i Ustawienia... - - + + Save Models and Settings file Zapisz plik Modeli i Ustawień @@ -2705,12 +3821,12 @@ Chcesz pobrać teraz? Zapisz Modele+Ustawienia jako... - + Cut Model Wytnij Model - + Cut current model to the clipboard Wytnij aktualny model do schowka @@ -2719,7 +3835,7 @@ Chcesz pobrać teraz? Kopiuj Model... - + Copy current model to the clipboard Wytnij aktualny model do schowka @@ -2728,122 +3844,122 @@ Chcesz pobrać teraz? Wklej Model... - + Paste model from clipboard Wklaj Model ze schowka - + The classic companion9x icon theme Klasyczny zestaw ikon Companion - + A monochrome white icon theme Monochromatyczny biały wygląd ikon - + A monochrome blue icon theme Monochromatyczny niebieski wygląd ikon - + Small Małe - + Use small toolbar icons Użyj małych ikon paska narzędzi - + Use normal size toolbar icons Użyj normalnych ikon paska narzędzi - + Normal Normalne - + Use big toolbar icons Użyj dużych ikon paska narzędzi - + Big Duże - + Use huge toolbar icons Użyj olbrzymich ikon paska narzędzi - + Huge Olbrzymie - + Czech Czeski - + Use Czech in menus Użyj Czeskiego w menu - + German Niemiecki - + Use German in menus Użyj Niemieckiego w menu - + English Angielski - + Use English in menus Użyj Angielskiego w menu - + Finnish Fiński - + Use Finnish in menus Użyj Fińskiego w menu - + French Francuski - + Use French in menus Użyj Francuskiego w menu - + Italian Włoski - + Use Italian in menus Użyj Włoskiego w menu @@ -2856,12 +3972,12 @@ Chcesz pobrać teraz? Użyj Hebrajskiego w menu - + Polish Polski - + Use Polish in menus Użyj Polskiego w menu @@ -2874,12 +3990,12 @@ Chcesz pobrać teraz? Użyj Portualskiego w menu - + Swedish Szwedzki - + Use Swedish in menus Użyj Szwedzkiego w menu @@ -2900,92 +4016,92 @@ Chcesz pobrać teraz? Użyj holenderskiego w menu - + Edit Radio Splash Image... Edytor erkanu startowego radia... - + Edit the splash image of your Radio Edytuj ekran startowy swojego radia - + Read Firmware from Radio Odczytaj Firmware z radia - + Read firmware from Radio Odczytaj Firmware z radia - + Write Firmware to Radio Zapisz firmware do radia - + Write firmware to Radio Zapisz firmware do radia - + Write Models and Settings To Radio Zapisz Modele i Ustawienia do radia - + Write Models and Settings to Radio Zapisz Modele i Ustawienia do radia - + Read Models and Settings from Radio Wczytaj Modele i Ustawienia z radia - + Configure software for communicating with the Radio Ustaw oprogramowanie komunikacyjne z radiem - + Write Backup to Radio Zapisz Backup do radia - + Write Backup from file to to Radio Zapisz Backup do radia z pliku - + Backup Radio to File Zbackupuj radio do pliku - + Save a complete backup file of all settings and model data in the Radio Zachowaj kompletny plik backup wszytkich ustawień i danych modeli z radia - + Recent Files Ostatnie Pliki - + Show recent Models+Settings documents Pokaż ostatanie dokumenty Modeli i Ustawień - + Print current model Drukuj aktualny model - + Check OpenTX and Companion updates Sprawdź aktualizacje OpenTX i Companion @@ -2994,17 +4110,17 @@ Chcesz pobrać teraz? Edytor erkanu startowego radia... - + Fuses... Bezpieczniki... - + Manuals and other Documents Podręcznik i dokumentacja - + Open the OpenTX document page in a web browser Otwórz stronę dokumentacji OpenTX w przeglądarce @@ -3013,32 +4129,32 @@ Chcesz pobrać teraz? Zapisz modele radia i ustawienia do pliku - + A tribute to those who have contributed to OpenTX and Companion Hołd dla tych, którzy przyczynili się do rozwoju OpenTX i Companion - + Contributors... Współpracownicy... - + Recent Models+Settings Ostatnie Modele+Ustawienia - + Set Icon Theme Ustaw wygląd ikon - + Set Icon Size Ustaw wielkość ikon - + A new version of Companion is available (version %1)<br>Would you like to download it? Dostępna jest nowy Companion (wersja %1)<br>Chcesz ją pobrać ? @@ -3051,8 +4167,8 @@ Chcesz pobrać teraz? Firmware już nie mieści się w pamięci radia ze względu na wybrane parametry - - + + Compilation server requires registration, please check OpenTX web site Serwer kompilacji wymaga rejestracji, proszę odwiedzić stronę OpenTX @@ -3065,24 +4181,24 @@ Chcesz pobrać teraz? Chcesz wgrać firmware do radia teraz? - + The selected language will be used the next time you start Companion. Wybrany język będzie użyty po ponownym uruchomieniu Comapnion. - - - + + + OK OK - + The new theme will be loaded the next time you start Companion. Wybrany wygląd będzie użyty po ponownym uruchomieniu Comapnion. - + The icon size will be used the next time you start Companion. Wybrana wiekość ikon będzie użyta po ponownym uruchomieniu Comapnion. @@ -3095,7 +4211,7 @@ Chcesz pobrać teraz? Czy zapisać Modele i Ustawienia z %1 do radia ? - + The file %1 has not been recognized as a valid Models and Settings file Write anyway ? @@ -3108,7 +4224,7 @@ Czy mimo wszystko zapisać? Zbakupuj Modele i Ustawienia z radia - + Cannot check Models and Settings compatibility! Continue anyway? Nie mogę potwierdzić kompatybilności Modeli i Ustawień. Kontynuować? @@ -3163,32 +4279,32 @@ Czy mimo wszystko zapisać? Odczytaj firmware z radia do pliku - + OpenTX Home Page: <a href='%1'>%1</a> Strona domowa OpenTX: <a href='%1'>%1</a> - + The OpenTX Companion project was originally forked from <a href='%2'>eePe</a> Projekt Companion odłączony z oryginalnego <a href='%2'>eePe</a> - + If you've found this program useful, please support by <a href='%1'>donating</a> Jeśli uważasz, że ten program jest użyteczny, wesprzyj poprzez <a href='%1'>donację</a> - + Version %1, %3 Wersja %1, %3 - + About Companion O aplikacji Companion - + Load backup from file Załaduj backup z pliku @@ -3205,67 +4321,67 @@ Czy mimo wszystko zapisać? Zapisz firmware - + Exit Zakończ - + Monochrome Monochromatyczny - + MonoWhite MonoBiały - + MonoBlue MonoNiebieski - + System language Język systemu - + Use system language in menus Użyj języka systemu w menu - + Download... Pobieranie... - + Check for Updates... Sprawdź aktualizacje... - + Companion Changes... Zmiany w Companion... - + Show Companion change log Pokaż log zmian Companion - + Firmware Changes... Zmiany w Firmware... - + Show firmware change log Pokaż log zmian Firmware - + Compare Models... Porównaj modele... @@ -3274,7 +4390,7 @@ Czy mimo wszystko zapisać? Edytuj ekran startowy swojego radia - + List programmers... Lista programistów... @@ -3283,12 +4399,12 @@ Czy mimo wszystko zapisać? Zapisz firmware do radia - + Add Radio Profile Dodaj profil radia - + Configure Communications... Ustaw komunikację... @@ -3313,12 +4429,12 @@ Czy mimo wszystko zapisać? Wczytaj Firmware - + Yerico - + Yellow round honey sweet icon theme Żółty zaokrąglony miodiowy motyw ikon @@ -3327,8 +4443,8 @@ Czy mimo wszystko zapisać? Wczytaj Firmware z radia - - + + Radio Profile Profil radia @@ -3337,106 +4453,111 @@ Czy mimo wszystko zapisać? Pokaż listę wyboru profili radia - + Write Zapis - + %2 %2 - - + + Invalid Models and Settings File %1 Błędny plik %1 Modeli i Ustawień - + Invalid binary Models and Settings File %1 Błędny binarny plik %1 Modeli i Ustawień - + Compare models Porównaj modele - + Exit the application Zakończ aplikację companion9x - + List available programmers Lista dostępnych programatorów - + Show fuses dialog Pokaż okno ustawień mikro-kontrolera - + Show the application's About box O aplikacji companion9x - + Classical Klasyczny - + Set Menu Language Ustaw język menu - - + + File Plik - - + + Edit Edycja - + Settings Ustawienia - + Read/Write Odczyt/Zapis - - + + Help Pomoc - + Show the list of radio profiles Pokaż listę profili radia - + Ready Gotowe - + + New Radio + Nowe Radio + + + Unable to find file %1! Nie mogę znaleźć pliku %1! - + Error reading file %1: %2. Błąd odczytu pliku %1: @@ -3446,136 +4567,136 @@ Czy mimo wszystko zapisać? MdiChild - + free bytes wolna pamięć[B] - + Editing model %1: Edycja modelu %1: - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + Error Błąd - - + + Unable to find file %1! Nie mogę odnaleźć pliku %1! - - - - + + + + Error opening file %1: %2. Błąd otwarcia pliku %1: %2. - - + + Invalid EEPROM File %1 Zły plik EEPROM %1 - + Invalid binary EEPROM File %1 Nieprawidłowy plik binarny EEPROM %1 - - - - + + + + Save As Zapisz jako - - - - + + + + Cannot write file %1: %2. Nie mogę zapisać pliku %1: %2. - - + + Error writing file %1: %2. Błąd zapisu pliku %1: %2. - + Companion Companion - - - + + + Backup EEPROM From Radio Backup EEPROM z radia - + Write EEPROM To Radio Zapis EEPROM do radia - - + + Error reading file %1: %2. Błąd odczytu pliku %1: %2. - + %1 has been modified. Do you want to save your changes? %1 został zmieniony. Zapisać? - + Backup is impossible Backup jest niemożliwy - + The backup dir set in preferences does not exist Ustawienia preferencji katalogu backupu nie istnieją - + Cannot write temporary file! Nie mogę zapisać pliku tymczasowego! @@ -3584,23 +4705,23 @@ Zapisać? Backup EEPROM z radia - + Cannot check eeprom compatibility! Continue anyway? Nie mogę sprawdzić kompatybilności EEprom! Kontynuować ? - - + + Warning Ostrzeżenie - + Firmware in radio is of a different family of eeprom written, check file and preferences! Firmware w radiu jest różny od zapisanego eepromu, sprawdź plik i ustawienia! - + Firmware in flash is outdated, please upgrade! Firmware w radiu jest przestarzały. Proszę zaktualizować! @@ -3609,12 +4730,12 @@ Zapisać? Zapis EEPROM do radia - + Open backup Models and Settings file Otwórz plik backupu Modeli i Ustawień - + Invalid binary backup File %1 nieprawidłowy binarny plik %1 @@ -3834,27 +4955,27 @@ p, li { white-space: pre-wrap; } Cel -> KAN%1%2 - + DEST -> CH%1 Cel -> KAN%1 - + Rud SK - + Ele SW - + Thr Gaz - + Ail Lotki @@ -3863,25 +4984,25 @@ p, li { white-space: pre-wrap; } MixesPanel - + Move Up W górę - + Ctrl+Up Ctrl+Up - + Move Down W dół - + Ctrl+Down Ctrl+Down @@ -3891,102 +5012,102 @@ p, li { white-space: pre-wrap; } Wyczyść miksery - + Weight(%1) Waga(%1) - + Switch(%1) Przełącznik(%1) - + No Trim Bez trymera - + No DR/Expo Bez DR/Expo - + Offset(%1) Wyrównanie(%1) - + Delay(u%1:d%2) Opóźnienie(u%1:d%2) - + Slow(u%1:d%2) Spowolnienie(u%1:d%2) - + Warn(%1) Ostrzeżenie(%1) - + Not enough available mixers! Za mało dostępnych mikserów! - + Delete Selected Mixes? Skasować wybrane miksery? - + &Add &Dodaj - + Ctrl+A Ctrl+A - + &Edit &Edycja - + Enter Enter - + &Toggle highlight &Przełącz podświetlenie - + Ctrl+T Ctrl+T - + &Delete &Wykasuj - + Delete Wykasuj - + &Copy &Kopiuj - + Ctrl+C Ctrl+C @@ -3995,42 +5116,42 @@ p, li { white-space: pre-wrap; } &Wytnij - + Ctrl+X Ctrl+X - + C&ut &Wytnij - + &Paste &Wklej - + Ctrl+V Ctrl+V - + Du&plicate &Zduplikuj - + Ctrl+U Ctrl+U - + Clear Mixes? Wyczyść miksery? - + Really clear all the mixes? Czy na pewno wyczyścić wszystkie miksery? @@ -4048,27 +5169,27 @@ p, li { white-space: pre-wrap; } Symulacja - + Setup Ustawienia - + Heli Heli - + Inputs Wejścia - + Servos Serwa - + Logical Switches Przełączniki logiczne @@ -4077,37 +5198,37 @@ p, li { white-space: pre-wrap; } Kanały - + Mixes Miksery - + Flight Modes Fazy lotu - + Special Functions Funkcje Specjalne - + Curves Krzywe - + Telemetry Telemetria - + Clear Curves? Wyczyść krzywe? - + Really clear all the curves? Czy na pewno wyczyścić wszystkie krzywe? @@ -4115,27 +5236,27 @@ p, li { white-space: pre-wrap; } ModelSelectionPage - + Plane Samolot - + Multirotor Multikopter - + Helicopter Śmigłowiec - + Model Name: Nazwa Modelu: - + Model Type: Typ Modelu: @@ -4441,69 +5562,528 @@ p, li { white-space: pre-wrap; } Kanał gazu: - + Throttle Channel: Kanał gazu: - + Yaw Channel: Kanał odchylenia: - + Pitch Channel: Kanał kąta: - + Roll Channel: Kanał rotacji: + + OptionsPage + + + Throttle Cut + Odcięcie Gazu + + + + Throttle Timer + Timer Gazu + + + + PrintDialog + + + Close + Zamknij + + + + Print + Drukuj + + + + Print to file + Drukuj do pliku + + + + Setup for: + Ustawianie: + + + + printed on: %1 + Wydrukowanno na: %1 + + + + General Model Settings + Główne ustawienia modelu + + + + + + + Name + Nazwa + + + + EEprom Size + Wielkość EEPROM + + + + Timer1 + Timer1 + + + + Timer2 + Timer2 + + + + Protocol + Protokół + + + + Pulse Polarity + Polaryzacja impulsu + + + + Throttle Trim + Trymer gazu + + + + + + Enabled + Włączone + + + + + Disabled + Wyłączone + + + + Throttle Expo + Expo gazu + + + + Trim Increment + Kroki trymera + + + + Center Beep + Pikanie przy centrowaniu + + + + Flight modes Settings + Ustawiania faz lotu + + + + Fades + Przejścia + + + + Trims + Trymery + + + + Gvars + Zm-Gl + + + + Rot.Enc. + Pokrętło. + + + + + + + Switch + Przełącznik + + + + Flight mode name + Nazwa fazy lotu + + + + IN + (+) + + + + OUT + (-) + + + + + + + FM + FL + + + + Expo/Dr Settings + Expo/Ustawienia DR + + + + Weight + Waga + + + + + Flight modes + Fazy lotu + + + + + Flight mode + Faza lotu + + + + + DISABLED + Wyłączone + + + + Mixers + Miksery + + + + + + + CH + Kanał + + + + noTrim + Bez trymera + + + + + + + + Offset + Wyrównanie + + + + Delay(u%1:d%2) + Opóźnienie(u%1:d%2) + + + + Slow(u%1:d%2) + Spowolnienie(u%1:d%2) + + + + Warn + Ostrzeżenie + + + + Limits + Limity + + + + + + + Min + Min + + + + + + + Max + Maks + + + + + + Invert + Odwróć + + + + + + INV + Odwr + + + + + + NOR + NOR + + + + Curves + Krzywe + + + + + + Curve + Krzywa + + + + pt %1 + punkt %1 + + + + Logical Switches + Przełączniki logiczne + + + + + LS + PL + + + + Global Variables + Zmienne globalne + + + + GV + ZG + + + + Special Functions + Funkcje Specjalne + + + + Function + Funkcja + + + + Parameter + Parametr + + + + Repeat + Powtórz + + + + Telemetry Settings + Ustawienia telemetrii + + + + + Alarm 1 + Alarm 1 + + + + + Alarm 2 + Alarm 2 + + + + Analog + Analogowy + + + + Unit + Jednostka + + + + Scale + Skala + + + + + + + Type + Typ + + + + + + + Condition + Warunek + + + + + + + Value + Wartość + + + + A%1 + A %1 + + + + RSSI Alarm + Alarm RSSI + + + + Frsky serial protocol + Protokół szeregowy Frsky + + + + Units system + Jednostki systemu + + + System of units + System jednostek + + + + Blades + Łopat śmigła + + + + + Custom Telemetry View + Własny ekran telemetrii + + + + Telemetry Bars + Wskaźniki telemetryczne + + + + Bar Number + Numer wskaźnika + + + + Source + Źródło + + + + Print Document + Drukuj dokument + + + + Select PDF output file + Wybierz plik docelowy PDF + + + + ODF files (*.odt);;PDF Files(*.pdf);;HTML-Files (*.htm *.html);;All Files (*) + pliki ODF (*.odt);;pliki PDF (*.pdf);;pliki HTML (*.htm *.html);;Wszystkie pliki (*) + + QObject - + Rud SK - + Ele SW - + Thr Gaz - + Ail Lotki - + P1 Potencjometr 1 - + P2 Potencjometr 2 - + P3 Potencjometr 3 @@ -4794,7 +6374,7 @@ p, li { white-space: pre-wrap; } - + ---- @@ -4806,14 +6386,14 @@ p, li { white-space: pre-wrap; } - + ON Włącz - + OFF Wyłącz @@ -4843,100 +6423,100 @@ p, li { white-space: pre-wrap; } !Krzywa(%1) - - + + Support for frsky telemetry mod Wsparcie dla telemetrii FrSky - - + + Support for jeti telemetry mod Wsparcie telemetrii JETI - - + + Support for receiving ardupilot data Wsparcie dla otrzymywania danych ardupilota - - + + Support for receiving NMEA data Wsparcie dla otrzymywania danych NMEA - + Support for telemetry easy board Wsparcie dla platformy TelemetrEZ - - + + Support for MAVLINK devices Wsparcie urządzeń MAVLINK - + Rotary Encoder use in menus navigation Użycie pokrętła do nawigacji w menu - + Possibility to enable FAI MODE at field Umożliwienie uaktywniania tryb FAI w menu - + FAI MODE always enabled Tryb FAI zawsze aktywny - - - - - + + + + + Enable heli menu and cyclic mix support Uaktywnione menu Heli i wsparcie dla cyklicznych mikserów - - - - - - + + + + + + Enable TEMPLATES menu Uaktywnienie menu szablonów - - - - + + + + No splash screen Bez loga na ekranie - - - - - - + + + + + + No flight modes Firmware bez menu faz lotu - - - - - - - + + + + + + + Channel values displayed in us Wartosći kanałów wyswietlone w us @@ -4946,148 +6526,154 @@ p, li { white-space: pre-wrap; } W menu ustawień modelu automatycznie wybierz źródło poprzez poruszenie nim - - - - - - - + + + + + + + Use alternative SQT5 font Użyj alternatywnego fontu SQT5 - + EEprom write progress bar Pasek postępu wgrywania EEPROMu - - + + No Winged Shadow How High support Bez wsparcia - Winged Shadow How High - - + + No vario support Bez wsparcia wario - - + + No GPS support Bez wsparcia GPS - - + + No gauges in the custom telemetry screen Bez graficznych wskazań telemetrii - + Allow compensating for offset errors in FrSky FAS current sensors Pozwolenie na kompensację błędów w czujnikach natężenia FrSky FAS - + + + Haptic module installed + Moduł Haptic zainstalowany + + + OpenTX for FrSky Taranis Rev4a OpenTX dla platformy FrSky Taranis Rev4a - + Use FrSky Taranis sticks in a 9X/9XR Użyj drążków Taranisa w 9X/9XR - + OpenTX for FrSky Taranis OpenTX dla platformy FrSky Taranis - - + + Disable HELI menu and cyclic mix support Dezaktywowane menu Heli i wsparcie dla cyklicznych mikserów - - + + Disable TEMPLATES menu Dezaktywowane menu szablonów - - + + Disable Global variables dezaktywowane zmienne globalne - - - - - - + + + + + + Disable curves menus Bez menu krzywych - - - - + + + + Support for radio modified with regular speaker Wsparcie dla modyfikacji radia zwykłym głośnikiem - - - - - + + + + + Used if you have modified your radio with voice mode Używane jeśli radio jest zmodyfikowane w calu użycia komunikatów głosowych - - - - + + + + Used if you have modified your radio with haptic mode Używane jeśli radio jest zmodyfikowane do użycia wibracji - - - - - - + + + + + + Battery graph Grafika baterii - - - - + + + + Enable the throttle trace in Statistics Uaktywnić śledzenie gazu w statystykach - + Support of FrSky PXX protocol Wsparcie dla protokołu Frsky PXX - - - - - + + + + + Support for DSM2 modules wsparcie modułu DSM2 @@ -5099,12 +6685,12 @@ p, li { white-space: pre-wrap; } wielkość eepromu jest 4096 ale tylko pierwsze 2048 jest używane - - - - - - + + + + + + PPM center adjustment in limits Limit dostrojenia centrowania PPM @@ -5113,32 +6699,32 @@ p, li { white-space: pre-wrap; } Wartości PPM wyświetlane w us (mikrosekundy) - - - - - - + + + + + + Symetrical Limits Limity symetryczne - - - - - + + + + + Pots use in menus navigation Użycie potencjometrów do nawigacji w menu - + OpenTX for 9X board OpenTX dla platformy 9X - - + + SmartieParts 2.2 Backlight support Wsparcie podświetlenia SmartieParts 2.2 @@ -5147,10 +6733,10 @@ p, li { white-space: pre-wrap; } W menu modelu automatyczne wybranie przełącznika w przez jego poruszenie - - - - + + + + Enable resetting values by pressing up and down at the same time Szybkie nastawianie wartości (+) a (-) neguje wartość @@ -5159,125 +6745,131 @@ p, li { white-space: pre-wrap; } (UP) a (DN) ustawia 0 - - - - - - + + + + + + No graphical check boxes and sliders Brak graficznych chekboxów i sliderów - - - - - - + + + + + + Don't use bold font for highlighting active items Nie używaj podświetlenia dla wybranych aktywnych elementów, mikserów, krzywych, expo, etc - + OpenTX for M128 / 9X board OpenTX dla platformy M128 / 9X - - - - + + + + EEprom write Progress bar Pasek postępu zapisywania EEPROM - - - - - + + + + + Imperial units Imperialne jednostki w telemetrii - + Bluetooth interface Interface Bluetooth - - - - - - + + + + + + Global variables Globalne zmienne - - - - - - + + + + + + In model setup menus automatically set source by moving the control W menu ustawień modelu automatycznie wybierz źródło poprzez poruszenie nim - - - - - - + + + + + + In model setup menus automatically set switch by moving the control W menu ustawień modelu automatycznie wybierz źródło poprzez poruszenie nim - + + + Add support for reversing stick inputs (e.g. needed for FrSky gimbals) + Dodanie wsparcia dla odwracania wejscia drazków (np. potrzebne dla gimbali FrSky) + + + OpenTX for 9XR OpenTX dla platformy 9XR - + OpenTX for 9XR with M128 chip OpenTX dla platformy 9X z układem M128 - + OpenTX for Gruvin9x board / 9X ie: OpenTX dla platformy Gruvin9X / 9X - + Support for SD memory card Wsparcie karty SD - + Support for DSM2 modules using ppm instead of true serial Wsparcie modułu DSM2 przez użycie PPM zamiast prawdziwego szeregowego - + OpenTX for Sky9x board / 9X OpenTX dla platformy Sky9x / 9X - + Enable HELI menu and cyclic mix support Uaktywnij menu HELI i cyklicznych mikserów - - + + Warning Ostrzeżenie - + EEPROM saved with these warnings: EEPROM zapisany z tymi ostrzeżeniami: @@ -5289,87 +6881,87 @@ p, li { white-space: pre-wrap; } FM%1 - + Input%1 Wejście %1 - + English Angielski - + French Francuski - + Italian Włoski - + German Niemiecki - + Czech Czeski - + Slovak Słowacki - + Spanish Hiszpański - + Portuguese Portugalski - + Polish Polski - + Finnish Fiński - + No Nie - + RotEnc A Pokrętło :A - + Rot Enc B Pokrętło :B - + Rot Enc C Pokrętło :C - + Rot Enc D Pokrętło :D - + Rot Enc E Pokrętło :E @@ -5653,6 +7245,7 @@ p, li { white-space: pre-wrap; } + [I%1] [W%1] @@ -5973,133 +7566,133 @@ p, li { white-space: pre-wrap; } Pokrętło - + !Flight mode %1 !Faza lotu %1 - + Flight mode %1 Faza lotu %1 - + Yellow Żółty - + Orange Pomarańczowy - + Red Czerwony - + Winged Shadow How High - + Winged Shadow How High (not supported) Winged Shadow How High (nie obsługiwane) - + FrSky Sensor Hub Hub sensora FrSky - - + + None Żaden - + Imperial Imperialne - + Metric Metryczne - + Extra Fine Bardzo dokładne - + Fine Dokładne - + Medium Średni - + Coarse Gruby - + Exponential Eksponencjalny - + Count Up Licz - + Count Down Odliczaj - + %1:%2, - + : %1 Channels, %2usec Delay :Kanały %1, opóźnienie %2usX - + Flight modes(%1) Fazy lotu(%1) - + Flight mode(%1) Faza lotu (%1) - + Rudder SK - + Elevator SW - + Throttle Gaz - + Aileron Lotki @@ -6110,38 +7703,38 @@ p, li { white-space: pre-wrap; } - - + + --- - + Rud Trim Trymer SK - + Ele Trim Trymer SW - + Thr Trim Trymer gazu - + Ail Trim Trymer lotek - + Rot Enc Pokrętło - + Swedish Szwedzki @@ -6151,7 +7744,7 @@ p, li { white-space: pre-wrap; } - + CH%1 Kan %1 @@ -6295,46 +7888,46 @@ p, li { white-space: pre-wrap; } Zwiększanie - + Own value - Własny Wartość + Własna Wartość - + Flight mode %1 value Flight phase %1 value Wartość Fazy lotu FL%1 - + Keys Przyciski - + Sticks Drążki - + Keys + Sticks Przyciski i Drążki - + -GV%1 -ZG%1 - + GV%1 ZG%1 - + Simulator for this firmware is not yet available Nie jest dostępny symulator dla tego firmware @@ -6442,17 +8035,17 @@ Zespół OpenTX. RudderPage - + No Nie - + Yes Tak - + <br>Rudder Channel: <br> Kanał Steru Kierunku: @@ -6617,7 +8210,7 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również SimpleTailPage - + Elevator Channel: Kanał Steru Wysokości: @@ -6625,23 +8218,23 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również SimulatorDialog - - + + Warning Ostrzeżenie - + Joystick enabled but not configured correctly Joystick uaktywniony ale nieprawidłowo skonfigurowany - + Cannot open joystick, joystick disabled Nie mogę otworzyć joysticka, dezaktywowany - + Simulating Radio (%1) Symulacja Radia (%1) @@ -6650,7 +8243,7 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również Symulacja Tx (%1) - + Firmware %1 error: %2 Firmware %1 błąd: %2 @@ -6867,7 +8460,7 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również StandardPage - + Channel %1 Kanał %1 @@ -6875,12 +8468,12 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również TailPage - + Rudder Channel: Kanał Steru Kierunku: - + Elevator Channel: Kanał Steru Wysokości: @@ -6888,22 +8481,22 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również TailSelectionPage - + Elevator and Rudder Ster Wysokości i Ster Kierunku - + Only Elevator Tylko Ster Wysokości - + V-tail Usterzenie motylkowe - + Tail Type: Typ ogona: @@ -7340,17 +8933,17 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również ThrottlePage - + Yes Tak - + No Nie - + <br>Throttle Channel: <br>Kanał gazu: @@ -7418,12 +9011,12 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również VTailPage - + First Tail Channel: Pierwszy Kanał Ogona: - + Second Tail Channel: Drugi Kanał Ogona: @@ -7431,12 +9024,12 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również WingtypeSelectionPage - + Standard Wing Standardowe Skrzydło - + Flying Wing / Deltawing Latające skrzydło / Delta @@ -7614,36 +9207,46 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również + Model Options + Opcje Modelu + + + + Select additional options + Wybierz dodatkowe opcje + + + Save Changes Zapisz Zmiany - + Manually check the direction of each control surface and reverse any channels that make controls move in the wrong direction. Remove the propeller/propellers before you try to control your model for the first time.<br>Please note that continuing removes all old model settings! Ręcznie sprawdź kierunki działania płaszczyzn sterowych i zrewersuj kanał którego kontrola działa w nieprawidłowym kierunku. Zdemontuj śmigło(a) przed sprawdzeniem pierwszy rac Twojego modelu.<br> Uwaga: kontynuacja usunie stare ustawienia modelu! - + Enter a name for your model and select model type. Wprowadź nazwę modelu i typ. - + Select the receiver channel that is connected to your ESC or throttle servo.<br><br>Throttle - Spektrum: CH1, Futaba: CH3 Wybierz kanał odbiornika który kontroluje ESC/serwo gazu.<br><br>Gaz - Spektrum: Kn1, Futaba: Kn3 - + Most aircraft have a main wing and a tail with control surfaces. Flying wings and delta winged aircraft only have a single wing. The main control surface on a standard wing controls the roll of the aircraft. This surface is called an aileron.<br>The control surface of a delta wing controls both roll and pitch. This surface is called an elevon. Większość samolotów posiada powierzchnie sterowe na skrzydłach i ogonie. Latające skrzydło oraz delta posada tylko sterowanie na skrzydłach. Główne powierzchnie sterowe starndardowych skrzydeł powodują obórt samolotu w osi podłużnej. Są to lotki.<br> Powierzchnie sterowe na skrzydle w delcie i latającym skrzydle działają jako lotki i ster wysokości. Są to sterolotki. - + Models use one or two channels to control the ailerons.<br>A so called Y-cable can be used to connect a single receiver channel to two separate aileron servos. If your servos are connected by a Y-cable you should select the single-servo option.<br><br>Aileron - Spektrum: CH2, Futaba: CH1 Większość modelu używa jednego lub 2ch kanałów do sterowania lotkami.<br><br>Przez tzw. Y-kabel mogą być kontrolowane 2 serwa na jednym kanale. Jeśli używasz Y-kabla wybierz opcję z jednym serwem.<br><br> Lotki - Spektrum: Kan2, Futaba: Kan1 - + Models use one or two channels to control the elevons.<br>A so called Y-cable can be used to connect single a receiver channel to two separate elevon servos. If your servos are connected by a Y-cable you should select the single-servo option. Model używa jednego lub dwóch kanałów do kontrolowania sterolotek.<br>Przez tzw. Y-kabel mogą być kontrolowane 2 serwa na jednym kanale. Jeśli używasz Y-kabla wybierz opcję z jednym serwem. @@ -7656,12 +9259,12 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również Większość modelu używa jednego lub 2ch kanałów do sterowania lotkami.<br><br>Przez tzw. Y-kabel mogą być kontrolowane 2 serwa na jednym kanale. Jeśli używasz Y-kabla wybierz opcję z jednym serwem.<br><br> Lotki - Spektrum: Kn2, Futaba: Kn1 - + This wizard assumes that your flaps are controlled by a switch. If your flaps are controlled by a potentiometer you can change that manually later. Kreator uznaje że kontroluje klapy tylko przełącznikiem. Jeśli chcesz kontrolować klapy potencjometrem mozęsz zmienić to ręcznie pózniej. - + Air brakes are used to reduce the speed of advanced sail planes.<br>They are very uncommon on other types of planes. Hamulce aerodynamiczne są uzywane do zmniejszenia prędkości szybowca.<br> Sa bardzo rzadko używane w innych typach samolotów. @@ -7674,48 +9277,49 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również - + Select the receiver channel that is connected to your rudder.<br><br>Rudder - Spektrum: CH4, Futaba: CH4 Wybierz kanał odbiornika który kontroluje Ster Kierunku.<br><br>Ster Kierunku - Spektrum: Kn4, Futaba: Kn4 - + Select the tail type of your plane. Wybierz typ ogona Twojego modelu. - - + + Select the Rudder and Elevator channels.<br><br>Rudder - Spektrum: CH4, Futaba: CH4<br>Elevator - Spektrum: CH3, Futaba: CH2 Wybierz kanały sterów wysokości i kerunku.<br><br>Ster Kierunku - Spektrum: Kn4, Futaba: Kn4<br>Ster Wysokości - Spektrum: Kn3, Futaba: Kn2 - + Select the Elevator channel.<br><br>Elevator - Spektrum: CH3, Futaba: CH2 Wybierz kanał Steru wysokości.<br><br>Ster Wysokiości - Spektrum: Kn3, Futaba: Kn2 - - - - - - + + + + + + + TBD. TBD. - + Select the control channels for your multirotor.<br><br>Throttle - Spektrum: CH1, Futaba: CH3<br>Yaw - Spektrum: CH4, Futaba: CH4<br>Pitch - Spektrum: CH3, Futaba: CH2<br>Roll - Spektrum: CH2, Futaba: CH1 Wybierz kanały kotroli Twojego wielowirnikowca.<br><br>Gaz - Spektrum: Kn1, Futaba: Kn3<br>>Odchylenie - Spektrum: Kn4, Futaba: Kn4<br>Kąt - Spektrum: Kn3, Futaba: Kn2<br>Rotacja - Spektrum: Kn2, Futaba: Kn1 - + There is no help available for the current page. Brak pomocy dla aktualnej strony. - + Model Wizard Help Pomoc kreatora modelu @@ -7723,17 +9327,22 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również WizardPrinter - + Model Name: Nazwa Modelu: - + Model Type: Typ Modelu: - + + Options: + Opcje: + + + Channel %1: Kanał %1: @@ -7741,149 +9350,96 @@ Wolne obroty będą na górze, trymer i ostrzeżenie o otwartym gazie również appPreferencesDialog - Simulator capture folder - Katalog zapisu symulatora + Katalog zapisu symulatora - Remember simulator switch values - Zapamiętaj ustawienia przełączników w symulatorze + Zapamiętaj ustawienia przełączników w symulatorze - - - - Open Folder - Otwórz katalog + Otwórz katalog General Settings Label Główne ustawienia nagłowek - User Splash Screens - Użyj ekranu powitalnego + Użyj ekranu powitalnego - Edit Settings - Edycja Ustawień + Edycja Ustawień - <html><head/><body><p>Channel order</p><p><br/></p><p>Defines the order of the default mixes created on a new model.</p></body></html> - <html><head/><body><p>Kolejność kanałów</p><p><br/></p><p>Definiuje kolejność standardowych mikserów dla nowego modelu.</p></body></html> + <html><head/><body><p>Kolejność kanałów</p><p><br/></p><p>Definiuje kolejność standardowych mikserów dla nowego modelu.</p></body></html> - Default Channel Order - Bazowa kolejność kanałów + Bazowa kolejność kanałów - General Settings - Główne ustawienia + Główne ustawienia - Application Settings - Ustawienia Aplikacji + Ustawienia Aplikacji - Only show user splash images - Pokaż tylko ekrany powitalne użytkownika + Pokaż tylko ekrany powitalne użytkownika - Show user and companion splash images - Pokaż ekrany powitalne użytkownika i Companion + Pokaż ekrany powitalne użytkownika i Companion - Use model wizard when creating a new model - Użyj konfiguratora nowych modeli do stworzenia modelu + Użyj konfiguratora nowych modeli do stworzenia modelu - Simulator Settings - Ustawienia Symulatora + Ustawienia Symulatora - Blue - Niebieskie + Niebieskie - Green - Zielone + Zielone - Red - Czerwone + Czerwone - Orange - Pomarańczowe + Pomarańczowe - Yellow - Żółte + Żółte - - Mode selection: - -Mode 1: - Left stick: Elevator, Rudder - Right stick: Throttle, Aileron - -Mode 2: - Left stick: Throttle, Rudder - Right stick: Elevator, Aileron - -Mode 3: - Left stick: Elevator, Aileron - Right stick: Throttle, Rudder - -Mode 4: - Left stick: Throttle, Aileron - Right stick: Elevator, Rudder - - - - - - Radio Profile - Profil radia + Profil radia - Mode 1 (RUD ELE THR AIL) - Mod 1 (SK.SW.Gaz.Lot) + Mod 1 (SK.SW.Gaz.Lot) - Mode 2 (RUD THR ELE AIL) - Mod 2 (SK.Gaz.SW.Lot) + Mod 2 (SK.Gaz.SW.Lot) - - Mode 3 (AIL ELE THR RUD) - - - - Mode 4 (AIL THR ELE RUD) - Mod 4 (Lot.Gaz.SW.SK) + Mod 4 (Lot.Gaz.SW.SK) Channel order @@ -7894,354 +9450,280 @@ This is used by the templated to determine which channel goes to what number out To ustawienie jest używane przez szablony, określa jakie wyjście przypisane jest do kanału. - R E T A - K W G L + K W G L - R E A T - K W L G + K W L G - - R T E A - - - - R T A E - K G L W + K G L W - R A E T - K L W G + K L W G - R A T E - K L G W + K L G W - E R T A - W K G L + W K G L - E R A T - W K L G + W K L G - E T R A - W G K L + W G K L - E T A R - W G L K + W G L K - E A R T - W L K G + W L K G - E A T R - W L G K + W L G K - T R E A - G K W L + G K W L - T R A E - G K L W + G K L W - T E R A - G W K L + G W K L - T E A R - G W L K + G W L K - T A R E - G L K W + G L K W - T A E R - G L W K + G L W K - A R E T - L K W G + L K W G - A R T E - L R G W + L R G W - A E R T - L W K G + L W K G - A E T R - L W G K + L W G K - A T R E - L G K W + L G K W - A T E R - L G W K + L G W K - Default Stick Mode - Bazowy mod drążków + Bazowy mod drążków - Splash Screen - Ekran startowy + Ekran startowy Channel Order Kolejność kanałów - Append version number to FW file name - Dodaj numer Firmware do nazwy pliku + Dodaj numer Firmware do nazwy pliku - SD Structure path - Struktura karty SD + Struktura karty SD - 9X - 9X + 9X - 9X with m128 - 9X z m128 + 9X z m128 - 9XR - 9XR + 9XR - 9XR with m128 - 9XR z m128 + 9XR z m128 - Gruvin9x Board - Płyta Gruvin9x + Płyta Gruvin9x - Sky9x Board - Płyta Sky9x + Płyta Sky9x - Taranis - Taranis + Taranis - Select Image - Wybierz obrazek + Wybierz obrazek - Offer to write FW to Tx after download - Zaproponuj zapisanie FirmWare do radia po pobraniu + Zaproponuj zapisanie FirmWare do radia po pobraniu - Profile Name - Nazwa profilu + Nazwa profilu - Remove Profile - Usuń Profil + Usuń Profil - Radio Type - Typ Radia + Typ Radia - Clear Image - Wyczyść obrazek + Wyczyść obrazek - Splash Screen Library - Biblioteka ekranół powitalnych + Biblioteka ekranół powitalnych - Files to keep - Pkili to zapamiętania + Pkili to zapamiętania - Simulator BackLight - Podświetlenie symularota + Podświetlenie symularota - Automatic Backup Folder - Automatyczny Katalog Backupów + Automatyczny Katalog Backupów - Only capture to clipboard - Przechwyć tylko do schowka + Przechwyć tylko do schowka - Joystick - Joystick + Joystick - Find Executable - Znajdź plik wykonywalny + Znajdź plik wykonywalny - Google Earth Executable - Plik wykonywalny Google Earth + Plik wykonywalny Google Earth - Calibrate - Kalibracja + Kalibracja - Enable - Aktywowany + Aktywowany - Show splash screen when Companion starts - Pokaz ekran startowy przy uruchamianiu Companion + Pokaz ekran startowy przy uruchamianiu Companion - Automatic check for OpenTX firmware updates - Automatycznie sprawdź aktualizacje firmware OpenTX + Automatycznie sprawdź aktualizacje firmware OpenTX - Automatic check for Companion updates - Automatycznie sprawdź aktualizacje Companion + Automatycznie sprawdź aktualizacje Companion - Enable automatic backup before writing firmware - Uaktywnij automatyczny backup przed zapisem firmware + Uaktywnij automatyczny backup przed zapisem firmware - My Radio - Moje Radio + Moje Radio - Select your snapshot folder - Katalog zrzutów + Katalog zrzutów - - No joysticks found - Brak oysticka + Brak oysticka - EMPTY: No radio settings stored in profile - PUSTY:Brak ustawień radia w profilu + PUSTY:Brak ustawień radia w profilu - AVAILABLE: Radio settings of unknown age - DOSTĘPNY:Nieznany wiek ustawień radia + DOSTĘPNY:Nieznany wiek ustawień radia - AVAILABLE: Radio settings stored %1 - DOSTĘPNY:Zapamietane ustawienai radia %1 + DOSTĘPNY:Zapamietane ustawienai radia %1 - Select your library folder - Wybierz katalog bibliteki + Wybierz katalog bibliteki - Select your Models and Settings backup folder - Wybierz folder do backupowania Modeli i Ustawień + Wybierz folder do backupowania Modeli i Ustawień - Select Google Earth executable - Wybierz wykonywalny plik Google Earth + Wybierz wykonywalny plik Google Earth - Select the folder replicating your SD structure - Wybierz folder do zreplikowania struktury Twojej karty SD + Wybierz folder do zreplikowania struktury Twojej karty SD - Not possible to remove profile - Usunięcie profilu jest niemożliwe + Usunięcie profilu jest niemożliwe - The default profile can not be removed. - Podstawowy profil nie moze być usunięty. + Podstawowy profil nie moze być usunięty. - Open Image to load - Otwórz obrazek do załadowania + Otwórz obrazek do załadowania - Images (%1) - Obrazki (%1) + Obrazki (%1) @@ -8906,525 +10388,310 @@ m2560 dla platformy V4 compareDialog - Compare Models - Porównaj modele + Porównaj modele - Drag first model here - Przeciągnij tutaj pierwszy model + Przeciągnij tutaj pierwszy model - Drag second model here - Przeciągnij tutaj drugi model + Przeciągnij tutaj drugi model - Close - Zamknij + Zamknij - Print - Drukuj + Drukuj - Print to file - Drukuj do pliku + Drukuj do pliku - General Model Settings - Główne ustawienia modelu + Główne ustawienia modelu - - - Name - Nazwa + Nazwa - - EEprom Size - Wielkość EEPROM + Wielkość EEPROM - - - Timer1 - - - - - - Timer2 - - - - - Protocol - Protokół + Protokół - - Pulse Polarity - Polaryzacja impulsu + Polaryzacja impulsu - - Throttle Trim - Trymer gazu + Trymer gazu - - - - Enabled - Włączone + Włączone - - - - Disabled - Wyłączone + Wyłączone - - Throttle Expo - Expo gazu + Expo gazu - - Trim Increment - Krok trymera + Krok trymera - - Center Beep - Dźwięk centrowania + Dźwięk centrowania - Flight modes Settings Flight Phases Settings - Ustawiania faz lotu + Ustawiania faz lotu - - Fades - Przejścia + Przejścia - - Trims - Trymery + Trymery - - - - - - - - Switch - Przełącznik + Przełącznik - - IN - (+) + (+) - - OUT - (-) + (-) - - - - - - - - - - FM FP - FL + FL - - Gvars - Gl-Zm + Gl-Zm - - Rot. Enc. - Pokrętło. + Pokrętło. - Limits - Limity + Limity - - - - - - - Offset - Ofset + Ofset - - - - - - Min - - - - - - - - Max - Maks + Maks - - - Invert - Odwróć + Odwróć - - - - - CH - Kanał + Kanał - - INV - Odwr + Odwr - - NOR - --- + --- - Global Variables - Zmienne globalne + Zmienne globalne - - GV - ZG + ZG - Expo/Dr Settings - Expo/Ustawienia DR + Expo/Ustawienia DR - - Weight - Waga + Waga - 5 Point Curves - 5-cio punktowe Krzywe + 5-cio punktowe Krzywe - - Curve - Krzywa + Krzywa - Mixers - Miksery + Miksery - - noTrim - Bez trymera + Bez trymera - - Delay(u%1:d%2) - Opóźnienie(u%1:d%2) + Opóźnienie(u%1:d%2) - - Slow(u%1:d%2) - Spowolnienie(u%1:d%2) + Spowolnienie(u%1:d%2) - - Warn - Ostrzeżenie + Ostrzeżenie - - No name - Model bez nazwy + Model bez nazwy - - - - DISABLED - Wyłączone + Wyłączone - Curves - Krzywe + Krzywe 5 Points Curves 5-cio punktowe Krzywe - - - - pt %1 - punkt %1 + punkt %1 9 Points Curves 9-cio punktowe Krzywe - Special Functions - Funkcje Specjalne + Funkcje Specjalne - - Function - Funkcja + Funkcja - - Param - Parametr + Parametr - - Enable - Włączone + Włączone - SF - SF + SF - Telemetry Settings - Ustawienia telemetrii + Ustawienia telemetrii - - Analog - Analogowy + Analogowy - - Unit - Jednostki + Jednostki - - Scale - Skala + Skala - - - - - A%1 - - - - - - Alarm 1 - - - - - - Alarm 2 - - - - - - - Type - Typ + Typ - - - - Condition - Warunek + Warunek - - - - Value - Wartość + Wartość - - - - Flight mode name - Nazwa fazy lotu + Nazwa fazy lotu - - - - Flight modes - Fazy lotu + Fazy lotu - - - - Flight mode - Faza lotu + Faza lotu - 9 Point Curves - 9-cio punktowe Krzywe + 9-cio punktowe Krzywe - - Repeat - Powtórz + Powtórz - - RSSI Alarm - Alarm RSSI + Alarm RSSI - - Telemetry Bars - Wskaźniki telemetryczne + Wskaźniki telemetryczne - - Bar Number - Numer wskaźnika + Numer wskaźnika - - Source - Źródło + Źródło - - Custom Telemetry View - Własny ekran telemetrii + Własny ekran telemetrii - Logical Switches - Przełączniki Logiczne + Przełączniki Logiczne - - LS - L suwak + L suwak - Print Document - Drukuj dokument + Drukuj dokument - Select PDF output file - Wybierz plik docelowy PDF + Wybierz plik docelowy PDF @@ -9761,79 +11028,66 @@ p, li { white-space: pre-wrap; } fwPreferencesDialog - Downloads - Pobrania + Pobrania CheckBox CheckBox - Set language of voice. May be different from firmware language - Ustaw język komuniaktów głosowych (). + Ustaw język komuniaktów głosowych (). Moze być inny od języka firmware - Processor ID - ID procesora + ID procesora - Options - Opcje + Opcje - Menu Language - Język Menu + Język Menu - Voice Language - Język komunikatów + Język komunikatów - Firmware Type - TYp Firmware + TYp Firmware - Download Voice - Pobierz Głos + Pobierz Głos FwInfo Informacje o Firmware - Download FW - Pobiesz Firmware + Pobiesz Firmware - Check for updates - Sprawdź aktualizacje + Sprawdź aktualizacje - Last downloaded release: %1 - Ostatnie pobrane wydanie: %1 + Ostatnie pobrane wydanie: %1 - The selected firmware has never been downloaded by Companion. - Wybrany firmware nie został nigdy pobrany przez Companion. + Wybrany firmware nie został nigdy pobrany przez Companion. - The selected firmware cannot be downloaded by Companion. - Companion nie moze pobrac wybranego firmware. + Companion nie moze pobrac wybranego firmware. @@ -10627,445 +11881,302 @@ Mode 4: printDialog - Close - Zamknij + Zamknij - Print - Drukuj + Drukuj - Print to file - Drukuj do pliku + Drukuj do pliku - Setup for: - Ustawianie: + Ustawianie: - printed on: %1 - Wydrukowanno na: %1 + Wydrukowanno na: %1 - General Model Settings - Główne ustawienia modelu + Główne ustawienia modelu - - - - Name - Nazwa + Nazwa - EEprom Size - Rozmiar EEPROM + Rozmiar EEPROM - - Timer1 - - - - - Timer2 - - - - Protocol - Protokół + Protokół - Pulse Polarity - Polaryzacja pulsu + Polaryzacja pulsu - Throttle Trim - Trymer gazu + Trymer gazu - - - Enabled - Włączone + Włączone - - Disabled - Wyłaczone + Wyłaczone - Throttle Expo - Expo gazu + Expo gazu - Trim Increment - Krok trymera + Krok trymera - Center Beep - Sygnał centrowania + Sygnał centrowania - Flight modes Settings Flight Phases Settings - Uztawienie faz lotu + Uztawienie faz lotu - Fades - Przejścia + Przejścia - Trims - Trymery + Trymery - Gvars - Zmienne globalne + Zmienne globalne - Rot.Enc. - Pokrętło. + Pokrętło. - - - - Switch - Przełącznik + Przełącznik - Logical Switches - Przełączniki Logiczne + Przełączniki Logiczne - - LS - PL + PL - IN - (+) + (+) - OUT - (-) + (-) - - - - FM FP - LR + LR - Expo/Dr Settings - Ustawienia Expo/DR + Ustawienia Expo/DR - Weight - Vaga + Vaga - - - Curve - Krzywa + Krzywa - Mixers - Miksery + Miksery - - - - CH - Kanał + Kanał - noTrim - Bez trimu + Bez trimu - - - - - Offset - Ofset + Ofset - Delay(u%1:d%2) - Opóżnienie(u%1:d%2) + Opóżnienie(u%1:d%2) - Slow(u%1:d%2) - Spowolnienie(u%1:d%2) + Spowolnienie(u%1:d%2) - Warn - Ostrzeżenie + Ostrzeżenie - - DISABLED - Wyłączone + Wyłączone - Limits - Limity + Limity - - - - - Min - - - - - - - Max - Maks + Maks - - - Invert - Odwrócenie + Odwrócenie - - - INV - Odwr + Odwr - - - NOR - --- + --- - Curves - Krzywe + Krzywe - pt %1 - pkt %1 + pkt %1 - Global Variables - Zmienne globalne + Zmienne globalne - GV - GZ + GZ - - - - Value - Wartość + Wartość - Function - Funkcja + Funkcja - Special Functions - Funkcje Specjalne + Funkcje Specjalne - Parameter - Parametr + Parametr - Repeat - Powtórz + Powtórz - Telemetry Settings - Ustawienia telemetrii + Ustawienia telemetrii - - Alarm 1 - Alarm 1 + Alarm 1 - - Alarm 2 - Alarm 2 + Alarm 2 - Analog - Analog + Analog - Unit - Jednostki + Jednostki - Scale - Skala + Skala - - - - Type - Typ + Typ - - - - Condition - Warunek + Warunek - - A%1 - - - - RSSI Alarm - Alarm RSSI + Alarm RSSI - Frsky serial protocol - Protokół szeregowy Frsky + Protokół szeregowy Frsky - System of units - System jednostek + System jednostek - Telemetry Bars - Belki telemetrii + Belki telemetrii - Bar Number - Numer belki + Numer belki - Source - Źródło + Źródło - ODF files (*.odt);;PDF Files(*.pdf);;HTML-Files (*.htm *.html);;All Files (*) - pliki ODF (*.odt);;pliki PDF (*.pdf);;pliki HTML (*.htm *.html);;Wszystkie pliki (*) + pliki ODF (*.odt);;pliki PDF (*.pdf);;pliki HTML (*.htm *.html);;Wszystkie pliki (*) - - Custom Telemetry View - Widok telemetrii użytkownika + Widok telemetrii użytkownika - Flight mode name - Nazwa trybu lotu + Nazwa trybu lotu - - Flight modes - Tryby lotu + Tryby lotu - - Flight mode - Tryb lotu + Tryb lotu - Blades - Łopaty + Łopaty - Print Document - Drukuj dokument + Drukuj dokument - Select PDF output file - Wybierz docelowy plik PDF + Wybierz docelowy plik PDF diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index b60eeea7e..38cdb197e 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -715,8 +715,8 @@ #define TR_PATH_TOO_LONG "Ścieżka za długa" #define TR_VIEW_TEXT "Pokaż tekst" #define TR_FLASH_BOOTLOADER "Flash BootLoader" -#define TR_WRITING "\032Writing..." -#define TR_CONFIRM_FORMAT "Confirm Format?" +#define TR_WRITING "\032Zapis... " +#define TR_CONFIRM_FORMAT "Zatwierdź Format?" #define TR_INTERNALRF "Wewnętrzny moduł RF" #define TR_EXTERNALRF "Zewnętrzny moduł RF" #define TR_FAILSAFE "Tryb Failsafe" From 8787dd05cd98fe5271411c12e2cfcccc2d692e9c Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sun, 4 May 2014 10:37:49 +0200 Subject: [PATCH 36/79] Many improvements of print dialog. Some minor changes in mixes and inputs formatting. --- companion/src/eeprominterface.cpp | 32 ++-- companion/src/helpers.h | 2 + companion/src/modeledit/inputs.cpp | 22 +-- companion/src/modeledit/mixes.cpp | 9 +- companion/src/printdialog.cpp | 277 +++++++++++++---------------- companion/src/printdialog.h | 2 + 6 files changed, 163 insertions(+), 181 deletions(-) diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 5c3f6ff40..d927be13d 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -507,36 +507,43 @@ QString LogicalSwitchData::toString(const ModelData & model) } switch (getFunctionFamily()) { case LS_FAMILY_STAY: - result = QObject::tr("STAY(%1, [%2:%3])").arg(RawSwitch(val1).toString()).arg(ValToTim(val2)).arg(ValToTim(val2+val3)); + result = QObject::tr("STAY( %1, [%2:%3])").arg(RawSwitch(val1).toString()).arg(ValToTim(val2)).arg(ValToTim(val2+val3)); break; case LS_FAMILY_STICKY: - result = QObject::tr("STICKY(%1, %2)").arg(RawSwitch(val1).toString()).arg(RawSwitch(val2).toString()); + result = QObject::tr("STICKY( %1, %2)").arg(RawSwitch(val1).toString()).arg(RawSwitch(val2).toString()); break; case LS_FAMILY_TIMER: - result = QObject::tr("TIMER(%1, %2)").arg(ValToTim(val1)).arg(ValToTim(val2)); + result = QObject::tr("TIMER( %1, %2)").arg(ValToTim(val1)).arg(ValToTim(val2)); break; case LS_FAMILY_VOFS: { RawSource source = RawSource(val1, &model); RawSourceRange range = source.getRange(); + QString res; if (val1) - result += source.toString(); + res += source.toString(); else - result += "0"; - result.remove(" "); + res += "0"; + res.remove(" "); if (func == LS_FN_APOS || func == LS_FN_ANEG) - result = "|" + result + "|"; + res = "|" + res + "|"; else if (func == LS_FN_DAPOS) - result = "|d(" + result + ")|"; - else if (func == LS_FN_DPOS) result = "d(" + result + ")"; + res = "|d(" + res + ")|"; + else if (func == LS_FN_DPOS) result = "d(" + res + ")"; + result += res; + if (func == LS_FN_APOS || func == LS_FN_VPOS || func == LS_FN_DAPOS || func == LS_FN_DPOS) result += " > "; else if (func == LS_FN_ANEG || func == LS_FN_VNEG) result += " < "; + else if (func == LS_FN_VALMOSTEQUAL) + result += " ~ "; + else + result += " missing"; result += QString::number(range.step * (val2 /*TODO+ source.getRawOffset(model)*/) + range.offset); break; } case LS_FAMILY_VBOOL: - result = RawSwitch(val1).toString(); + result += RawSwitch(val1).toString(); switch (func) { case LS_FN_AND: result += " AND "; @@ -547,7 +554,8 @@ QString LogicalSwitchData::toString(const ModelData & model) case LS_FN_XOR: result += " XOR "; break; - default: + default: + result += " bar "; break; } result += RawSwitch(val2).toString(); @@ -560,6 +568,7 @@ QString LogicalSwitchData::toString(const ModelData & model) result += "0"; switch (func) { case LS_FN_EQUAL: + case LS_FN_VEQUAL: result += " = "; break; case LS_FN_NEQUAL: @@ -578,6 +587,7 @@ QString LogicalSwitchData::toString(const ModelData & model) result += " <= "; break; default: + result += " foo "; break; } if (val2) diff --git a/companion/src/helpers.h b/companion/src/helpers.h index ceb3a2e22..82a775395 100644 --- a/companion/src/helpers.h +++ b/companion/src/helpers.h @@ -37,6 +37,8 @@ class CompanionIcon: public QIcon { CompanionIcon(QString baseimage); }; +bool gvarsEnabled(); + class GVarGroup : public QObject { Q_OBJECT diff --git a/companion/src/modeledit/inputs.cpp b/companion/src/modeledit/inputs.cpp index 9c7d8d5f3..2b7a7b9e7 100644 --- a/companion/src/modeledit/inputs.cpp +++ b/companion/src/modeledit/inputs.cpp @@ -155,16 +155,6 @@ QString InputsPanel::getInputText(int dest, bool * new_ch) str = " "; } - if (firmware->getCapability(VirtualInputs)) { - str += " " + tr("Source(%1)").arg(md->srcRaw.toString()); - if (md->carryTrim>0) { - str += " " + tr("No Trim"); - } - else if (md->carryTrim<0) { - str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString(); - } - } - switch (md->mode) { case (1): str += " <-"; break; case (2): str += " ->"; break; @@ -173,7 +163,17 @@ QString InputsPanel::getInputText(int dest, bool * new_ch) str += " " + tr("Weight(%1)").arg(getGVarString(md->weight)); - if (md->curve.value) str += " " + md->curve.toString(); + if (firmware->getCapability(VirtualInputs)) { + str += " " + tr("Source(%1)").arg(md->srcRaw.toString()); + if (md->carryTrim>0) { + str += " " + tr("NoTrim"); + } + else if (md->carryTrim<0) { + str += " " + RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString(); + } + } + + if (md->curve.value) str += " " + Qt::escape(md->curve.toString()); QString phasesStr = getPhasesStr(md->phases, model); if (!phasesStr.isEmpty()) str += " " + phasesStr; diff --git a/companion/src/modeledit/mixes.cpp b/companion/src/modeledit/mixes.cpp index 7b01d83e6..57b59c927 100644 --- a/companion/src/modeledit/mixes.cpp +++ b/companion/src/modeledit/mixes.cpp @@ -191,11 +191,8 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch) str += " " + Qt::escape(tr("Switch(%1)").arg(md->swtch.toString())); } - if (md->carryTrim>0) { - str += " " + Qt::escape(tr("No Trim")); - } - else if (md->carryTrim<0) { - str += " " + Qt::escape(RawSource(SOURCE_TYPE_TRIM, (-(md->carryTrim)-1)).toString()); + if (md->carryTrim) { + str += " " + Qt::escape(tr("NoTrim")); } if (md->noExpo) str += " " + Qt::escape(tr("No DR/Expo")); @@ -214,7 +211,7 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch) QString MixerName; MixerName.append(md->name); if (!MixerName.isEmpty()) { - str += Qt::escape(QString("(%1)").arg(MixerName)); + str += " " + Qt::escape(QString("(%1)").arg(MixerName)); } } } diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index a6e6177e0..9c15efcee 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -20,51 +20,47 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS g_eeGeneral(gg), g_model(gm), printfilename(filename), - ui(new Ui::PrintDialog) + ui(new Ui::PrintDialog), + gvars(gvarsEnabled()), + gvarnum (0) { - ui->setupUi(this); - this->setWindowIcon(CompanionIcon("print.png")); - te = ui->textEdit; + if (gvars) { + gvarnum=firmware->getCapability(Gvars); + } - setWindowTitle(tr("Setup for: ") + g_model->name); - ui->textEdit->clear(); - QString modelname=g_model->name; - if (modelname.isEmpty()) { - curvefile5=QString("%1/curve5.png").arg(qd->tempPath()); - curvefile9=QString("%1/curve9.png").arg(qd->tempPath()); - } - else { - curvefile5=QString("%1/%2-curve5.png").arg(qd->tempPath()).arg(modelname); - curvefile9=QString("%1/%2-curve9.png").arg(qd->tempPath()).arg(modelname); - } - printSetup(); - int gvars=0; - if (firmware->getCapability(HasVariants)) { - if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) { - gvars=1; - } - } - else { - gvars=1; - } - - if (gvars) { - te->append(printPhases()+"
"); - } - printExpo(); - printMixes(); - printLimits(); - printCurves(); - printGvars(); - printSwitches(); - printFSwitches(); - printFrSky(); - - te->scrollToAnchor("1"); - if (!printfilename.isEmpty()) { - printToFile(); - QTimer::singleShot(0, this, SLOT(autoClose())); - } + ui->setupUi(this); + this->setWindowIcon(CompanionIcon("print.png")); + te = ui->textEdit; + + setWindowTitle(tr("Setup for: ") + g_model->name); + te->clear(); + QString modelname=g_model->name; + if (modelname.isEmpty()) { + curvefile5=QString("%1/curve5.png").arg(qd->tempPath()); + curvefile9=QString("%1/curve9.png").arg(qd->tempPath()); + } + else { + curvefile5=QString("%1/%2-curve5.png").arg(qd->tempPath()).arg(modelname); + curvefile9=QString("%1/%2-curve9.png").arg(qd->tempPath()).arg(modelname); + } + printSetup(); + if (gvars) { + te->append(printPhases()+"
"); + } + printExpo(); + printMixes(); + printLimits(); + printCurves(); + printGvars(); + printSwitches(); + printFSwitches(); + printFrSky(); + + te->scrollToAnchor("1"); + if (!printfilename.isEmpty()) { + printToFile(); + QTimer::singleShot(0, this, SLOT(autoClose())); + } } void PrintDialog::closeEvent(QCloseEvent *event) @@ -115,16 +111,8 @@ QString PrintDialog::fv(const QString name, const QString value) void PrintDialog::printSetup() { - int gvars=0; - if (firmware->getCapability(HasVariants)) { - if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) { - gvars=1; - } - } else { - gvars=1; - } QString str = ""; - str.append(QString(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + FrSkyData *fd=&g_model->frsky; + for (int i=0; i<2; i++) { + if (fd->channels[i].ratio!=0) { + tc++; + float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + } + } + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append("
"; +} + +QString doTR(const QString s, const QString color="", bool bold=false) +{ + QString str = s; + if(bold) str = "" + str + ""; + if(!color.isEmpty()) str = "" + str + ""; + return ""; +} + +QString doTL(const QString s, const QString color="", bool bold=false) +{ + QString str = s; + if(bold) str = "" + str + ""; + if(!color.isEmpty()) str = "" + str + ""; + return ""; +} + +QString PrintDialog::fv(const QString name, const QString value) +{ + return "" + name + ": " + value + "
"; +} + +void PrintDialog::printSetup() +{ + QString str = "

").arg((firmware->getCapability(FlightPhases) && gvars==0) ? 2 : 1)); + str.append(QString("

"); str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - FrSkyData *fd=&g_model->frsky; - for (int i=0; i<2; i++) { - if (fd->channels[i].ratio!=0) { - tc++; - float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - } - } - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append("

").arg((firmware->getCapability(FlightPhases) && !gvars) ? 2 : 1)); str.append(g_model->name); str.append(" ("); str.append(firmware->getEepromInterface()->getName()); @@ -132,7 +120,7 @@ void PrintDialog::printSetup() str.append("

"+tr("General Model Settings")+"

"); str.append(fv(tr("Name"), g_model->name)); - str.append(""+tr("EEprom Size")+QString(": %1
").arg(firmware->getEepromInterface()->getSize(*g_model))); + str.append(fv(tr("EEprom Size"), QString("%1").arg(firmware->getEepromInterface()->getSize(*g_model)))); str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay, @@ -154,17 +142,8 @@ void PrintDialog::printSetup() QString PrintDialog::printPhases() { - int gvars=0; - int gvarnum=0; - if ((GetCurrentFirmwareVariant() & GVARS_VARIANT ) || (!firmware->getCapability(HasVariants) && firmware->getCapability(Gvars))) { - if (firmware->getCapability(GvarsFlightPhases)) { - gvars=1; - gvarnum=firmware->getCapability(Gvars); - } - } - QString str=""; - str.append(QString(""); From 77bafb53646f849f9cfde40142f527401eed0a8a Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Mon, 5 May 2014 22:41:33 +0200 Subject: [PATCH 62/79] Converted CR back to CRLF. SmartGit did this to me previously when merging. --- companion/src/printdialog.cpp | 1746 ++++++++++++++++----------------- 1 file changed, 873 insertions(+), 873 deletions(-) diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index 70c65bbe3..a7f0cd72e 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -1,873 +1,873 @@ -#include "printdialog.h" -#include "ui_printdialog.h" -#include "helpers.h" -#include "eeprominterface.h" -#include -#include -#include -#include - -#if !defined WIN32 && defined __GNUC__ -#include -#endif - -#define ISIZE 200 // curve image size -#define ISIZEW 400 // curve image size - -PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralSettings *gg, ModelData *gm, QString filename) : - QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), - firmware(firmware), - g_eeGeneral(gg), - g_model(gm), - printfilename(filename), - ui(new Ui::PrintDialog), - gvars(gvarsEnabled()), - gvarnum (0) -{ - if (gvars) { - gvarnum=firmware->getCapability(Gvars); - } - - ui->setupUi(this); - this->setWindowIcon(CompanionIcon("print.png")); - te = ui->textEdit; - - setWindowTitle(tr("Setup for: ") + g_model->name); - te->clear(); - QString modelname=g_model->name; - if (modelname.isEmpty()) { - curvefile5=QString("%1/curve5.png").arg(qd->tempPath()); - curvefile9=QString("%1/curve9.png").arg(qd->tempPath()); - } - else { - curvefile5=QString("%1/%2-curve5.png").arg(qd->tempPath()).arg(modelname); - curvefile9=QString("%1/%2-curve9.png").arg(qd->tempPath()).arg(modelname); - } - printSetup(); - if (gvars) { - te->append(printFlightModes()+"
"); - } - printInputs(); - printMixes(); - printLimits(); - printCurves(); - printGvars(); - printSwitches(); - printFSwitches(); - printFrSky(); - - te->scrollToAnchor("1"); - if (!printfilename.isEmpty()) { - printToFile(); - QTimer::singleShot(0, this, SLOT(autoClose())); - } -} - -void PrintDialog::closeEvent(QCloseEvent *event) -{ - if (printfilename.isEmpty()) { - QByteArray ba = curvefile5.toLatin1(); - char *name = ba.data(); - unlink(name); - ba = curvefile9.toLatin1(); - name = ba.data(); - unlink(name); - } -} - -PrintDialog::~PrintDialog() -{ - delete ui; -} - -QString doTC(const QString s, const QString color="", bool bold=false) -{ - QString str = s; - if(bold) str = "" + str + ""; - if(!color.isEmpty()) str = "" + str + ""; - return "
"; -} - -QString doTR(const QString s, const QString color="", bool bold=false) -{ - QString str = s; - if(bold) str = "" + str + ""; - if(!color.isEmpty()) str = "" + str + ""; - return ""; -} - -QString doTL(const QString s, const QString color="", bool bold=false) -{ - QString str = s; - if(bold) str = "" + str + ""; - if(!color.isEmpty()) str = "" + str + ""; - return ""; -} - -QString PrintDialog::fv(const QString name, const QString value) -{ - return "" + name + ": " + value + "
"; -} - -void PrintDialog::printSetup() -{ - QString str = "

").arg(gvars==0 ? 8+firmware->getCapability(RotaryEncoders) : 8+gvarnum+firmware->getCapability(RotaryEncoders))); + str.append(QString(""); @@ -175,14 +154,14 @@ QString PrintDialog::printPhases() if (firmware->getCapability(RotaryEncoders)) { str.append(QString(""); } - str.append(""); + str.append(""); for (int i=0; i<4; i++) { - str.append(QString("").arg(getInputStr(*g_model, i))); + str.append(QString("").arg(getInputStr(*g_model, i))); } - if (gvars==1) { - for (int i=0; iGV%1
%2").arg(i+1).arg(g_model->gvars_names[i])); + if (gvars) { + for (unsigned int i=0; iGV%1
%2").arg(i+1).arg(g_model->gvars_names[i])); } } for (int i=0; igetCapability(RotaryEncoders); i++) { @@ -191,23 +170,24 @@ QString PrintDialog::printPhases() str.append("
"); for (int i=0; igetCapability(FlightPhases); i++) { PhaseData *pd=&g_model->phaseData[i]; - str.append("").arg(i).arg(pd->name).arg(pd->fadeIn).arg(pd->fadeOut)); + str.append("").arg(i).arg(pd->name).arg(pd->fadeIn).arg(pd->fadeOut)); for (int k=0; k<4; k++) { + //TODO trim values if (pd->trimRef[k]==-1) { - str.append(QString("").arg(pd->trim[k])); + str.append(QString("").arg(pd->trim[k])); } else { - str.append("").arg(pd->trimRef[k])); + str.append("").arg(pd->trimRef[k])); } } - if (gvars==1) { - for (int k=0; kgvars[k]<=1024) { - str.append(QString(""); + str.append(QString(""); } else { int num = pd->gvars[k] - 1025; if (num>=i) num++; - str.append("").arg(num)); + str.append("").arg(num)); } } } @@ -231,7 +211,7 @@ QString PrintDialog::printPhases() void PrintDialog::printExpo() { QString str = "

").arg(!gvars ? 8+firmware->getCapability(RotaryEncoders) : 8+gvarnum+firmware->getCapability(RotaryEncoders))); str.append(tr("Flight modes Settings")); str.append("

 "); str.append(tr("Fades")+"").arg(firmware->getCapability(RotaryEncoders))+tr("Rot.Enc.")+""+tr("Switch")+"
"+tr("Flight mode name")); - str.append(""+tr("IN")+""+tr("OUT")+""+tr("Switch")+"
"+tr("Flight mode name")); + str.append(""+tr("IN")+""+tr("OUT")+"%1%1
"+tr("FM")+QString("%1 %2%3%4
"+tr("FM")+QString("%1 %2%3%4%1%1"+tr("FM")+QString("%1"+tr("FM")+QString("%1%1").arg(pd->gvars[k])+"%1").arg(pd->gvars[k])+""+tr("FM")+QString("%1"+tr("FM")+QString("%1
").arg(getInputStr(*g_model1, i))); } str.append(""); - for (i=0; igetCapability(FlightPhases); i++) { + for (i=0; igetCapability(FlightModes); i++) { PhaseData *pd1=&g_model1->phaseData[i]; PhaseData *pd2=&g_model2->phaseData[i]; str.append("

"; - str.append(tr("Expo/Dr Settings")); + str.append(tr("Inputs")); str.append("

"); int ec=0; unsigned int lastCHN = 255; @@ -262,8 +242,18 @@ void PrintDialog::printExpo() break; }; - str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight,true)).rightJustified(6, ' '); - str += ed->curve.toString().replace("<", "<").replace(">", ">"); + str += tr("Weight(") + QString("%1").arg(getGVarString(ed->weight,true)) + ")"; + + if (firmware->getCapability(VirtualInputs)) { + str += " " + tr("Source(%1)").arg(ed->srcRaw.toString()); + if (ed->carryTrim>0) { + str += " " + tr("NoTrim"); + } + else if (ed->carryTrim<0) { + str += " " + RawSource(SOURCE_TYPE_TRIM, (-(ed->carryTrim)-1)).toString(); + } + } + if (ed->curve.value) str += " " + Qt::escape(ed->curve.toString()); if (firmware->getCapability(FlightPhases)) { if(ed->phases) { @@ -303,12 +293,11 @@ void PrintDialog::printExpo() } if (ed->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString()); - str += ed->curve.toString().replace("<", "<").replace(">", ">"); if (firmware->getCapability(HasExpoNames)) { QString ExpoName; ExpoName.append(ed->name); if (!ExpoName.isEmpty()) { - str+=QString(" (%1)").arg(ExpoName); + str+= " " + QString(" [%1]").arg(ExpoName); } } str += ""; @@ -332,16 +321,22 @@ void PrintDialog::printMixes() str.append(""); @@ -351,57 +346,42 @@ void PrintDialog::printMixes() case (2): str += " R"; break; default: str += "  "; break; }; - str += QString(" %1").arg(getGVarString(md->weight, true)).rightJustified(6, ' '); - str += md->srcRaw.toString(); - if (md->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(md->swtch.toString()); - if (md->carryTrim) str += " " + tr("noTrim"); - if (md->sOffset) str += " "+ tr("Offset") + QString(" %1").arg(getGVarString(md->sOffset)); - str += md->curve.toString().replace("<", "<").replace(">", ">"); - float scale=firmware->getCapability(SlowScale); - if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale); - if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale); - if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn); - if (firmware->getCapability(FlightPhases)) { - if(md->phases) { - if (md->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { - int mask=1; - int first=0; - for (int i=0; igetCapability(FlightPhases); i++) { - if (!(md->phases & mask)) { - first++; - } - mask <<=1; - } - if (first>1) { - str += " " + tr("Flight modes") + QString("("); - } else { - str += " " + tr("Flight mode") + QString("("); - } - mask=1; - first=1; - for (int j=0; jgetCapability(FlightPhases);j++) { - if (!(md->phases & mask)) { - PhaseData *pd = &g_model->phaseData[j]; - if (!first) { - str += QString(", ")+ QString("%1").arg(getPhaseName(j+1, pd->name)); - } else { - str += QString("%1").arg(getPhaseName(j+1,pd->name)); - first=0; - } - } - mask <<=1; - } - str += QString(")"); - } else { - str += tr("DISABLED")+QString(" !!!"); - } - } + //set mixer src model if it is unset (srcRaw needs this to generate proper toString() for input source type) + if (md->srcRaw.model == 0) + md->srcRaw.model = g_model; + str += " " + md->srcRaw.toString(); + + str += " " + Qt::escape(tr("Weight(%1)").arg(getGVarString(md->weight, true))); + + QString phasesStr = getPhasesStr(md->phases, *g_model); + if (!phasesStr.isEmpty()) str += " " + Qt::escape(phasesStr); + + if (md->swtch.type != SWITCH_TYPE_NONE) { + str += " " + Qt::escape(tr("Switch(%1)").arg(md->swtch.toString())); } + + if (md->carryTrim) { + str += " " + Qt::escape(tr("NoTrim")); + } + + if (md->noExpo) str += " " + Qt::escape(tr("No DR/Expo")); + if (md->sOffset) str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(md->sOffset))); + if (md->curve.value) str += " " + Qt::escape(md->curve.toString()); + + + int scale = firmware->getCapability(SlowScale); + if (scale == 0) + scale = 1; + if (md->delayDown || md->delayUp) + str += Qt::escape(tr(" Delay(u%1:d%2)").arg((double)md->delayUp/scale).arg((double)md->delayDown/scale)); + if (md->speedDown || md->speedUp) + str += Qt::escape(tr(" Slow(u%1:d%2)").arg((double)md->speedUp/scale).arg((double)md->speedDown/scale)); + if (md->mixWarn) str += Qt::escape(tr(" Warn(%1)").arg(md->mixWarn)); if (firmware->getCapability(HasMixerNames)) { QString MixerName; MixerName.append(md->name); if (!MixerName.isEmpty()) { - str+=QString(" (%1)").arg(MixerName); + str += " " + Qt::escape(QString("(%1)").arg(MixerName)); } } str.append(""); @@ -435,12 +415,12 @@ void PrintDialog::printLimits() str.append(""); str.append(""); for(int i=0; igetCapability(Outputs); i++) { - str.append(doTR(QString::number(g_model->limitData[i].min),"green")); + str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); } str.append(""); str.append(""); for(int i=0; igetCapability(Outputs); i++) { - str.append(doTR(QString::number(g_model->limitData[i].max),"green")); + str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); } str.append(""); str.append(""); @@ -465,12 +445,12 @@ void PrintDialog::printLimits() str.append(""); str.append(""); for(int i=0; i<16; i++) { - str.append(doTR(QString::number(g_model->limitData[i].min),"green")); + str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); } str.append(""); str.append(""); for(int i=0; i<16; i++) { - str.append(doTR(QString::number(g_model->limitData[i].max),"green")); + str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); } str.append(""); str.append(""); @@ -497,12 +477,12 @@ void PrintDialog::printLimits() str.append(""); str.append(""); for(int i=16; igetCapability(Outputs); i++) { - str.append(doTR(QString::number(g_model->limitData[i].min),"green")); + str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); } str.append(""); str.append(""); for(int i=16; igetCapability(Outputs); i++) { - str.append(doTR(QString::number(g_model->limitData[i].max),"green")); + str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); } str.append(""); str.append(""); @@ -633,11 +613,8 @@ void PrintDialog::printSwitches() for (int i=0; igetCapability(LogicalSwitches); i++) { if (g_model->customSw[i].func) { str.append(""); - if (i<9) { - str.append("").arg(i+1)); - } else { - str.append(""); - } + str.append("").arg(i+1)); + if (i < 9) str += " "; QString tstr = g_model->customSw[i].toString(*g_model); str.append(doTC(tstr,"green")); str.append(""); @@ -652,25 +629,19 @@ void PrintDialog::printSwitches() void PrintDialog::printGvars() { - int gvars=0; - int gvarnum=0; - if ((GetCurrentFirmwareVariant() & GVARS_VARIANT ) || (!firmware->getCapability(HasVariants) && firmware->getCapability(Gvars))) { - gvars=1; - gvarnum=firmware->getCapability(Gvars); - } - if (!firmware->getCapability(GvarsFlightPhases) && (gvars==1 && firmware->getCapability(Gvars))) { + if (!firmware->getCapability(GvarsFlightPhases) && (gvars && firmware->getCapability(Gvars))) { QString str = "
"); if(lastCHN!=md->destCh) { lastCHN=md->destCh; - QString chname=tr("CH")+QString("%1 ").arg(lastCHN,2,10,QChar('0')); + + QString chname = QObject::tr("CH%1").arg(lastCHN); + // TODO not nice, Qt brings a function for that, I don't remember right now + (chname.length() < 4) ? chname.append(" ") : chname.append(" "); if (firmware->getCapability(HasChNames)) { - QString name=g_model->limitData[md->destCh-1].name; + QString name = g_model->limitData[lastCHN-1].name; if (!name.isEmpty()) { - name.append(" "); - chname=name.left(6); + name = QString("(") + name + QString(")"); } + name.append(" "); + chname += name.left(8); } - str.append(chname); - } else { + chname = Qt::escape(chname); + str.append(chname.replace(" ", " ")); + } + else { str.append(" "); } str.append("
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
"+tr("LS")+QString("%1"+tr("LS")+('A'+(i-9))+""+tr("L")+QString("%1
"; str.append(""); str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append("

"+tr("Global Variables")+"

"); PhaseData *pd=&g_model->phaseData[0]; int width=100/gvarnum; str.append(""); - for(int i=0; i").arg(width)+tr("GV")+QString("%1").arg(i+1)); } str.append(""); str.append(""); - for(int i=0; i").arg(width)+QString("%1").arg(pd->gvars[i])); } str.append(""); diff --git a/companion/src/printdialog.h b/companion/src/printdialog.h index 8209db326..2084b7596 100644 --- a/companion/src/printdialog.h +++ b/companion/src/printdialog.h @@ -28,6 +28,8 @@ public: private: Ui::PrintDialog *ui; + bool gvars; + unsigned int gvarnum; void printSetup(); QString printPhases(); From 0fc8a5e2f22bab2541e24c7b8b245a1b043a9309 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sun, 4 May 2014 18:08:55 +0200 Subject: [PATCH 37/79] Reenabled Ctrl+P shortcut for "print model" --- companion/src/mainwindow.cpp | 4 ++-- companion/src/modelslist.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/companion/src/mainwindow.cpp b/companion/src/mainwindow.cpp index 0308d0137..0644b339e 100644 --- a/companion/src/mainwindow.cpp +++ b/companion/src/mainwindow.cpp @@ -1573,7 +1573,7 @@ QAction * MainWindow::addAct(QString icon, QString sName, QString lName, QKeySeq if (!lName.isEmpty()) newAction->setStatusTip(lName); if (shortcut != 0) - newAction->setShortcuts(shortcut); + newAction->setShortcut(QKeySequence(shortcut)); if (slotObj == NULL) slotObj = this; connect(newAction, SIGNAL(triggered()), slotObj, slot); @@ -1653,7 +1653,7 @@ void MainWindow::createActions() // dutchLangAct = addAct( langAlignGroup, tr("Dutch"), tr("Use Dutch in menus"), SLOT(setNLLanguage())); aboutAct = addAct("information.png", tr("About..."), tr("Show the application's About box"), SLOT(about())); - printAct = addAct("print.png", tr("Print..."), tr("Print current model"), SLOT(print())); + printAct = addAct("print.png", tr("Print..."), tr("Print current model"), QKeySequence::Print, SLOT(print())); simulateAct = addAct("simulate.png", tr("Simulate..."), tr("Simulate current model"), SLOT(simulate())); loadbackupAct = addAct("open.png", tr("Load Backup..."), tr("Load backup from file"), SLOT(loadBackup())); logsAct = addAct("logs.png", tr("View Log File..."), tr("Open and view log file"), SLOT(logFile())); diff --git a/companion/src/modelslist.cpp b/companion/src/modelslist.cpp index 3d7fb8de1..26d99e9e7 100644 --- a/companion/src/modelslist.cpp +++ b/companion/src/modelslist.cpp @@ -97,7 +97,7 @@ void ModelsListWidget::ShowContextMenu(const QPoint& pos) contextMenu.addSeparator(); contextMenu.addAction(CompanionIcon("currentmodel.png"), tr("&Use as default"),this,SLOT(setdefault())); contextMenu.addSeparator(); - contextMenu.addAction(CompanionIcon("print.png"), tr("P&rint model"),this, SLOT(print()),tr("Alt+R")); + contextMenu.addAction(CompanionIcon("print.png"), tr("P&rint model"),this, SLOT(print()),QKeySequence(tr("Ctrl+P"))); contextMenu.addSeparator(); contextMenu.addAction(CompanionIcon("simulate.png"), tr("&Simulate model"),this, SLOT(simulate()),tr("Alt+S")); contextMenu.exec(globalPos); From 7027d809c1bda737af6e72b2e9f9d51dc49ed3b9 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sun, 4 May 2014 18:21:03 +0200 Subject: [PATCH 38/79] Logical switches print improvement --- companion/src/eeprominterface.cpp | 12 ++++++------ companion/src/printdialog.cpp | 5 ++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index d927be13d..1e3868830 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -507,13 +507,13 @@ QString LogicalSwitchData::toString(const ModelData & model) } switch (getFunctionFamily()) { case LS_FAMILY_STAY: - result = QObject::tr("STAY( %1, [%2:%3])").arg(RawSwitch(val1).toString()).arg(ValToTim(val2)).arg(ValToTim(val2+val3)); + result += QObject::tr("Edge(%1, [%2:%3])").arg(RawSwitch(val1).toString()).arg(ValToTim(val2)).arg(ValToTim(val2+val3)); break; case LS_FAMILY_STICKY: - result = QObject::tr("STICKY( %1, %2)").arg(RawSwitch(val1).toString()).arg(RawSwitch(val2).toString()); + result += QObject::tr("Sticky(%1, %2)").arg(RawSwitch(val1).toString()).arg(RawSwitch(val2).toString()); break; case LS_FAMILY_TIMER: - result = QObject::tr("TIMER( %1, %2)").arg(ValToTim(val1)).arg(ValToTim(val2)); + result += QObject::tr("Timer(%1, %2)").arg(ValToTim(val1)).arg(ValToTim(val2)); break; case LS_FAMILY_VOFS: { RawSource source = RawSource(val1, &model); @@ -603,10 +603,10 @@ QString LogicalSwitchData::toString(const ModelData & model) } if (GetCurrentFirmware()->getCapability(LogicalSwitchesExt)) { - if (delay) - result += QObject::tr(" Delay %1 sec").arg(delay/10.0); if (duration) - result += QObject::tr(" Duration %1 sec").arg(duration/10.0); + result += QObject::tr(" Duration (%1s)").arg(duration/10.0); + if (delay) + result += QObject::tr(" Delay (%1s)").arg(delay/10.0); } return result; diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index 9c15efcee..da230afc9 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -613,10 +613,9 @@ void PrintDialog::printSwitches() for (int i=0; igetCapability(LogicalSwitches); i++) { if (g_model->customSw[i].func) { str.append(""); - str.append("").arg(i+1)); - if (i < 9) str += " "; + str.append("").arg(i+1)); QString tstr = g_model->customSw[i].toString(*g_model); - str.append(doTC(tstr,"green")); + str.append(doTL(tstr,"green")); str.append(""); sc++; } From fe719686d973c5a6aa0a29844d9b604b5820a2e4 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sun, 4 May 2014 18:37:58 +0200 Subject: [PATCH 39/79] Special Functions print improvement --- companion/src/printdialog.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index da230afc9..872176214 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -656,7 +656,8 @@ void PrintDialog::printFSwitches() QString str = "
"+tr("L")+QString("%1"+tr("L")+QString("%1
"; str.append(""); str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + FrSkyData *fd=&g_model->frsky; + for (int i=0; i<2; i++) { + if (fd->channels[i].ratio!=0) { + tc++; + float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + } + } + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append("

"+tr("Special Functions")+"

"); - str.append(doTC(tr("Switch"), "", true)); + str.append(""); + str.append(doTL(tr("Switch"), "", true)); str.append(doTL(tr("Function"), "", true)); str.append(doTL(tr("Parameter"), "", true)); str.append(doTL(tr("Repeat"), "", true)); @@ -665,19 +666,21 @@ void PrintDialog::printFSwitches() for(int i=0; igetCapability(CustomFunctions); i++) { if (g_model->funcSw[i].swtch.type!=SWITCH_TYPE_NONE) { str.append(""); - str.append(doTC(g_model->funcSw[i].swtch.toString(),"green")); - str.append(doTC(g_model->funcSw[i].funcToString(),"green")); - str.append(doTC(g_model->funcSw[i].paramToString(),"green")); + str.append(doTL(tr("SF%1").arg(i+1),"", true)); + str.append(doTL(g_model->funcSw[i].swtch.toString(),"green")); + str.append(doTL(g_model->funcSw[i].funcToString(),"green")); + str.append(doTL(g_model->funcSw[i].paramToString(),"green")); int index=g_model->funcSw[i].func; - if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) { - str.append(doTC(QString("%1").arg(g_model->funcSw[i].repeatParam),"green")); + if ((g_model->funcSw[i].repeatParam>0) && + (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic)) { + str.append(doTL(QString("%1").arg(g_model->funcSw[i].repeatParam),"green")); } else { - str.append(doTC( " ","green")); + str.append(doTL( " ","green")); } if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) { - str.append(doTC((g_model->funcSw[i].enabled ? "ON" : "OFF"),"green")); + str.append(doTL((g_model->funcSw[i].enabled ? "ON" : "OFF"),"green")); } else { - str.append(doTC( "---","green")); + str.append(doTL( "---","green")); } str.append(""); sc++; From 1f3e67f9121066acad4b4db9b716296fa897251f Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Sun, 4 May 2014 19:52:26 +0200 Subject: [PATCH 40/79] Telemetry for Taranis print improvement --- companion/src/printdialog.cpp | 117 +++++++++++++++++++++++++--------- 1 file changed, 86 insertions(+), 31 deletions(-) diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index 872176214..cfb94d62f 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -696,39 +696,94 @@ void PrintDialog::printFrSky() { int tc=0; QString str = "
#
"; - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - FrSkyData *fd=&g_model->frsky; - for (int i=0; i<2; i++) { - if (fd->channels[i].ratio!=0) { - tc++; - float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); + + if (IS_TARANIS(GetEepromInterface()->getBoard())) { + str.append(""); + str.append(""); + str.append(doTC(tr("Analog"),"", true)); + str.append(doTC(tr("Range"),"", true)); + str.append(doTC(tr("Offset"),"", true)); + str.append(""); + + FrSkyData *fd=&g_model->frsky; + for (int i=0; i<2; i++) { + if (fd->channels[i].ratio!=0) { + tc++; + float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); + QString unit = " " + getFrSkyUnits(fd->channels[i].type); + str.append(""); + str.append(doTL(tr("A%1").arg(i+1), "", true)); + str.append(doTC(QString::number(ratio,10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); + str.append(doTC(QString::number((fd->channels[i].offset*ratio)/255,10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); + str.append(""); + } } + + str.append(""); + str.append(""); + str.append(doTC(tr("Alarms"),"", true)); + str.append(doTC(tr("Low Alarm"),"", true)); + str.append(doTC(tr("Critical Alarm"),"", true)); + str.append(""); + str.append(""); + str.append(doTL(tr("RSSI"),"", true)); + str.append(doTC(QString::number(fd->rssiAlarms[0].value,10),"green")); + str.append(doTC(QString::number(fd->rssiAlarms[1].value,10),"green")); + str.append(""); + for (int i=0; i<2; i++) { + if (fd->channels[i].ratio!=0) { + float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); + QString unit = " " + getFrSkyUnits(fd->channels[i].type); + str.append(""); + str.append(doTL(tr("A%1").arg(i+1), "", true)); + str.append(doTC(QString::number(ratio*(fd->channels[i].alarms[0].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); + str.append(doTC(QString::number(ratio*(fd->channels[i].alarms[1].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); + str.append(""); + } + } + + //TODO preferrably in new tables + str.append(""); + //str.append(""); + //str.append(""); + str.append(""); + str.append("

"+tr("Telemetry Settings")+"

 "+tr("Alarm 1")+""+tr("Alarm 2")+"
"+tr("Analog")+""+tr("Unit")+""+tr("Scale")+""+tr("Offset")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+"
"+tr("A%1").arg(i+1)+""+getFrSkyUnits(fd->channels[i].type)+""+QString::number(ratio,10,(fd->channels[i].type==0 ? 1:0))+""+QString::number((fd->channels[i].offset*ratio)/255,10,(fd->channels[i].type==0 ? 1:0))+""+getFrSkyAlarmType(fd->channels[i].alarms[0].level)+""); - str.append((fd->channels[i].alarms[0].greater==1) ? ">" : "<"); - str.append(""+QString::number(ratio*(fd->channels[i].alarms[0].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+""+getFrSkyAlarmType(fd->channels[i].alarms[1].level)+""); - str.append((fd->channels[i].alarms[1].greater==1) ? ">" : "<"); - str.append(""+QString::number(ratio*(fd->channels[i].alarms[1].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+"

"+tr("Telemetry Settings")+"

"+tr("Frsky serial protocol")+""+getFrSkyProtocol(fd->usrProto)+"
"+tr("Units system")+""+getFrSkyMeasure(fd->imperial)+"
"+tr("Blades")+""+QString("%1").arg(fd->blades)+"
"); + } + else { //other boards + str.append("

"+tr("Telemetry Settings")+"

 "+tr("Alarm 1")+""+tr("Alarm 2")+"
"+tr("Analog")+""+tr("Unit")+""+tr("Scale")+""+tr("Offset")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+"
"+tr("A%1").arg(i+1)+""+getFrSkyUnits(fd->channels[i].type)+""+QString::number(ratio,10,(fd->channels[i].type==0 ? 1:0))+""+QString::number((fd->channels[i].offset*ratio)/255,10,(fd->channels[i].type==0 ? 1:0))+""+getFrSkyAlarmType(fd->channels[i].alarms[0].level)+""); + str.append((fd->channels[i].alarms[0].greater==1) ? ">" : "<"); + str.append(""+QString::number(ratio*(fd->channels[i].alarms[0].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+""+getFrSkyAlarmType(fd->channels[i].alarms[1].level)+""); + str.append((fd->channels[i].alarms[1].greater==1) ? ">" : "<"); + str.append(""+QString::number(ratio*(fd->channels[i].alarms[1].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+"
 "+tr("Alarm 1")+""+tr("Alarm 2")+"
"+tr("Type")+""+tr("Condition")+""+tr("Value")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+"
"+tr("RSSI Alarm")+""+getFrSkyAlarmType(fd->rssiAlarms[0].level)+"<"+QString::number(fd->rssiAlarms[0].value,10)+""+getFrSkyAlarmType(fd->rssiAlarms[1].level)+"<"+QString::number(fd->rssiAlarms[1].value,10)+"
"+tr("Frsky serial protocol")+""+getFrSkyProtocol(fd->usrProto)+"
"+tr("Units system")+""+getFrSkyMeasure(fd->imperial)+"
"+tr("Blades")+""+fd->blades+"
"); } - str.append("
 "+tr("Alarm 1")+""+tr("Alarm 2")+"
"+tr("Type")+""+tr("Condition")+""+tr("Value")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+"
"+tr("RSSI Alarm")+""+getFrSkyAlarmType(fd->rssiAlarms[0].level)+"<"+QString::number(fd->rssiAlarms[0].value,10)+""+getFrSkyAlarmType(fd->rssiAlarms[1].level)+"<"+QString::number(fd->rssiAlarms[1].value,10)+"
"+tr("Frsky serial protocol")+""+getFrSkyProtocol(fd->usrProto)+"
"+tr("Units system")+""+getFrSkyMeasure(fd->imperial)+"
"+tr("Blades")+""+fd->blades+"
"); #if 0 if (firmware->getCapability(TelemetryBars) || (firmware->getCapability(TelemetryCSFields))) { int cols=firmware->getCapability(TelemetryColsCSFields); From bba3d8f08c0f38cd782e0c25b1d1c15331033c40 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sun, 4 May 2014 23:45:50 +0200 Subject: [PATCH 41/79] Update DONATIONS.txt --- DONATIONS.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DONATIONS.txt b/DONATIONS.txt index 102ad1541..54e7bf0af 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -386,3 +386,5 @@ Wilco Hijink Roy Nixon Lexington S Morley Daryl Dacko +Beat Zurflueh +Piotr Kundu From 5ec1860921e6c0cb40ab8da9681d4dec7c0dbb68 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sun, 4 May 2014 23:47:09 +0200 Subject: [PATCH 42/79] Update DONATIONS.txt --- DONATIONS.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DONATIONS.txt b/DONATIONS.txt index 54e7bf0af..2ab34671a 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -133,7 +133,7 @@ Eric Burdis Nigel Chippindale Michael Deasy Stephen Stough -Kenneth Lilja +Kenneth Lilja (monthly) Robert Jero Gary Bancroft Robert Cotsford From 740e5fd703b50507847d54de727e636992256f2d Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Mon, 5 May 2014 07:40:13 +0200 Subject: [PATCH 43/79] Update DONATIONS.txt --- DONATIONS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/DONATIONS.txt b/DONATIONS.txt index 2ab34671a..233693225 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -388,3 +388,4 @@ Lexington S Morley Daryl Dacko Beat Zurflueh Piotr Kundu +Kevin Berkefeld From 6868b69aad692e20277d9d05d9517df25fd787c5 Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 5 May 2014 08:23:46 +0200 Subject: [PATCH 44/79] Compiler options to reduce flash usage on sky9x and Taranis --- radio/src/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/Makefile b/radio/src/Makefile index dde8ed6f3..6c5db764e 100644 --- a/radio/src/Makefile +++ b/radio/src/Makefile @@ -1078,7 +1078,7 @@ MSG_CLEANING = Cleaning project: # Combine all necessary flags and optional flags. # Add target processor to flags. -ARMCPPFLAGS = -c -mcpu=$(MCU) -mthumb -fomit-frame-pointer -fverbose-asm -Wa,-ahlms=opentx.lst -DRUN_FROM_FLASH=1 -O$(OPT) $(CPPFLAGS) $(INCFLAGS) $(EXTRAINCFLAGS) $(GENDEPFLAGS) +ARMCPPFLAGS = -c -mcpu=$(MCU) -mthumb -fomit-frame-pointer -fverbose-asm -Wa,-ahlms=opentx.lst -DRUN_FROM_FLASH=1 -O$(OPT) $(CPPFLAGS) -fdata-sections -ffunction-sections $(INCFLAGS) $(EXTRAINCFLAGS) $(GENDEPFLAGS) AVRCPPFLAGS = -mmcu=$(MCU) -I. -x c++ -O$(OPT) $(CPPFLAGS) $(INCFLAGS) $(EXTRAINCFLAGS) $(GENDEPFLAGS) -fwhole-program ifeq ($(ARCH), AVR) @@ -1349,7 +1349,7 @@ OBJS = $(TMP:.s=.o) @echo @echo $(MSG_COMPILING) $@ $(CC) $(ARMCPPFLAGS) $< -o allsrc.o - $(CC) $(OBJS) allsrc.o -mcpu=cortex-m3 -mthumb -nostartfiles -lm -T$(LDSCRIPT) -Wl,-Map=$(TARGET).map,--cref,--no-warn-mismatch -o $@ + $(CC) $(OBJS) allsrc.o -mcpu=cortex-m3 -mthumb -nostartfiles -lm -T$(LDSCRIPT) -Wl,-Map=$(TARGET).map,--cref,--no-warn-mismatch,--gc-sections -o $@ endif # Target: clean project. From 1466f96e5156c37710f55d26d1d63e2b3cff3984 Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 5 May 2014 09:57:21 +0200 Subject: [PATCH 45/79] Lua setGlobalVariable / getGlobalVariable added in model library --- radio/src/lua.cpp | 25 +++++++++++++++++++++++++ radio/src/myeeprom.h | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/radio/src/lua.cpp b/radio/src/lua.cpp index 2aacda979..5cdf45328 100644 --- a/radio/src/lua.cpp +++ b/radio/src/lua.cpp @@ -741,6 +741,29 @@ static int luaModelSetOutput(lua_State *L) return 0; } + +static int luaModelGetGlobalVariable(lua_State *L) +{ + int idx = luaL_checkunsigned(L, 1); + int phase = luaL_checkunsigned(L, 2); + if (phase < MAX_PHASES && idx < MAX_GVARS) + lua_pushinteger(L, g_model.phaseData[phase].gvars[idx]); + else + lua_pushnil(L); + return 1; +} + +static int luaModelSetGlobalVariable(lua_State *L) +{ + int idx = luaL_checkunsigned(L, 1); + int phase = luaL_checkunsigned(L, 2); + int value = luaL_checkinteger(L, 3); + if (phase < MAX_PHASES && idx < MAX_GVARS && value <= 500) { + g_model.phaseData[phase].gvars[idx] = value; + } + return 0; +} + static int luaPopupInput(lua_State *L) { uint8_t event = luaL_checkinteger(L, 2); @@ -849,6 +872,8 @@ static const luaL_Reg modelLib[] = { { "setCustomFunction", luaModelSetCustomFunction }, { "getOutput", luaModelGetOutput }, { "setOutput", luaModelSetOutput }, + { "getGlobalVariable", luaModelGetGlobalVariable }, + { "setGlobalVariable", luaModelSetGlobalVariable }, { NULL, NULL } /* sentinel */ }; diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 0d6a1bbe1..451e78f71 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -692,7 +692,7 @@ PACK(typedef struct t_MixData { PACK( union u_gvarint_t { struct { int8_t lo; - uint8_t hi; + uint8_t hi; } bytes_t; int16_t word; From be3c674fe5ba4421b3c8d80b78f5127f0a23e36c Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 5 May 2014 10:36:34 +0200 Subject: [PATCH 46/79] Fixes #36 --- radio/src/opentx.cpp | 29 ++++++++++++-------- radio/src/opentx.h | 1 + radio/src/targets/sky9x/board_sky9x.cpp | 13 ++++----- radio/src/targets/taranis/trainer_driver.cpp | 7 +++-- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index fd08ea0e4..38e407e2f 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -319,7 +319,8 @@ void per10ms() if (lightOffCounter) lightOffCounter--; if (flashCounter) flashCounter--; if (s_noHi) s_noHi--; - if (trimsCheckTimer) trimsCheckTimer --; + if (trimsCheckTimer) trimsCheckTimer--; + if (ppmInValid) ppmInValid--; #if defined(RTCLOCK) /* Update global Date/Time every 100 per10ms cycles */ @@ -3196,7 +3197,7 @@ void evalInputs(uint8_t mode) } #endif - if (mode <= e_perout_mode_inactive_phase && isFunctionActive(FUNCTION_TRAINER+ch)) { + if (mode <= e_perout_mode_inactive_phase && isFunctionActive(FUNCTION_TRAINER+ch) && ppmInValid) { // trainer mode TrainerMix* td = &g_eeGeneral.trainer.mix[ch]; if (td->mode) { @@ -3823,6 +3824,10 @@ void perOut(uint8_t mode, uint8_t tick10ms) bool mixCondition = (md->phases != 0 || md->swtch); delayval_t mixEnabled = !(md->phases & (1 << s_perout_flight_phase)) && getSwitch(md->swtch); + if (mixEnabled && md->srcRaw >= MIXSRC_FIRST_TRAINER && md->srcRaw <= MIXSRC_LAST_TRAINER && !ppmInValid) { + mixEnabled = 0; + } + //========== VALUE =============== getvalue_t v = 0; if (mode > e_perout_mode_inactive_phase) { @@ -5046,6 +5051,7 @@ void perMain() int16_t g_ppmIns[NUM_TRAINER]; uint8_t ppmInState = 0; // 0=unsync 1..8= wait for value i-1 +uint8_t ppmInValid = 0; #if !defined(SIMU) && !defined(CPUARM) @@ -5132,19 +5138,18 @@ ISR(TIMER3_CAPT_vect) // G: High frequency noise can cause stack overflo with IS // G: We process g_ppmIns immediately here, to make servo movement as smooth as possible // while under trainee control - if (val>4000 && val < 16000) // G: Prioritize reset pulse. (Needed when less than 8 incoming pulses) + if (val>4000 && val < 16000) { // G: Prioritize reset pulse. (Needed when less than 8 incoming pulses) ppmInState = 1; // triggered - else - { - if (ppmInState && ppmInState<=8) - { - if (val>800 && val<2200) // if valid pulse-width range - { - g_ppmIns[ppmInState++ - 1] = - (int16_t)(val - 1500)*(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough. + } + else { + if (ppmInState>0 && ppmInState<=8) { + if (val>800 && val<2200) { // if valid pulse-width range + ppmInValid = 100; + g_ppmIns[ppmInState++ - 1] = (int16_t)(val - 1500) * (uint8_t)(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough. } - else + else { ppmInState = 0; // not triggered + } } } diff --git a/radio/src/opentx.h b/radio/src/opentx.h index 1ddafc247..eccbd62a7 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -1013,6 +1013,7 @@ extern uint8_t g_beepCnt; extern uint8_t g_beepVal[5]; extern uint8_t ppmInState; //0=unsync 1..8= wait for value i-1 +extern uint8_t ppmInValid; extern int16_t g_ppmIns[NUM_TRAINER]; extern int32_t chans[NUM_CHNOUT]; extern int16_t ex_chans[NUM_CHNOUT]; // Outputs (before LIMITS) of the last perMain diff --git a/radio/src/targets/sky9x/board_sky9x.cpp b/radio/src/targets/sky9x/board_sky9x.cpp index bb01fd7e4..a33453da3 100644 --- a/radio/src/targets/sky9x/board_sky9x.cpp +++ b/radio/src/targets/sky9x/board_sky9x.cpp @@ -314,15 +314,14 @@ extern "C" void TC3_IRQHandler() //capture ppm in at 2MHz ppmInState = 1; // triggered } else { - if (ppmInState && ppmInState<=16) - { - if (val>800 && val<2200) // if valid pulse-width range - { - g_ppmIns[ppmInState++ - 1] = - (int16_t)(val - 1500)*(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough. + if (ppmInState>0 && ppmInState<=16) { + if (val>800 && val<2200) { // if valid pulse-width range + ppmInValid = 100; + g_ppmIns[ppmInState++ - 1] = (int16_t)(val - 1500)*(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough. } - else + else { ppmInState = 0; // not triggered + } } } diff --git a/radio/src/targets/taranis/trainer_driver.cpp b/radio/src/targets/taranis/trainer_driver.cpp index 5e453d215..2a92fd74e 100644 --- a/radio/src/targets/taranis/trainer_driver.cpp +++ b/radio/src/targets/taranis/trainer_driver.cpp @@ -126,12 +126,13 @@ extern "C" void TIM3_IRQHandler() // We process g_ppmInsright here to make servo movement as smooth as possible // while under trainee control - if ((val>4000) && (val < 19000)) { // G: Prioritize reset pulse. (Needed when less than 16 incoming pulses) + if (val>4000 && val<19000) { // G: Prioritize reset pulse. (Needed when less than 16 incoming pulses) ppmInState = 1; // triggered } else { - if (ppmInState && (ppmInState<=16)) { - if ((val>800) && (val<2200)) { + if (ppmInState>0 && ppmInState<=16) { + if (val>800 && val<2200) { + ppmInValid = 100; g_ppmIns[ppmInState++ - 1] = (int16_t)(val - 1500)*(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough. } else { From 2810323cc7108f0d03a1cfa5f7bd5cd79750749b Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 5 May 2014 10:53:59 +0200 Subject: [PATCH 47/79] 10200mAh as a maximum for Consumption in Telemetry Bars --- companion/src/eeprominterface.cpp | 4 ++-- radio/src/opentx.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 5c3f6ff40..6c7c626a3 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -200,8 +200,8 @@ RawSourceRange RawSource::getRange(bool singleprec) result.decimals = 1; break; case TELEMETRY_SOURCE_CONSUMPTION: - result.step = singleprec ? 20 : 1; - result.max = singleprec ? 5100 : 10000; + result.step = singleprec ? 40 : 1; + result.max = singleprec ? 10200 : 10000; break; case TELEMETRY_SOURCE_POWER: case TELEMETRY_SOURCE_POWER_MAX: diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 38e407e2f..45a2a458a 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -2145,7 +2145,7 @@ getvalue_t convert8bitsTelemValue(uint8_t channel, ls_telemetry_value_t value) result = value * 5; break; case TELEM_CONSUMPTION: - result = value * 20; + result = value * 40; break; case TELEM_VSPEED: result = ((getvalue_t)value - 125) * 10; From 934961e99961d46641b6c52e5ae07400f6c0daff Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 5 May 2014 12:27:29 +0200 Subject: [PATCH 48/79] Fixes #1056 --- companion/src/modeledit/customfunctions.cpp | 10 ++++++++-- radio/src/gui/menu_model.cpp | 5 +++-- radio/src/myeeprom.h | 2 ++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/companion/src/modeledit/customfunctions.cpp b/companion/src/modeledit/customfunctions.cpp index 51de7cc69..c95d34d6e 100644 --- a/companion/src/modeledit/customfunctions.cpp +++ b/companion/src/modeledit/customfunctions.cpp @@ -329,8 +329,14 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified) if (modified) model.funcSw[i].param = fswtchParam[i]->value(); fswtchParam[i]->setDecimals(0); fswtchParam[i]->setSingleStep(1); - fswtchParam[i]->setMinimum(-125); - fswtchParam[i]->setMaximum(125); + if (IS_ARM(GetEepromInterface()->getBoard())) { + fswtchParam[i]->setMinimum(-500); + fswtchParam[i]->setMaximum(500); + } + else { + fswtchParam[i]->setMinimum(-125); + fswtchParam[i]->setMaximum(125); + } fswtchParam[i]->setValue(model.funcSw[i].param); widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM; } diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index e28373975..c94f9a048 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -4967,10 +4967,11 @@ void menuModelCustomFunctions(uint8_t event) { INCDEC_DECLARE_VARS(); int16_t val_displayed = CFN_PARAM(sd); - int8_t val_min = 0; #if defined(CPUARM) + int16_t val_min = 0; int16_t val_max = 255; #else + int8_t val_min = 0; uint8_t val_max = 255; #endif if (func == FUNC_SAFETY_CHANNEL) { @@ -5084,7 +5085,7 @@ void menuModelCustomFunctions(uint8_t event) switch (CFN_GVAR_MODE(sd)) { case FUNC_ADJUST_GVAR_CONSTANT: val_displayed = (int8_t)CFN_PARAM(sd); - val_min = -125; val_max = 125; + val_min = -CFN_GVAR_CST_MAX; val_max = +CFN_GVAR_CST_MAX; lcd_outdezAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT); break; case FUNC_ADJUST_GVAR_SOURCE: diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 451e78f71..6380066a8 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -916,6 +916,7 @@ PACK(typedef struct t_CustomFnData { // Function Switches data #define CFN_GVAR_MODE(p) ((p)->all.mode) #define CFN_PARAM(p) ((p)->all.val) #define CFN_RESET(p) ((p)->active=0, (p)->clear.val1=0, (p)->clear.val2=0) +#define CFN_GVAR_CST_MAX 500 #else PACK(typedef struct t_CustomFnData { PACK(union { @@ -948,6 +949,7 @@ PACK(typedef struct t_CustomFnData { #define CFN_GVAR_MODE(p) ((p)->gvar.mode) #define CFN_PARAM(p) ((p)->value) #define CFN_RESET(p) ((p)->all.active = 0, CFN_PARAM(p) = 0) +#define CFN_GVAR_CST_MAX 125 #endif enum TelemetryUnit { From c53fbd9e94bdd82496fdc33dc2e378c3f5884d0b Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 5 May 2014 14:40:48 +0200 Subject: [PATCH 49/79] Fixes #1059 --- radio/src/opentx.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 45a2a458a..ac4f422f5 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -3918,7 +3918,7 @@ void perOut(uint8_t mode, uint8_t tick10ms) //========== TRIMS ================ if (!(mode & e_perout_mode_notrims)) { #if defined(PCBTARANIS) - if (!md->carryTrim) { + if (md->carryTrim == 0) { int8_t mix_trim; if (stickIndex < NUM_STICKS) mix_trim = stickIndex; @@ -3926,7 +3926,13 @@ void perOut(uint8_t mode, uint8_t tick10ms) mix_trim = virtualInputsTrims[md->srcRaw-1]; else mix_trim = -1; - if (mix_trim >= 0) v += trims[mix_trim]; + if (mix_trim >= 0) { + int16_t trim = trims[mix_trim]; + if (mix_trim == THR_STICK && g_model.throttleReversed) + v -= trim; + else + v += trim; + } } #else int8_t mix_trim = md->carryTrim; @@ -3936,7 +3942,13 @@ void perOut(uint8_t mode, uint8_t tick10ms) mix_trim = stickIndex; else mix_trim = -1; - if (mix_trim >= 0) v += trims[mix_trim]; + if (mix_trim >= 0) { + int16_t trim = trims[mix_trim]; + if (mix_trim == THR_STICK && g_model.throttleReversed) + v -= trim; + else + v += trim; + } #endif } } From 6ae7da4b1a2d96b3444dd66f47b6db68dad65799 Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 5 May 2014 14:51:22 +0200 Subject: [PATCH 50/79] Missing check in setGlobalVariable(...) --- radio/src/lua.cpp | 2 +- radio/src/myeeprom.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/radio/src/lua.cpp b/radio/src/lua.cpp index 5cdf45328..bb6ed9dff 100644 --- a/radio/src/lua.cpp +++ b/radio/src/lua.cpp @@ -758,7 +758,7 @@ static int luaModelSetGlobalVariable(lua_State *L) int idx = luaL_checkunsigned(L, 1); int phase = luaL_checkunsigned(L, 2); int value = luaL_checkinteger(L, 3); - if (phase < MAX_PHASES && idx < MAX_GVARS && value <= 500) { + if (phase < MAX_PHASES && idx < MAX_GVARS && value >= -GVAR_LIMIT && value <= GVAR_LIMIT) { g_model.phaseData[phase].gvars[idx] = value; } return 0; diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 6380066a8..16018bf3a 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -916,7 +916,7 @@ PACK(typedef struct t_CustomFnData { // Function Switches data #define CFN_GVAR_MODE(p) ((p)->all.mode) #define CFN_PARAM(p) ((p)->all.val) #define CFN_RESET(p) ((p)->active=0, (p)->clear.val1=0, (p)->clear.val2=0) -#define CFN_GVAR_CST_MAX 500 +#define CFN_GVAR_CST_MAX GVAR_LIMIT #else PACK(typedef struct t_CustomFnData { PACK(union { From 15dd4ba2f2ad3293e052aaad8c85d5dfdbf09ac1 Mon Sep 17 00:00:00 2001 From: Kjell Kernen Date: Mon, 5 May 2014 15:35:07 +0200 Subject: [PATCH 51/79] Swedish translation file realigned with English original --- radio/src/translations/se.h.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 9336b2ea8..ad986bc9b 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -294,9 +294,13 @@ #define TR_A3_A4_MIN #endif -#define TR_ASPD_MAX "ASp+" +#define TR_ASPD_MAX TR("ASp+", "ASpd+") -#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Höjd""Varv""Tank""T1\0 ""T2\0 ""Fart""Avst""GHjd""Batt""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VFrt""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Hjd-""Hjd+""Rpm+""T1+\0""T2+\0""Frt+""Avs+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Tid\0" +#if LCD_W >= 212 + #define TR_VTELEMCHNS "---\0 ""Batt\0""Tmr1\0""Tmr2\0" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0 ""Rpm\0 ""Fuel\0""T1\0 ""T2\0 ""Spd\0 ""Dist\0""GAlt\0""Cell\0""Cells""Vfas\0""Curr\0""Cnsp\0""Powr\0""AccX\0""AccY\0""AccZ\0""Hdg\0 ""VSpd\0""ASpd\0""dTE\0 " TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0 ""A2-\0 " TR_A3_A4_MIN "Alt-\0""Alt+\0""Rpm+\0""T1+\0 ""T2+\0 ""Spd+\0""Dst+\0" TR_ASPD_MAX "Cell-""Cels-""Vfas-""Curr+""Powr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0 ""Time\0" +#else + #define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" +#endif #define LENGTH_UNIT_IMP "ft\0" #define SPEED_UNIT_IMP "mph" @@ -440,7 +444,6 @@ #define LEN_INDENT 1 #define INDENT_WIDTH (FW/2) - #if defined(PCBTARANIS) #define TR_ENTER "[ENTER]" #else @@ -475,7 +478,7 @@ #define TR_TTRIM TR("Gastrim", INDENT "Gastrim") #define TR_BEEPCTR TR("Cent.pip", "Centerpip") #define TR_PROTO TR(INDENT "Proto", INDENT "Protokoll") -#define TR_PPMFRAME "PPM-paket" +#define TR_PPMFRAME TR(INDENT "PPM-paket", INDENT "PPM-paket") #define TR_MS "ms" #define TR_SWITCH "Brytare" #define TR_TRIMS "Trimmar" @@ -851,7 +854,6 @@ #define TR_ABOUT_HARDWARE_3 "" #endif - #define TR_ABOUT_PARENTS_1 "Ursprungsprojekt" #define TR_ABOUT_PARENTS_2 "ersky9x (Mike Blandford)" #define TR_ABOUT_PARENTS_3 "ER9X (Erez Raviv)" @@ -874,4 +876,4 @@ #define TR_VIEW_CHANNELS "Visa Kanaler" #define TR_VIEW_NOTES "Visa Noteringars" #define TR_MODS_FORBIDDEN "Modifikationer förbjudna!" -#define TR_UNLOCKED "Olåst" +#define TR_UNLOCKED "Olåst" \ No newline at end of file From 7119d069da703690c50cf0f0a716006fcb17a9ef Mon Sep 17 00:00:00 2001 From: Kjell Kernen Date: Mon, 5 May 2014 15:45:31 +0200 Subject: [PATCH 52/79] Fixed Swedish translation issue that resulted in corrupted mix soure strings --- radio/src/translations/se.h.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index ad986bc9b..0f7efd6c3 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -419,7 +419,7 @@ #define TR_CYC_VSRCRAW "[C1]""[C2]""[C3]" #endif -#define TR_VSRCRAW "---\0""Rod\0""Hjd\0""Gas\0""Ske\0" TR_POTS_VSRCRAW TR_ROTARY_ENCODER "MAX " TR_CYC_VSRCRAW "TrmR" "TrmH" "TrmG" "TrmS" TR_SW_VSRCRAW +#define TR_VSRCRAW "---\0""Rod\0""Hjd\0""Gas\0""Ske\0" TR_POTS_VSRCRAW TR_ROTARY_ENCODERS "MAX\0" TR_CYC_VSRCRAW "TrmR" "TrmH" "TrmG" "TrmS" TR_SW_VSRCRAW #define LEN_VTMRMODES "\003" #define TR_VTMRMODES "Av\0""ABS""GAs""GA%""GAt" From f178748090c1d1e66471403c693972dd240fbe42 Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 5 May 2014 16:06:34 +0200 Subject: [PATCH 53/79] Fixes #986 Fixes #1058 --- companion/src/comparedialog.cpp | 60 ++++++------- companion/src/eeprominterface.cpp | 20 +++-- companion/src/eeprominterface.h | 13 +-- .../src/firmwares/gruvin9x/gruvin9xeeprom.cpp | 8 +- .../src/firmwares/gruvin9x/gruvin9xeeprom.h | 10 +-- .../firmwares/opentx/open9xGruvin9xeeprom.cpp | 10 +-- .../firmwares/opentx/open9xGruvin9xeeprom.h | 10 +-- .../firmwares/opentx/open9xSky9xeeprom.cpp | 10 +-- .../src/firmwares/opentx/open9xSky9xeeprom.h | 12 +-- .../firmwares/opentx/open9xStockeeprom.cpp | 18 ++-- .../src/firmwares/opentx/open9xStockeeprom.h | 20 ++--- .../src/firmwares/opentx/opentxeeprom.cpp | 11 ++- companion/src/firmwares/opentx/opentxeeprom.h | 4 +- .../src/firmwares/opentx/opentxinterface.cpp | 8 +- companion/src/helpers.cpp | 22 ++++- companion/src/modeledit/expodialog.cpp | 12 +-- companion/src/modeledit/flightmodes.cpp | 58 ++++++------ companion/src/modeledit/flightmodes.h | 14 +-- companion/src/modeledit/mixerdialog.cpp | 4 +- companion/src/modeledit/modeledit.cpp | 2 +- companion/src/printdialog.cpp | 24 ++--- companion/src/xmlinterface.cpp | 2 +- radio/src/audio_arm.cpp | 4 +- radio/src/eeprom_conversions.cpp | 2 +- radio/src/gtests.cpp | 8 +- radio/src/gui/menu_model.cpp | 72 +++++++-------- radio/src/gui/menus.cpp | 12 +-- radio/src/gui/view_main.cpp | 6 +- radio/src/lcd.cpp | 7 +- radio/src/lcd.h | 2 +- radio/src/lua.cpp | 6 +- radio/src/myeeprom.h | 41 +++++---- radio/src/opentx.cpp | 90 ++++++++++--------- radio/src/opentx.h | 2 +- 34 files changed, 327 insertions(+), 277 deletions(-) diff --git a/companion/src/comparedialog.cpp b/companion/src/comparedialog.cpp index 4b77ff9c6..78a29caba 100644 --- a/companion/src/comparedialog.cpp +++ b/companion/src/comparedialog.cpp @@ -76,7 +76,7 @@ void CompareDialog::printDiff() { te->clear(); printSetup(); - if (GetCurrentFirmware()->getCapability(FlightPhases)) { + if (GetCurrentFirmware()->getCapability(FlightModes)) { printPhases(); } printExpos(); @@ -309,7 +309,7 @@ void CompareDialog::printPhases() str.append(QString("
%1
"+tr("FM")+QString("%1 ").arg(i)); @@ -346,10 +346,10 @@ void CompareDialog::printPhases() if (gvars==1) { gvarnum=GetCurrentFirmware()->getCapability(Gvars); } - if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightPhases)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) { + if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightModes)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) { str.append("
"); str.append(""); - if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) { + if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) { str.append(QString(""); } @@ -357,7 +357,7 @@ void CompareDialog::printPhases() str.append(QString(""); } str.append(""); - if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) { + if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) { for (i=0; iGV%1
%2").arg(i+1).arg(g_model1->gvars_names[i])); } @@ -366,13 +366,13 @@ void CompareDialog::printPhases() str.append(QString("
").arg((i==0 ? 'A': 'B'))); } str.append(""); - for (i=0; igetCapability(FlightPhases); i++) { + for (i=0; igetCapability(FlightModes); i++) { PhaseData *pd1=&g_model1->phaseData[i]; PhaseData *pd2=&g_model2->phaseData[i]; str.append("").arg(pd1->name).arg(color)); - if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) { + if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) { for (k=0; kgvars[k],pd2->gvars[k]); if (pd1->gvars[k]<=1024) { @@ -411,7 +411,7 @@ void CompareDialog::printPhases() str.append(QString("").arg(getInputStr(*g_model1, i))); } str.append(""); - for (i=0; igetCapability(FlightPhases); i++) { + for (i=0; igetCapability(FlightModes); i++) { PhaseData *pd1=&g_model1->phaseData[i]; PhaseData *pd2=&g_model2->phaseData[i]; str.append("
 ").arg(gvarnum)+tr("Gvars")+"").arg(GetCurrentFirmware()->getCapability(RotaryEncoders))+tr("Rot. Enc.")+"
"+tr("Flight mode name")+"RE%1
"+tr("FM")+QString("%1 ").arg(i)); color=getColor1(pd1->name,pd2->name); str.append(QString("%1%1
"+tr("FM")+QString("%1 ").arg(i)); @@ -436,17 +436,17 @@ void CompareDialog::printPhases() } str.append("
"); - if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightPhases)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) { + if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightModes)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) { str.append("
"); str.append(""); - if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) { + if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) { str.append(QString(""); } if (GetCurrentFirmware()->getCapability(RotaryEncoders)) { str.append(QString(""); } str.append(""); - if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) { + if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) { for (i=0; iGV%1
%2").arg(i+1).arg(g_model2->gvars_names[i])); } @@ -455,13 +455,13 @@ void CompareDialog::printPhases() str.append(QString("
").arg((i==0 ? 'A': 'B'))); } str.append(""); - for (i=0; igetCapability(FlightPhases); i++) { + for (i=0; igetCapability(FlightModes); i++) { PhaseData *pd1=&g_model1->phaseData[i]; PhaseData *pd2=&g_model2->phaseData[i]; str.append("").arg(pd2->name).arg(color)); - if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) { + if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) { for (k=0; kgvars[k],pd2->gvars[k]); if (pd2->gvars[k]<=1024) { @@ -569,7 +569,7 @@ void CompareDialog::printGvars() gvarnum=GetCurrentFirmware()->getCapability(Gvars); } - if (!GetCurrentFirmware()->getCapability(GvarsFlightPhases) && (gvars==1 && GetCurrentFirmware()->getCapability(Gvars))) { + if (!GetCurrentFirmware()->getCapability(GvarsFlightModes) && (gvars==1 && GetCurrentFirmware()->getCapability(Gvars))) { QString str = "
 ").arg(gvarnum)+tr("Gvars")+"").arg(GetCurrentFirmware()->getCapability(RotaryEncoders))+tr("Rot. Enc.")+"
"+tr("Flight mode name")+"RE%1
"+tr("FM")+QString("%1 ").arg(i)); color=getColor1(pd1->name,pd2->name); str.append(QString("%1
"; str.append(""); str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + FrSkyData *fd=&g_model->frsky; + for (int i=0; i<2; i++) { + if (fd->channels[i].ratio!=0) { + tc++; + float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + } + } + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append(""); + str.append("

"+tr("Global Variables")+"

"); @@ -653,12 +653,12 @@ void CompareDialog::printExpos() str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight)).rightJustified(6, ' '); str += ed->curve.toString().replace("<", "<").replace(">", ">"); - if (GetCurrentFirmware()->getCapability(FlightPhases)) { + if (GetCurrentFirmware()->getCapability(FlightModes)) { if(ed->phases) { - if (ed->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { + if (ed->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { int mask=1; int first=0; - for (int i=0; igetCapability(FlightPhases);i++) { + for (int i=0; igetCapability(FlightModes);i++) { if (!(ed->phases & mask)) { first++; } @@ -671,7 +671,7 @@ void CompareDialog::printExpos() } mask=1; first=1; - for (int j=0; jgetCapability(FlightPhases);j++) { + for (int j=0; jgetCapability(FlightModes);j++) { if (!(ed->phases & mask)) { PhaseData *pd = &g_model1->phaseData[j]; if (!first) { @@ -731,12 +731,12 @@ void CompareDialog::printExpos() str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight)).rightJustified(6, ' '); str += ed->curve.toString().replace("<", "<").replace(">", ">"); - if (GetCurrentFirmware()->getCapability(FlightPhases)) { + if (GetCurrentFirmware()->getCapability(FlightModes)) { if(ed->phases) { - if (ed->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { + if (ed->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { int mask=1; int first=0; - for (int i=0; igetCapability(FlightPhases);i++) { + for (int i=0; igetCapability(FlightModes);i++) { if (!(ed->phases & mask)) { first++; } @@ -749,7 +749,7 @@ void CompareDialog::printExpos() } mask=1; first=1; - for (int j=0; jgetCapability(FlightPhases);j++) { + for (int j=0; jgetCapability(FlightModes);j++) { if (!(ed->phases & mask)) { PhaseData *pd = &g_model2->phaseData[j]; if (!first) { @@ -829,12 +829,12 @@ void CompareDialog::printMixers() if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale); if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale); if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn); - if (GetCurrentFirmware()->getCapability(FlightPhases)) { + if (GetCurrentFirmware()->getCapability(FlightModes)) { if(md->phases) { - if (md->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { + if (md->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { int mask=1; int first=0; - for (int i=0; igetCapability(FlightPhases);i++) { + for (int i=0; igetCapability(FlightModes);i++) { if (!(md->phases & mask)) { first++; } @@ -847,7 +847,7 @@ void CompareDialog::printMixers() } mask=1; first=1; - for (int j=0; jgetCapability(FlightPhases);j++) { + for (int j=0; jgetCapability(FlightModes);j++) { if (!(md->phases & mask)) { PhaseData *pd = &g_model1->phaseData[j]; if (!first) { @@ -908,12 +908,12 @@ void CompareDialog::printMixers() if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale); if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale); if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn); - if (GetCurrentFirmware()->getCapability(FlightPhases)) { + if (GetCurrentFirmware()->getCapability(FlightModes)) { if(md->phases) { - if (md->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { + if (md->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { int mask=1; int first=0; - for (int i=0; igetCapability(FlightPhases);i++) { + for (int i=0; igetCapability(FlightModes);i++) { if (!(md->phases & mask)) { first++; } @@ -926,7 +926,7 @@ void CompareDialog::printMixers() } mask=1; first=1; - for (int j=0; jgetCapability(FlightPhases);j++) { + for (int j=0; jgetCapability(FlightModes);j++) { if (!(md->phases & mask)) { PhaseData *pd = &g_model2->phaseData[j]; if (!first) { diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 6c7c626a3..4a04b563d 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -272,7 +272,7 @@ QString RawSource::toString() QObject::tr("ACC"), QObject::tr("Time"), }; - static const QString virtualSwitches[] = { + static const QString logicalSwitches[] = { QObject::tr("L1"), QObject::tr("L2"), QObject::tr("L3"), QObject::tr("L4"), QObject::tr("L5"), QObject::tr("L6"), QObject::tr("L7"), QObject::tr("L8"), QObject::tr("L9"), QObject::tr("L10"), QObject::tr("L11"), QObject::tr("L12"), QObject::tr("L13"), QObject::tr("L14"), QObject::tr("L15"), QObject::tr("L16"), QObject::tr("L17"), QObject::tr("L18"), QObject::tr("L19"), QObject::tr("L20"), QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"), @@ -302,7 +302,7 @@ QString RawSource::toString() case SOURCE_TYPE_SWITCH: return (IS_TARANIS(GetEepromInterface()->getBoard()) ? CHECK_IN_ARRAY(switchesX9D, index) : CHECK_IN_ARRAY(switches9X, index)); case SOURCE_TYPE_CUSTOM_SWITCH: - return virtualSwitches[index]; + return logicalSwitches[index]; case SOURCE_TYPE_CYC: return QObject::tr("CYC%1").arg(index+1); case SOURCE_TYPE_PPM: @@ -349,13 +349,17 @@ QString RawSwitch::toString() SwitchUp('H'), SwitchDn('H'), }; - static const QString virtualSwitches[] = { + static const QString logicalSwitches[] = { QObject::tr("L1"), QObject::tr("L2"), QObject::tr("L3"), QObject::tr("L4"), QObject::tr("L5"), QObject::tr("L6"), QObject::tr("L7"), QObject::tr("L8"), QObject::tr("L9"), QObject::tr("L10"), QObject::tr("L11"), QObject::tr("L12"), QObject::tr("L13"), QObject::tr("L14"), QObject::tr("L15"), QObject::tr("L16"), QObject::tr("L17"), QObject::tr("L18"), QObject::tr("L19"), QObject::tr("L20"), QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"), QObject::tr("L31"), QObject::tr("L32") }; + static const QString flightModes[] = { + QObject::tr("FM0"), QObject::tr("FM1"), QObject::tr("FM2"), QObject::tr("FM3"), QObject::tr("FM4"), QObject::tr("FM5"), QObject::tr("FM6"), QObject::tr("FM7"), QObject::tr("FM8") + }; + static const QString multiposPots[] = { QObject::tr("S11"), QObject::tr("S12"), QObject::tr("S13"), QObject::tr("S14"), QObject::tr("S15"), QObject::tr("S16"), QObject::tr("S21"), QObject::tr("S22"), QObject::tr("S23"), QObject::tr("S24"), QObject::tr("S25"), QObject::tr("S26"), @@ -389,7 +393,7 @@ QString RawSwitch::toString() else return CHECK_IN_ARRAY(switches9X, index-1); case SWITCH_TYPE_VIRTUAL: - return CHECK_IN_ARRAY(virtualSwitches, index-1); + return CHECK_IN_ARRAY(logicalSwitches, index-1); case SWITCH_TYPE_MULTIPOS_POT: return CHECK_IN_ARRAY(multiposPots, index-1); case SWITCH_TYPE_TRIM: @@ -400,6 +404,8 @@ QString RawSwitch::toString() return QObject::tr("ON"); case SWITCH_TYPE_OFF: return QObject::tr("OFF"); + case SWITCH_TYPE_FLIGHT_MODE: + return CHECK_IN_ARRAY(flightModes, index-1); case SWITCH_TYPE_NONE: return QObject::tr("----"); case SWITCH_TYPE_TIMER_MODE: @@ -1050,7 +1056,7 @@ void ModelData::clear() moduleData[0].protocol=PPM; moduleData[1].protocol=OFF; } - for (int i=0; i 125) { @@ -689,7 +689,7 @@ t_Gruvin9xModelData_v106::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { diff --git a/companion/src/firmwares/gruvin9x/gruvin9xeeprom.h b/companion/src/firmwares/gruvin9x/gruvin9xeeprom.h index 8886c83d1..7a763ef6a 100644 --- a/companion/src/firmwares/gruvin9x/gruvin9xeeprom.h +++ b/companion/src/firmwares/gruvin9x/gruvin9xeeprom.h @@ -277,7 +277,7 @@ PACK(typedef struct t_Gruvin9xTimerData { t_Gruvin9xTimerData() { memset(this, 0, sizeof(t_Gruvin9xTimerData)); } }) Gruvin9xTimerData; -#define G9X_MAX_PHASES 5 +#define G9X_MAX_FLIGHT_MODES 5 #define G9X_MAX_MIXERS 32 #define G9X_MAX_EXPOS 14 #define G9X_MAX_CURVE5 8 @@ -312,7 +312,7 @@ PACK(typedef struct t_Gruvin9xModelData_v102 { Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW]; Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT]; Gruvin9xSwashRingData swashR; - Gruvin9xPhaseData_v102 phaseData[G9X_MAX_PHASES]; + Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES]; Gruvin9xFrSkyData frsky; operator ModelData(); @@ -344,7 +344,7 @@ PACK(typedef struct t_Gruvin9xModelData_v103 { Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW]; Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT]; Gruvin9xSwashRingData swashR; - Gruvin9xPhaseData_v102 phaseData[G9X_MAX_PHASES]; + Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES]; Gruvin9xFrSkyData frsky; operator ModelData(); @@ -377,7 +377,7 @@ PACK(typedef struct t_Gruvin9xModelData_v105 { Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT]; Gruvin9xFuncSwData funcSw[G9X_NUM_FSW]; Gruvin9xSwashRingData swashR; - Gruvin9xPhaseData_v102 phaseData[G9X_MAX_PHASES]; + Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES]; int16_t subtrim[NUM_STICKS]; Gruvin9xFrSkyData frsky; @@ -409,7 +409,7 @@ PACK(typedef struct t_Gruvin9xModelData_v106 { Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT]; Gruvin9xFuncSwData funcSw[G9X_NUM_FSW]; Gruvin9xSwashRingData swashR; - Gruvin9xPhaseData_v106 phaseData[G9X_MAX_PHASES]; + Gruvin9xPhaseData_v106 phaseData[G9X_MAX_FLIGHT_MODES]; Gruvin9xFrSkyData frsky; operator ModelData(); diff --git a/companion/src/firmwares/opentx/open9xGruvin9xeeprom.cpp b/companion/src/firmwares/opentx/open9xGruvin9xeeprom.cpp index 6ec5f402d..c69aa61da 100644 --- a/companion/src/firmwares/opentx/open9xGruvin9xeeprom.cpp +++ b/companion/src/firmwares/opentx/open9xGruvin9xeeprom.cpp @@ -460,7 +460,7 @@ t_Open9xGruvin9xModelData_v207::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -545,7 +545,7 @@ t_Open9xGruvin9xModelData_v208::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -634,7 +634,7 @@ t_Open9xGruvin9xModelData_v209::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -724,7 +724,7 @@ t_Open9xGruvin9xModelData_v210::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -811,7 +811,7 @@ t_Open9xGruvin9xModelData_v211::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { diff --git a/companion/src/firmwares/opentx/open9xGruvin9xeeprom.h b/companion/src/firmwares/opentx/open9xGruvin9xeeprom.h index 214e2ef6d..5ae1d0377 100644 --- a/companion/src/firmwares/opentx/open9xGruvin9xeeprom.h +++ b/companion/src/firmwares/opentx/open9xGruvin9xeeprom.h @@ -197,7 +197,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 { Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xGruvin9xSwashRingData_v208 swashR; - Open9xGruvin9xPhaseData_v207 phaseData[O9X_MAX_PHASES]; + Open9xGruvin9xPhaseData_v207 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v205 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -231,7 +231,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 { Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW]; Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xGruvin9xSwashRingData_v208 swashR; - Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES]; + Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v208 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -270,7 +270,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 { Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW]; Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xGruvin9xSwashRingData_v209 swashR; - Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES]; + Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v208 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -310,7 +310,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 { Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW]; Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW]; Open9xGruvin9xSwashRingData_v209 swashR; - Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES]; + Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES]; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -348,7 +348,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 { Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW]; Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW]; Open9xGruvin9xSwashRingData_v209 swashR; - Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES]; + Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES]; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; diff --git a/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp b/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp index d50b42cf0..2ea5bfbe1 100644 --- a/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp +++ b/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp @@ -767,7 +767,7 @@ t_Open9xArmModelData_v208::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -856,7 +856,7 @@ t_Open9xArmModelData_v209::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -946,7 +946,7 @@ t_Open9xArmModelData_v210::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1030,7 +1030,7 @@ t_Open9xArmModelData_v211::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1117,7 +1117,7 @@ t_Open9xArmModelData_v212::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { diff --git a/companion/src/firmwares/opentx/open9xSky9xeeprom.h b/companion/src/firmwares/opentx/open9xSky9xeeprom.h index fdb3974ee..036f9f786 100644 --- a/companion/src/firmwares/opentx/open9xSky9xeeprom.h +++ b/companion/src/firmwares/opentx/open9xSky9xeeprom.h @@ -19,7 +19,7 @@ #include "open9xStockeeprom.h" -#define O9X_ARM_MAX_PHASES 9 +#define O9X_ARM_MAX_FLIGHT_MODES 9 #define O9X_ARM_MAX_MIXERS 64 #define O9X_ARM_MAX_EXPOS 32 #define O9X_ARM_NUM_CHNOUT 32 // number of real output channels CH1-CH16 @@ -346,7 +346,7 @@ PACK(typedef struct t_Open9xArmModelData_v208 { Open9xArmLogicalSwitchData_v208 customSw[O9X_ARM_NUM_CSW]; Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW]; Open9xArmSwashRingData_v208 swashR; - Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES]; + Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES]; Open9xFrSkyData_v208 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -385,7 +385,7 @@ PACK(typedef struct t_Open9xArmModelData_v209 { Open9xArmLogicalSwitchData_v209 customSw[O9X_ARM_NUM_CSW]; Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW]; Open9xArmSwashRingData_v209 swashR; - Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES]; + Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES]; Open9xFrSkyData_v208 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -425,7 +425,7 @@ PACK(typedef struct t_Open9xArmModelData_v210 { Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW]; Open9xArmFuncSwData_v210 funcSw[O9X_ARM_NUM_FSW]; Open9xArmSwashRingData_v209 swashR; - Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES]; + Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES]; Open9xArmFrSkyData_v210 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -464,7 +464,7 @@ PACK(typedef struct t_Open9xArmModelData_v211 { Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW]; Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW]; Open9xArmSwashRingData_v209 swashR; - Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES]; + Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES]; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -502,7 +502,7 @@ PACK(typedef struct t_Open9xArmModelData_v212 { Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW]; Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW]; Open9xArmSwashRingData_v210 swashR; - Open9xArmPhaseData_v212 phaseData[O9X_ARM_MAX_PHASES]; + Open9xArmPhaseData_v212 phaseData[O9X_ARM_MAX_FLIGHT_MODES]; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; diff --git a/companion/src/firmwares/opentx/open9xStockeeprom.cpp b/companion/src/firmwares/opentx/open9xStockeeprom.cpp index 8c8d1abc3..e44d4fb26 100644 --- a/companion/src/firmwares/opentx/open9xStockeeprom.cpp +++ b/companion/src/firmwares/opentx/open9xStockeeprom.cpp @@ -948,7 +948,7 @@ t_Open9xModelData_v201::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1022,7 +1022,7 @@ t_Open9xModelData_v202::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1098,7 +1098,7 @@ t_Open9xModelData_v203::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1172,7 +1172,7 @@ t_Open9xModelData_v204::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1251,7 +1251,7 @@ t_Open9xModelData_v205::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1337,7 +1337,7 @@ t_Open9xModelData_v208::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1430,7 +1430,7 @@ t_Open9xModelData_v209::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1524,7 +1524,7 @@ t_Open9xModelData_v210::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1612,7 +1612,7 @@ t_Open9xModelData_v211::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { diff --git a/companion/src/firmwares/opentx/open9xStockeeprom.h b/companion/src/firmwares/opentx/open9xStockeeprom.h index 8f121441e..41ad29c01 100644 --- a/companion/src/firmwares/opentx/open9xStockeeprom.h +++ b/companion/src/firmwares/opentx/open9xStockeeprom.h @@ -482,7 +482,7 @@ PACK(typedef struct t_Open9xTimerDataExtra { }) Open9xTimerDataExtra; #define O9X_MAX_TIMERS 2 -#define O9X_MAX_PHASES 5 +#define O9X_MAX_FLIGHT_MODES 5 #define O9X_MAX_MIXERS 32 #define O9X_MAX_EXPOS 14 #define O9X_NUM_CHNOUT 16 // number of real output channels CH1-CH16 @@ -520,7 +520,7 @@ PACK(typedef struct t_Open9xModelData_v201 { Open9xSafetySwData safetySw[O9X_NUM_CHNOUT]; Open9xFuncSwData_v201 funcSw[12]; Open9xSwashRingData_v208 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v201 frsky; operator ModelData(); @@ -551,7 +551,7 @@ PACK(typedef struct t_Open9xModelData_v202 { Open9xSafetySwData safetySw[O9X_NUM_CHNOUT]; Open9xFuncSwData_v201 funcSw[12]; Open9xSwashRingData_v208 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v202 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -584,7 +584,7 @@ PACK(typedef struct t_Open9xModelData_v203 { Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v208 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v202 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -617,7 +617,7 @@ PACK(typedef struct t_Open9xModelData_v204 { Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v208 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v204 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -650,7 +650,7 @@ PACK(typedef struct t_Open9xModelData_v205 { Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v208 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v205 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -685,7 +685,7 @@ PACK(typedef struct t_Open9xModelData_v208 { Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v208 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v208 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -724,7 +724,7 @@ PACK(typedef struct t_Open9xModelData_v209 { Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v209 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v208 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -764,7 +764,7 @@ PACK(typedef struct t_Open9xModelData_v210 { Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v209 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -802,7 +802,7 @@ PACK(typedef struct t_Open9xModelData_v211 { Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v209 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 911734919..5b0ba85b7 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -15,7 +15,7 @@ #define MAX_SWITCHES(board) (IS_TARANIS(board) ? 8 : 7) #define MAX_SWITCHES_POSITION(board) (IS_TARANIS(board) ? 22 : 9) #define MAX_ROTARY_ENCODERS(board) (board==BOARD_GRUVIN9X ? 2 : (board==BOARD_SKY9X ? 1 : 0)) -#define MAX_PHASES(board, version) (IS_ARM(board) ? 9 : (IS_DBLRAM(board, version) ? 6 : 5)) +#define MAX_FLIGHT_MODES(board, version) (IS_ARM(board) ? 9 : (IS_DBLRAM(board, version) ? 6 : 5)) #define MAX_MIXERS(board, version) (IS_ARM(board) ? 64 : 32) #define MAX_CHANNELS(board, version) (IS_ARM(board) ? 32 : 16) #define MAX_EXPOS(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 64 : 32) : (IS_DBLRAM(board, version) ? 16 : 14)) @@ -91,6 +91,13 @@ class SwitchesConversionTable: public ConversionTable { addConversion(RawSwitch(SWITCH_TYPE_ON), val++); } + if (IS_ARM(board)) { + for (int i=1; i<=MAX_FLIGHT_MODES(board, version); i++) { + addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, -i), -val+offset); + addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i), val++); + } + } + if (version < 216) { // previous "moment" switches for (int i=1; i<=MAX_SWITCHES_POSITION(board); i++) { @@ -2401,7 +2408,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne internalField.Append(new AvrCustomFunctionField(modelData.funcSw[i], board, version, variant)); } internalField.Append(new HeliField(modelData.swashRingData, board, version, variant)); - for (int i=0; igetCapability(FlightPhases); i<=GetCurrentFirmware()->getCapability(FlightPhases); i++) { + for (int i=-GetCurrentFirmware()->getCapability(FlightModes); i<=GetCurrentFirmware()->getCapability(FlightModes); i++) { if (i < 0) b->addItem(QObject::tr("!Flight mode %1").arg(-i-1), i); else if (i > 0) @@ -137,7 +137,7 @@ void populatePhasesCB(QComboBox *b, int value) else b->addItem(QObject::tr("----"), 0); } - b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightPhases)); + b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightModes)); } bool gvarsEnabled() @@ -344,7 +344,7 @@ void CurveGroup::valuesChanged() void populateGvarUseCB(QComboBox *b, unsigned int phase) { b->addItem(QObject::tr("Own value")); - for (int i=0; igetCapability(FlightPhases); i++) { + for (int i=0; igetCapability(FlightModes); i++) { if (i != (int)phase) { b->addItem(QObject::tr("Flight mode %1 value").arg(i)); } @@ -400,6 +400,13 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin b->clear(); if (attr & POPULATE_ONOFF) { + if (IS_ARM(GetCurrentFirmware()->getBoard())) { + for (int i=-GetCurrentFirmware()->getCapability(FlightModes); i<0; i++) { + item = RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i); + b->addItem(item.toString(), item.toValue()); + if (item == value) b->setCurrentIndex(b->count()-1); + } + } item = RawSwitch(SWITCH_TYPE_OFF); b->addItem(item.toString(), item.toValue()); if (item == value) b->setCurrentIndex(b->count()-1); @@ -490,6 +497,13 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin item = RawSwitch(SWITCH_TYPE_ON); b->addItem(item.toString(), item.toValue()); if (item == value) b->setCurrentIndex(b->count()-1); + if (IS_ARM(GetCurrentFirmware()->getBoard())) { + for (int i=1; i<=GetCurrentFirmware()->getCapability(FlightModes); i++) { + item = RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i); + b->addItem(item.toString(), item.toValue()); + if (item == value) b->setCurrentIndex(b->count()-1); + } + } } b->setMaxVisibleItems(10); @@ -835,7 +849,7 @@ QString getProtocol(ModelData * g_model) QString getPhasesStr(unsigned int phases, ModelData & model) { - int numphases = GetCurrentFirmware()->getCapability(FlightPhases); + int numphases = GetCurrentFirmware()->getCapability(FlightModes); if (numphases && phases) { QString str; diff --git a/companion/src/modeledit/expodialog.cpp b/companion/src/modeledit/expodialog.cpp index c1a5941dd..0d66f874a 100644 --- a/companion/src/modeledit/expodialog.cpp +++ b/companion/src/modeledit/expodialog.cpp @@ -29,7 +29,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G ui->sideCB->setCurrentIndex(ed->mode-1); - if (!firmware->getCapability(FlightPhases)) { + if (!firmware->getCapability(FlightModes)) { ui->label_phases->hide(); for (int i=0; i<9; i++) { lb_fp[i]->hide(); @@ -44,7 +44,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G } mask <<= 1; } - for (int i=firmware->getCapability(FlightPhases); i<9;i++) { + for (int i=firmware->getCapability(FlightModes); i<9;i++) { lb_fp[i]->hide(); cb_fp[i]->hide(); } @@ -154,11 +154,11 @@ void ExpoDialog::valuesChanged() ed->phases<<=1; } ed->phases>>=1; - if (firmware->getCapability(FlightPhases)) { + if (firmware->getCapability(FlightModes)) { int zeros=0; int ones=0; int phtemp=ed->phases; - for (int i=0; igetCapability(FlightPhases); i++) { + for (int i=0; igetCapability(FlightModes); i++) { if (phtemp & 1) { ones++; } @@ -169,7 +169,7 @@ void ExpoDialog::valuesChanged() } if (zeros==1) { phtemp=ed->phases; - for (int i=0; igetCapability(FlightPhases); i++) { + for (int i=0; igetCapability(FlightModes); i++) { if ((phtemp & 1)==0) { break; } @@ -178,7 +178,7 @@ void ExpoDialog::valuesChanged() } else if (ones==1) { phtemp=ed->phases; - for (int i=0; igetCapability(FlightPhases); i++) { + for (int i=0; igetCapability(FlightModes); i++) { if (phtemp & 1) { break; } diff --git a/companion/src/modeledit/flightmodes.cpp b/companion/src/modeledit/flightmodes.cpp index fee46f2ea..e8e93fb24 100644 --- a/companion/src/modeledit/flightmodes.cpp +++ b/companion/src/modeledit/flightmodes.cpp @@ -5,7 +5,7 @@ #include #include -FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware): +FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware): ModelPanel(parent, model, generalSettings, firmware), ui(new Ui::FlightMode), phaseIdx(phaseIdx), @@ -16,7 +16,7 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera { ui->setupUi(this); - int modesCount = firmware->getCapability(FlightPhases); + int modesCount = firmware->getCapability(FlightModes); // Phase name QRegExp rx(CHAR_FOR_NAMES_REGEX); @@ -39,7 +39,7 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera } // FadeIn / FadeOut - if (firmware->getCapability(FlightPhasesHaveFades)) { + if (firmware->getCapability(FlightModesHaveFades)) { int scale = firmware->getCapability(SlowScale); int range = firmware->getCapability(SlowRange); ui->fadeIn->setMaximum(float(range)/scale); @@ -174,12 +174,12 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera update(); } -FlightMode::~FlightMode() +FlightModePanel::~FlightModePanel() { delete ui; } -void FlightMode::update() +void FlightModePanel::update() { ui->name->setText(phase.name); @@ -232,7 +232,7 @@ void FlightMode::update() } } -void FlightMode::phaseName_editingFinished() +void FlightModePanel::phaseName_editingFinished() { QLineEdit *lineEdit = qobject_cast(sender()); strcpy(phase.name, lineEdit->text().toAscii()); @@ -240,14 +240,14 @@ void FlightMode::phaseName_editingFinished() emit nameModified(); } -void FlightMode::phaseSwitch_currentIndexChanged(int index) +void FlightModePanel::phaseSwitch_currentIndexChanged(int index) { QComboBox *comboBox = qobject_cast(sender()); phase.swtch = RawSwitch(comboBox->itemData(index).toInt()); emit modified(); } -void FlightMode::phaseFadeIn_editingFinished() +void FlightModePanel::phaseFadeIn_editingFinished() { QDoubleSpinBox *spinBox = qobject_cast(sender()); int scale = firmware->getCapability(SlowScale); @@ -255,7 +255,7 @@ void FlightMode::phaseFadeIn_editingFinished() emit modified(); } -void FlightMode::phaseFadeOut_editingFinished() +void FlightModePanel::phaseFadeOut_editingFinished() { QDoubleSpinBox *spinBox = qobject_cast(sender()); int scale = firmware->getCapability(SlowScale); @@ -263,7 +263,7 @@ void FlightMode::phaseFadeOut_editingFinished() emit modified(); } -void FlightMode::trimUpdate(unsigned int trim) +void FlightModePanel::trimUpdate(unsigned int trim) { lock = true; int chn = CONVERT_MODE(trim+1)-1; @@ -283,7 +283,7 @@ void FlightMode::trimUpdate(unsigned int trim) lock = false; } -void FlightMode::phaseGVValue_editingFinished() +void FlightModePanel::phaseGVValue_editingFinished() { if (!lock) { QSpinBox *spinBox = qobject_cast(sender()); @@ -293,7 +293,7 @@ void FlightMode::phaseGVValue_editingFinished() } } -void FlightMode::GVName_editingFinished() +void FlightModePanel::GVName_editingFinished() { if (!lock) { QLineEdit *lineedit = qobject_cast(sender()); @@ -304,7 +304,7 @@ void FlightMode::GVName_editingFinished() } } -void FlightMode::GVSource_currentIndexChanged(int index) +void FlightModePanel::GVSource_currentIndexChanged(int index) { QComboBox *comboBox = qobject_cast(sender()); int gvar = comboBox->property("index").toInt(); @@ -312,7 +312,7 @@ void FlightMode::GVSource_currentIndexChanged(int index) emit modified(); } -void FlightMode::phaseGVUse_currentIndexChanged(int index) +void FlightModePanel::phaseGVUse_currentIndexChanged(int index) { if (!lock) { lock = true; @@ -330,14 +330,14 @@ void FlightMode::phaseGVUse_currentIndexChanged(int index) } } -void FlightMode::phaseGVPopupToggled(bool checked) +void FlightModePanel::phaseGVPopupToggled(bool checked) { QCheckBox *cb = qobject_cast(sender()); int gvar = cb->property("index").toInt(); model.gvars_popups[gvar] = checked; } -void FlightMode::phaseREValue_editingFinished() +void FlightModePanel::phaseREValue_editingFinished() { if (!lock) { QSpinBox *spinBox = qobject_cast(sender()); @@ -347,7 +347,7 @@ void FlightMode::phaseREValue_editingFinished() } } -void FlightMode::phaseREUse_currentIndexChanged(int index) +void FlightModePanel::phaseREUse_currentIndexChanged(int index) { if (!lock) { lock = true; @@ -365,7 +365,7 @@ void FlightMode::phaseREUse_currentIndexChanged(int index) } } -void FlightMode::phaseTrimUse_currentIndexChanged(int index) +void FlightModePanel::phaseTrimUse_currentIndexChanged(int index) { if (!lock) { QComboBox *comboBox = qobject_cast(sender()); @@ -387,7 +387,7 @@ void FlightMode::phaseTrimUse_currentIndexChanged(int index) } } -void FlightMode::phaseTrim_valueChanged() +void FlightModePanel::phaseTrim_valueChanged() { if (!lock) { QSpinBox *spinBox = qobject_cast(sender()); @@ -402,7 +402,7 @@ void FlightMode::phaseTrim_valueChanged() } } -void FlightMode::phaseTrimSlider_valueChanged() +void FlightModePanel::phaseTrimSlider_valueChanged() { if (!lock) { QSlider *slider = qobject_cast(sender()); @@ -419,14 +419,14 @@ void FlightMode::phaseTrimSlider_valueChanged() /**********************************************************/ -FlightModes::FlightModes(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware): +FlightModesPanel::FlightModesPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware): ModelPanel(parent, model, generalSettings, firmware), - modesCount(firmware->getCapability(FlightPhases)) + modesCount(firmware->getCapability(FlightModes)) { QGridLayout * gridLayout = new QGridLayout(this); tabWidget = new QTabWidget(this); for (int i=0; isetProperty("index", i); panels << tab; connect(tab, SIGNAL(modified()), this, SLOT(onPhaseModified())); @@ -437,16 +437,16 @@ FlightModes::FlightModes(QWidget * parent, ModelData & model, GeneralSettings & connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(on_tabWidget_currentChanged(int))); } -FlightModes::~FlightModes() +FlightModesPanel::~FlightModesPanel() { } -void FlightModes::onPhaseModified() +void FlightModesPanel::onPhaseModified() { emit modified(); } -QString FlightModes::getTabName(int index) +QString FlightModesPanel::getTabName(int index) { QString result = tr("Flight Mode %1").arg(index); const char *name = model.phaseData[index].name; @@ -460,18 +460,18 @@ QString FlightModes::getTabName(int index) return result; } -void FlightModes::onPhaseNameChanged() +void FlightModesPanel::onPhaseNameChanged() { int index = sender()->property("index").toInt(); tabWidget->setTabText(index, getTabName(index)); } -void FlightModes::update() +void FlightModesPanel::update() { on_tabWidget_currentChanged(tabWidget->currentIndex()); } -void FlightModes::on_tabWidget_currentChanged(int index) +void FlightModesPanel::on_tabWidget_currentChanged(int index) { panels[index]->update(); } diff --git a/companion/src/modeledit/flightmodes.h b/companion/src/modeledit/flightmodes.h index 618040f4b..e2127ac5c 100644 --- a/companion/src/modeledit/flightmodes.h +++ b/companion/src/modeledit/flightmodes.h @@ -13,13 +13,13 @@ namespace Ui { class FlightMode; } -class FlightMode : public ModelPanel +class FlightModePanel : public ModelPanel { Q_OBJECT public: - FlightMode(QWidget *parent, ModelData &model, int modeIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware); - virtual ~FlightMode(); + FlightModePanel(QWidget *parent, ModelData &model, int modeIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware); + virtual ~FlightModePanel(); virtual void update(); @@ -61,13 +61,13 @@ class FlightMode : public ModelPanel }; -class FlightModes : public ModelPanel +class FlightModesPanel : public ModelPanel { Q_OBJECT public: - FlightModes(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware); - virtual ~FlightModes(); + FlightModesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware); + virtual ~FlightModesPanel(); virtual void update(); @@ -80,7 +80,7 @@ class FlightModes : public ModelPanel int modesCount; QTabWidget *tabWidget; QString getTabName(int index); - QVector panels; + QVector panels; }; diff --git a/companion/src/modeledit/mixerdialog.cpp b/companion/src/modeledit/mixerdialog.cpp index 4423df656..c1a7fc4cb 100644 --- a/companion/src/modeledit/mixerdialog.cpp +++ b/companion/src/modeledit/mixerdialog.cpp @@ -55,7 +55,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G ui->mixerName->setValidator(new QRegExpValidator(rx, this)); ui->mixerName->setText(md->name); - if (!firmware->getCapability(FlightPhases)) { + if (!firmware->getCapability(FlightModes)) { ui->label_phases->hide(); for (int i=0; i<9; i++) { lb_fp[i]->hide(); @@ -70,7 +70,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G } mask <<= 1; } - for (int i=firmware->getCapability(FlightPhases); i<9;i++) { + for (int i=firmware->getCapability(FlightModes); i<9;i++) { lb_fp[i]->hide(); cb_fp[i]->hide(); } diff --git a/companion/src/modeledit/modeledit.cpp b/companion/src/modeledit/modeledit.cpp index 0bccd5512..a7c9cfbcd 100644 --- a/companion/src/modeledit/modeledit.cpp +++ b/companion/src/modeledit/modeledit.cpp @@ -29,7 +29,7 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw SetupPanel * setupPanel = new SetupPanel(this, model, generalSettings, firmware); addTab(setupPanel, tr("Setup")); addTab(new HeliPanel(this, model, generalSettings, firmware), tr("Heli")); - addTab(new FlightModes(this, model, generalSettings, firmware), tr("Flight Modes")); + addTab(new FlightModesPanel(this, model, generalSettings, firmware), tr("Flight Modes")); addTab(new InputsPanel(this, model, generalSettings, firmware), tr("Inputs")); addTab(new MixesPanel(this, model, generalSettings, firmware), tr("Mixes")); Channels * chnPanel = new Channels(this, model, generalSettings, firmware); diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index a6e6177e0..37771105a 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -124,7 +124,7 @@ void PrintDialog::printSetup() gvars=1; } QString str = ""; - str.append(QString(""; +} + +QString doTR(const QString s, const QString color="", bool bold=false) +{ + QString str = s; + if(bold) str = "" + str + ""; + if(!color.isEmpty()) str = "" + str + ""; + return ""; +} + +QString doTL(const QString s, const QString color="", bool bold=false) +{ + QString str = s; + if(bold) str = "" + str + ""; + if(!color.isEmpty()) str = "" + str + ""; + return ""; +} + +QString PrintDialog::fv(const QString name, const QString value) +{ + return "" + name + ": " + value + "
"; +} + +void PrintDialog::printSetup() +{ + QString str = "
"); + QString labels[] = { tr("Rud"), tr("Ele"), tr("Thr"), tr("Ail") }; // TODO is elsewhere for sure for (int i=0; i<4; i++) { - str.append(QString("").arg(getInputStr(*g_model, i))); + GeneralSettings generalSettings = *g_eeGeneral; + str.append(QString("").arg(labels[CONVERT_MODE(i+1)-1])); } if (gvars) { for (unsigned int i=0; iRE%1").arg((i==0 ? 'A': 'B'))); } str.append(""); + for (int i=0; igetCapability(FlightPhases); i++) { PhaseData *pd=&g_model->phaseData[i]; - str.append("").arg(i).arg(pd->name).arg(pd->fadeIn).arg(pd->fadeOut)); + str.append("").arg(i).arg(pd->name)); + str.append(QString("").arg((qreal)pd->fadeIn/firmware->getCapability(SlowScale))); + str.append(QString("").arg((qreal)pd->fadeOut/firmware->getCapability(SlowScale))); for (int k=0; k<4; k++) { //TODO trim values if (pd->trimRef[k]==-1) { From 61addd3d4e500b636fb3ceb2c9ac323f0e1db5ca Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Mon, 5 May 2014 22:13:24 +0200 Subject: [PATCH 60/79] Merge branch 'next' --- DONATIONS.txt | 5 +- companion/src/comparedialog.cpp | 60 +- companion/src/eeprominterface.cpp | 24 +- companion/src/eeprominterface.h | 13 +- .../src/firmwares/gruvin9x/gruvin9xeeprom.cpp | 8 +- .../src/firmwares/gruvin9x/gruvin9xeeprom.h | 10 +- .../firmwares/opentx/open9xGruvin9xeeprom.cpp | 10 +- .../firmwares/opentx/open9xGruvin9xeeprom.h | 10 +- .../firmwares/opentx/open9xSky9xeeprom.cpp | 10 +- .../src/firmwares/opentx/open9xSky9xeeprom.h | 12 +- .../firmwares/opentx/open9xStockeeprom.cpp | 18 +- .../src/firmwares/opentx/open9xStockeeprom.h | 20 +- .../src/firmwares/opentx/opentxeeprom.cpp | 11 +- companion/src/firmwares/opentx/opentxeeprom.h | 4 +- .../src/firmwares/opentx/opentxinterface.cpp | 8 +- companion/src/helpers.cpp | 22 +- companion/src/modeledit/customfunctions.cpp | 10 +- companion/src/modeledit/expodialog.cpp | 12 +- companion/src/modeledit/flightmodes.cpp | 58 +- companion/src/modeledit/flightmodes.h | 14 +- companion/src/modeledit/mixerdialog.cpp | 4 +- companion/src/modeledit/modeledit.cpp | 2 +- companion/src/printdialog.cpp | 1747 ++++++++--------- companion/src/printdialog.h | 2 +- companion/src/simulation/simulatordialog.cpp | 8 +- companion/src/xmlinterface.cpp | 2 +- radio/src/Makefile | 4 +- radio/src/audio_arm.cpp | 4 +- radio/src/eeprom_conversions.cpp | 2 +- radio/src/gtests.cpp | 8 +- radio/src/gui/menu_model.cpp | 77 +- radio/src/gui/menus.cpp | 12 +- radio/src/gui/view_main.cpp | 6 +- radio/src/lcd.cpp | 7 +- radio/src/lcd.h | 2 +- radio/src/lua.cpp | 27 +- radio/src/myeeprom.h | 45 +- radio/src/opentx.cpp | 139 +- radio/src/opentx.h | 3 +- radio/src/targets/sky9x/board_sky9x.cpp | 13 +- radio/src/targets/taranis/trainer_driver.cpp | 7 +- radio/src/translations/se.h.txt | 16 +- 42 files changed, 1291 insertions(+), 1185 deletions(-) diff --git a/DONATIONS.txt b/DONATIONS.txt index 102ad1541..233693225 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -133,7 +133,7 @@ Eric Burdis Nigel Chippindale Michael Deasy Stephen Stough -Kenneth Lilja +Kenneth Lilja (monthly) Robert Jero Gary Bancroft Robert Cotsford @@ -386,3 +386,6 @@ Wilco Hijink Roy Nixon Lexington S Morley Daryl Dacko +Beat Zurflueh +Piotr Kundu +Kevin Berkefeld diff --git a/companion/src/comparedialog.cpp b/companion/src/comparedialog.cpp index 4b77ff9c6..78a29caba 100644 --- a/companion/src/comparedialog.cpp +++ b/companion/src/comparedialog.cpp @@ -76,7 +76,7 @@ void CompareDialog::printDiff() { te->clear(); printSetup(); - if (GetCurrentFirmware()->getCapability(FlightPhases)) { + if (GetCurrentFirmware()->getCapability(FlightModes)) { printPhases(); } printExpos(); @@ -309,7 +309,7 @@ void CompareDialog::printPhases() str.append(QString("").arg(getInputStr(*g_model1, i))); } str.append(""); - for (i=0; igetCapability(FlightPhases); i++) { + for (i=0; igetCapability(FlightModes); i++) { PhaseData *pd1=&g_model1->phaseData[i]; PhaseData *pd2=&g_model2->phaseData[i]; str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - FrSkyData *fd=&g_model->frsky; - for (int i=0; i<2; i++) { - if (fd->channels[i].ratio!=0) { - tc++; - float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - } - } - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append(""); - str.append("

").arg((firmware->getCapability(FlightPhases) && gvars==0) ? 2 : 1)); + str.append(QString("

").arg((i==0 ? 'A': 'B'))); } str.append(""); - for (int i=0; igetCapability(FlightPhases); i++) { + for (int i=0; igetCapability(FlightModes); i++) { PhaseData *pd=&g_model->phaseData[i]; str.append("").arg(i).arg(pd->name).arg(pd->fadeIn).arg(pd->fadeOut)); for (int k=0; k<4; k++) { @@ -265,12 +265,12 @@ void PrintDialog::printExpo() str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight,true)).rightJustified(6, ' '); str += ed->curve.toString().replace("<", "<").replace(">", ">"); - if (firmware->getCapability(FlightPhases)) { + if (firmware->getCapability(FlightModes)) { if(ed->phases) { - if (ed->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { + if (ed->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { int mask=1; int first=0; - for (int i=0; igetCapability(FlightPhases);i++) { + for (int i=0; igetCapability(FlightModes);i++) { if (!(ed->phases & mask)) { first++; } @@ -283,7 +283,7 @@ void PrintDialog::printExpo() } mask=1; first=1; - for (int j=0; jgetCapability(FlightPhases);j++) { + for (int j=0; jgetCapability(FlightModes);j++) { if (!(ed->phases & mask)) { PhaseData *pd = &g_model->phaseData[j]; if (!first) { @@ -361,12 +361,12 @@ void PrintDialog::printMixes() if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale); if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale); if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn); - if (firmware->getCapability(FlightPhases)) { + if (firmware->getCapability(FlightModes)) { if(md->phases) { - if (md->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { + if (md->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { int mask=1; int first=0; - for (int i=0; igetCapability(FlightPhases); i++) { + for (int i=0; igetCapability(FlightModes); i++) { if (!(md->phases & mask)) { first++; } @@ -379,7 +379,7 @@ void PrintDialog::printMixes() } mask=1; first=1; - for (int j=0; jgetCapability(FlightPhases);j++) { + for (int j=0; jgetCapability(FlightModes);j++) { if (!(md->phases & mask)) { PhaseData *pd = &g_model->phaseData[j]; if (!first) { @@ -658,7 +658,7 @@ void PrintDialog::printGvars() gvars=1; gvarnum=firmware->getCapability(Gvars); } - if (!firmware->getCapability(GvarsFlightPhases) && (gvars==1 && firmware->getCapability(Gvars))) { + if (!firmware->getCapability(GvarsFlightModes) && (gvars==1 && firmware->getCapability(Gvars))) { QString str = "

").arg((firmware->getCapability(FlightModes) && gvars==0) ? 2 : 1)); str.append(g_model->name); str.append(" ("); str.append(firmware->getEepromInterface()->getName()); @@ -157,7 +157,7 @@ QString PrintDialog::printPhases() int gvars=0; int gvarnum=0; if ((GetCurrentFirmwareVariant() & GVARS_VARIANT ) || (!firmware->getCapability(HasVariants) && firmware->getCapability(Gvars))) { - if (firmware->getCapability(GvarsFlightPhases)) { + if (firmware->getCapability(GvarsFlightModes)) { gvars=1; gvarnum=firmware->getCapability(Gvars); } @@ -189,7 +189,7 @@ QString PrintDialog::printPhases() str.append(QString("

RE%1
"+tr("FM")+QString("%1 %2%3%4
"; str.append(""); str.append("

"+tr("Global Variables")+"

"); diff --git a/companion/src/xmlinterface.cpp b/companion/src/xmlinterface.cpp index 0c6185d96..8e1701ebe 100644 --- a/companion/src/xmlinterface.cpp +++ b/companion/src/xmlinterface.cpp @@ -155,7 +155,7 @@ void saveModel(ModelData & m, model & xm) phases xphases; phases::phase_sequence & phases_sequence (xphases.phase()); - for (int i=0; i-[on|off].wav - for (int i=0; istart, 60); switch (m_posHorz) { case 0: - CHECK_INCDEC_MODELVAR(event, timer->mode, SWSRC_FIRST, TMR_VAROFS+SWSRC_LAST-1/*--- which is OFF*/); + CHECK_INCDEC_MODELVAR(event, timer->mode, SWSRC_FIRST, TMR_VAROFS+SWSRC_LAST-1); break; case 1: CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 59); @@ -1108,7 +1108,7 @@ void menuModelSetup(uint8_t event) s_editMode = 0; if (event==EVT_KEY_LONG(KEY_ENTER)) { s_noHi = NO_HI_LEN; - for (uint8_t i=0; i EXPO_ONE_2ND_COLUMN-FW))) continue; @@ -1835,14 +1835,14 @@ bool isTrimModeAvailable(int mode) void menuModelFlightModesAll(uint8_t event) { - MENU(STR_MENUFLIGHTPHASES, menuTabModel, e_FlightModesAll, 1+MAX_PHASES+1, {0, NAVIGATION_LINE_BY_LINE|(ITEM_PHASES_LAST-5), NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, 0}); + MENU(STR_MENUFLIGHTPHASES, menuTabModel, e_FlightModesAll, 1+MAX_FLIGHT_MODES+1, {0, NAVIGATION_LINE_BY_LINE|(ITEM_PHASES_LAST-5), NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, 0}); int8_t sub = m_posVert - 1; horzpos_t posHorz = m_posHorz; if (sub==0 && posHorz > 0) { posHorz += 5; } - if (sub=0) { + if (sub=0) { displayColumnHeader(STR_PHASES_HEADERS, posHorz); } @@ -1850,11 +1850,11 @@ void menuModelFlightModesAll(uint8_t event) uint8_t y = 1 + (i+1)*FH; uint8_t k = i+s_pgOfs; - if (k==MAX_PHASES) { + if (k==MAX_FLIGHT_MODES) { // last line available - add the "check trims" line lcd_putsLeft((LCD_LINES-1)*FH+1, STR_CHECKTRIMS); - putsFlightPhase(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, s_perout_flight_phase+1); - if (sub==MAX_PHASES && !trimsCheckTimer) { + putsFlightMode(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, s_perout_flight_mode+1); + if (sub==MAX_FLIGHT_MODES && !trimsCheckTimer) { lcd_status_line(); } return; @@ -1862,7 +1862,7 @@ void menuModelFlightModesAll(uint8_t event) PhaseData *p = phaseAddress(k); - putsFlightPhase(0, y, k+1, (getFlightPhase()==k ? BOLD : 0) | ((sub==k && m_posHorz<0) ? INVERS : 0)); + putsFlightMode(0, y, k+1, (getFlightPhase()==k ? BOLD : 0) | ((sub==k && m_posHorz<0) ? INVERS : 0)); for (uint8_t j=0; j0) ? BLINK|INVERS : INVERS) : 0); @@ -1878,7 +1878,7 @@ void menuModelFlightModesAll(uint8_t event) } else { putsSwitches((5+LEN_FP_NAME)*FW+FW/2, y, p->swtch, attr); - if (active) CHECK_INCDEC_MODELSWITCH(event, p->swtch, SWSRC_FIRST, SWSRC_LAST); + if (active) CHECK_INCDEC_MODELSWITCH(event, p->swtch, SWSRC_FIRST_SHORT_LIST, SWSRC_LAST_SHORT_LIST); } break; @@ -1891,7 +1891,7 @@ void menuModelFlightModesAll(uint8_t event) putsTrimMode((4+LEN_FP_NAME)*FW+j*(5*FW/2), y, k, t, attr); if (active) { trim_t & v = p->trim[t]; - v.mode = checkIncDec(event, v.mode==TRIM_MODE_NONE ? -1 : v.mode, -1, 2*MAX_PHASES-1, EE_MODEL, isTrimModeAvailable); + v.mode = checkIncDec(event, v.mode==TRIM_MODE_NONE ? -1 : v.mode, -1, 2*MAX_FLIGHT_MODES-1, EE_MODEL, isTrimModeAvailable); } } break; @@ -1933,7 +1933,7 @@ enum menuModelPhaseItems { void menuModelPhaseOne(uint8_t event) { PhaseData *phase = phaseAddress(s_currIdx); - putsFlightPhase(13*FW, 0, s_currIdx+1, (getFlightPhase()==s_currIdx ? BOLD : 0)); + putsFlightMode(13*FW, 0, s_currIdx+1, (getFlightPhase()==s_currIdx ? BOLD : 0)); #if defined(GVARS) && !defined(PCBSTD) static const pm_uint8_t mstate_tab_phase1[] PROGMEM = {0, 0, 0, (uint8_t)-1, 1, 1, 1, 1, 1}; @@ -1979,7 +1979,7 @@ void menuModelPhaseOne(uint8_t event) if (attr && m_posHorz==t && ((editMode>0) || p1valdiff)) { int16_t v = getRawTrimValue(s_currIdx, t); if (v < TRIM_EXTENDED_MAX) v = TRIM_EXTENDED_MAX; - v = checkIncDec(event, v, TRIM_EXTENDED_MAX, TRIM_EXTENDED_MAX+MAX_PHASES-1, EE_MODEL); + v = checkIncDec(event, v, TRIM_EXTENDED_MAX, TRIM_EXTENDED_MAX+MAX_FLIGHT_MODES-1, EE_MODEL); if (checkIncDec_Ret) { if (v == TRIM_EXTENDED_MAX) v = 0; setTrimValue(s_currIdx, t, v); @@ -2004,7 +2004,7 @@ void menuModelPhaseOne(uint8_t event) int16_t v = phaseAddress(s_currIdx)->rotaryEncoders[t]; #endif if (v < ROTARY_ENCODER_MAX) v = ROTARY_ENCODER_MAX; - v = checkIncDec(event, v, ROTARY_ENCODER_MAX, ROTARY_ENCODER_MAX+MAX_PHASES-1, EE_MODEL); + v = checkIncDec(event, v, ROTARY_ENCODER_MAX, ROTARY_ENCODER_MAX+MAX_FLIGHT_MODES-1, EE_MODEL); if (checkIncDec_Ret) { if (v == ROTARY_ENCODER_MAX) v = 0; #if ROTARY_ENCODERS > 2 @@ -2048,14 +2048,14 @@ void menuModelPhaseOne(uint8_t event) if (v > GVAR_MAX) { uint8_t p = v - GVAR_MAX - 1; if (p >= s_currIdx) p++; - putsFlightPhase(11*FW, y, p+1, posHorz==1 ? attr : 0); + putsFlightMode(11*FW, y, p+1, posHorz==1 ? attr : 0); } else { lcd_putsAtt(11*FW, y, STR_OWN, posHorz==1 ? attr : 0); } if (attr && s_currIdx>0 && posHorz==1 && (editMode>0 || p1valdiff)) { if (v < GVAR_MAX) v = GVAR_MAX; - v = checkIncDec(event, v, GVAR_MAX, GVAR_MAX+MAX_PHASES-1, EE_MODEL); + v = checkIncDec(event, v, GVAR_MAX, GVAR_MAX+MAX_FLIGHT_MODES-1, EE_MODEL); if (checkIncDec_Ret) { if (v == GVAR_MAX) v = 0; phase->gvars[idx] = v; @@ -2095,20 +2095,20 @@ void menuModelPhaseOne(uint8_t event) void menuModelFlightModesAll(uint8_t event) { - SIMPLE_MENU(STR_MENUFLIGHTPHASES, menuTabModel, e_FlightModesAll, 1+MAX_PHASES+1); + SIMPLE_MENU(STR_MENUFLIGHTPHASES, menuTabModel, e_FlightModesAll, 1+MAX_FLIGHT_MODES+1); int8_t sub = m_posVert - 1; switch (event) { CASE_EVT_ROTARY_BREAK case EVT_KEY_FIRST(KEY_ENTER): - if (sub == MAX_PHASES) { + if (sub == MAX_FLIGHT_MODES) { s_editMode = 0; trimsCheckTimer = 200; // 2 seconds } // no break case EVT_KEY_FIRST(KEY_RIGHT): - if (sub >= 0 && sub < MAX_PHASES) { + if (sub >= 0 && sub < MAX_FLIGHT_MODES) { s_currIdx = sub; pushMenu(menuModelPhaseOne); } @@ -2116,7 +2116,7 @@ void menuModelFlightModesAll(uint8_t event) } uint8_t att; - for (uint8_t i=0; i(LCD_LINES-1)*FH+1) continue; @@ -2126,9 +2126,9 @@ void menuModelFlightModesAll(uint8_t event) att = (i==sub ? INVERS : 0); PhaseData *p = phaseAddress(i); #if ROTARY_ENCODERS > 2 - putsFlightPhase(0, y, i+1, att|CONDENSED|(getFlightPhase()==i ? BOLD : 0)); + putsFlightMode(0, y, i+1, att|CONDENSED|(getFlightPhase()==i ? BOLD : 0)); #else - putsFlightPhase(0, y, i+1, att|(getFlightPhase()==i ? BOLD : 0)); + putsFlightMode(0, y, i+1, att|(getFlightPhase()==i ? BOLD : 0)); #endif lcd_putsnAtt(4*FW+NAME_OFS, y, p->name, sizeof(p->name), ZCHAR); @@ -2153,12 +2153,12 @@ void menuModelFlightModesAll(uint8_t event) } #if defined(CPUARM) - if (s_pgOfs != MAX_PHASES-(LCD_LINES-2)) return; + if (s_pgOfs != MAX_FLIGHT_MODES-(LCD_LINES-2)) return; #endif lcd_putsLeft((LCD_LINES-1)*FH+1, STR_CHECKTRIMS); - putsFlightPhase(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, s_perout_flight_phase+1); - if (sub==MAX_PHASES && !trimsCheckTimer) { + putsFlightMode(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, s_perout_flight_mode+1); + if (sub==MAX_FLIGHT_MODES && !trimsCheckTimer) { lcd_status_line(); } } @@ -2910,7 +2910,7 @@ void menuModelExpoOne(uint8_t event) putsMixerSource(7*FW+FW/2, 0, MIXSRC_Rud+ed->chn, 0); #endif - SUBMENU(STR_MENUINPUTS, EXPO_FIELD_MAX, {CASE_PCBTARANIS(0) IF_CPUARM(0) CASE_PCBTARANIS(0) CASE_PCBTARANIS((ed->srcRaw >= MIXSRC_FIRST_TELEM ? (uint8_t)0 : (uint8_t)HIDDEN_ROW)) 0, CASE_PCBTARANIS(0) CASE_9X(0) IF_CURVES(CURVE_ROWS) IF_FLIGHT_MODES((MAX_PHASES-1) | NAVIGATION_LINE_BY_LINE) 0 /*, ...*/}); + SUBMENU(STR_MENUINPUTS, EXPO_FIELD_MAX, {CASE_PCBTARANIS(0) IF_CPUARM(0) CASE_PCBTARANIS(0) CASE_PCBTARANIS((ed->srcRaw >= MIXSRC_FIRST_TELEM ? (uint8_t)0 : (uint8_t)HIDDEN_ROW)) 0, CASE_PCBTARANIS(0) CASE_9X(0) IF_CURVES(CURVE_ROWS) IF_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0 /*, ...*/}); SET_SCROLLBAR_X(EXPO_ONE_2ND_COLUMN+10*FW); @@ -3111,11 +3111,11 @@ void menuModelMixOne(uint8_t event) #else if (m_posVert == MIX_FIELD_TRIM && md2->srcRaw > NUM_STICKS) #endif - SUBMENU_NOTITLE(MIX_FIELD_COUNT, {IF_CPUARM(0) 0, 0, 0, CASE_9X(0) IF_CURVES(0) IF_FLIGHT_MODES((MAX_PHASES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}) + SUBMENU_NOTITLE(MIX_FIELD_COUNT, {IF_CPUARM(0) 0, 0, 0, CASE_9X(0) IF_CURVES(0) IF_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}) else - SUBMENU_NOTITLE(MIX_FIELD_COUNT, {IF_CPUARM(0) 0, 0, 0, CASE_9X(1) IF_CURVES(1) IF_FLIGHT_MODES((MAX_PHASES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}); + SUBMENU_NOTITLE(MIX_FIELD_COUNT, {IF_CPUARM(0) 0, 0, 0, CASE_9X(1) IF_CURVES(1) IF_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}); #else - SUBMENU_NOTITLE(MIX_FIELD_COUNT, {IF_CPUARM(0) 0, 0, 0, CASE_9X(1) CASE_PCBTARANIS(0) IF_CURVES(1) IF_FLIGHT_MODES((MAX_PHASES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}); + SUBMENU_NOTITLE(MIX_FIELD_COUNT, {IF_CPUARM(0) 0, 0, 0, CASE_9X(1) CASE_PCBTARANIS(0) IF_CURVES(1) IF_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}); #endif #if MENU_COLUMNS > 1 @@ -3314,7 +3314,7 @@ static uint8_t s_copySrcCh; #define EXPO_LINE_WEIGHT_POS 7*FW+1 #define EXPO_LINE_EXPO_POS 11*FW #define EXPO_LINE_SWITCH_POS 11*FW+4 - #if MAX_PHASES == 6 + #if MAX_FLIGHT_MODES == 6 #define EXPO_LINE_SIDE_POS 15*FW #else #define EXPO_LINE_SIDE_POS 15*FW+2 @@ -4102,7 +4102,7 @@ void onGVARSMenu(const char *result) eeDirty(EE_MODEL); } else if (result == STR_CLEAR) { - for (int i=0; i0) ? BLINK|INVERS : INVERS) : 0); xcoord_t x = GVARS_FM_COLUMN(j-1); @@ -4170,8 +4170,8 @@ void menuModelGVars(uint8_t event) if (v > GVAR_MAX) { uint8_t p = v - GVAR_MAX - 1; if (p >= j-1) p++; - putsFlightPhase(x-15, y, p+1, attr|SMLSIZE); - vmin = GVAR_MAX+1; vmax = GVAR_MAX+MAX_PHASES-1; + putsFlightMode(x-15, y, p+1, attr|SMLSIZE); + vmin = GVAR_MAX+1; vmax = GVAR_MAX+MAX_FLIGHT_MODES-1; } else { if (abs(v) >= 100) diff --git a/radio/src/gui/menus.cpp b/radio/src/gui/menus.cpp index 24f3b15bb..b9453d73a 100644 --- a/radio/src/gui/menus.cpp +++ b/radio/src/gui/menus.cpp @@ -1132,7 +1132,7 @@ int8_t switchMenuItem(uint8_t x, uint8_t y, int8_t value, LcdFlags attr, uint8_t { lcd_putsColumnLeft(x, y, STR_SWITCH); putsSwitches(x, y, value, attr); - if (attr) CHECK_INCDEC_MODELSWITCH(event, value, SWSRC_FIRST, SWSRC_LAST); + if (attr) CHECK_INCDEC_MODELSWITCH(event, value, SWSRC_FIRST_SHORT_LIST, SWSRC_LAST_SHORT_LIST); return value; } @@ -1152,11 +1152,11 @@ int16_t gvarMenuItem(uint8_t x, uint8_t y, int16_t value, int16_t min, int16_t m s_editMode = !s_editMode; #if defined(CPUARM) if (attr & PREC1) - value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, s_perout_flight_phase)*10 : delta); + value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, s_perout_flight_mode)*10 : delta); else - value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, s_perout_flight_phase) : delta); + value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, s_perout_flight_mode) : delta); #else - value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, s_perout_flight_phase) : delta); + value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, s_perout_flight_mode) : delta); #endif eeDirty(EE_MODEL); } @@ -1500,8 +1500,8 @@ bool isSwitchAvailable(int swtch) swtch = -swtch; } - if (swtch >= SWSRC_FIRST_CSW && swtch <= SWSRC_LAST_CSW) { - LogicalSwitchData * cs = cswAddress(swtch-SWSRC_FIRST_CSW); + if (swtch >= SWSRC_FIRST_LOGICAL_SWITCH && swtch <= SWSRC_LAST_LOGICAL_SWITCH) { + LogicalSwitchData * cs = cswAddress(swtch-SWSRC_FIRST_LOGICAL_SWITCH); return (cs->func != LS_FUNC_NONE); } diff --git a/radio/src/gui/view_main.cpp b/radio/src/gui/view_main.cpp index c311706ee..480ec89b7 100644 --- a/radio/src/gui/view_main.cpp +++ b/radio/src/gui/view_main.cpp @@ -650,7 +650,7 @@ void menuMainView(uint8_t event) { // Flight Phase Name - uint8_t phase = s_perout_flight_phase; + uint8_t phase = s_perout_flight_mode; lcd_putsnAtt(PHASE_X, PHASE_Y, g_model.phaseData[phase].name, sizeof(g_model.phaseData[phase].name), ZCHAR|PHASE_FLAGS); // Model Name @@ -862,13 +862,13 @@ void menuMainView(uint8_t event) putsStrIdx(BITMAP_X+FW, BITMAP_Y+FH-1, STR_GV, s_gvar_last+1); lcd_putsnAtt(BITMAP_X+4*FW+FW/2, BITMAP_Y+FH-1, g_model.gvars[s_gvar_last].name, LEN_GVAR_NAME, ZCHAR); lcd_putsAtt(BITMAP_X+FW, BITMAP_Y+2*FH+3, PSTR("[\010]"), BOLD); - lcd_outdezAtt(BITMAP_X+5*FW+FW/2, BITMAP_Y+2*FH+3, GVAR_VALUE(s_gvar_last, s_perout_flight_phase), BOLD); + lcd_outdezAtt(BITMAP_X+5*FW+FW/2, BITMAP_Y+2*FH+3, GVAR_VALUE(s_gvar_last, s_perout_flight_mode), BOLD); #else s_warning = STR_GLOBAL_VAR; displayBox(); lcd_putsnAtt(16, 5*FH, g_model.gvars[s_gvar_last].name, LEN_GVAR_NAME, ZCHAR); lcd_putsAtt(16+7*FW, 5*FH, PSTR("[\010]"), BOLD); - lcd_outdezAtt(16+7*FW+4*FW+FW/2, 5*FH, GVAR_VALUE(s_gvar_last, s_perout_flight_phase), BOLD); + lcd_outdezAtt(16+7*FW+4*FW+FW/2, 5*FH, GVAR_VALUE(s_gvar_last, s_perout_flight_mode), BOLD); s_warning = NULL; #endif } diff --git a/radio/src/lcd.cpp b/radio/src/lcd.cpp index 24347e956..e5926f877 100644 --- a/radio/src/lcd.cpp +++ b/radio/src/lcd.cpp @@ -1020,11 +1020,16 @@ void putsSwitches(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att) lcd_putcAtt(x-2, y, '!', att); idx = -idx; } +#if defined(CPUARM) && defined(FLIGHT_MODES) + if (idx >= SWSRC_FIRST_FLIGHT_MODE) + putsStrIdx(x, y, STR_FP, idx-SWSRC_FIRST_FLIGHT_MODE, att); + else +#endif lcd_putsiAtt(x, y, STR_VSWITCHES, idx-1, att); } #if defined(FLIGHT_MODES) -void putsFlightPhase(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att) +void putsFlightMode(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att) { if (idx==0) { lcd_putsiAtt(x, y, STR_MMMINV, 0, att); return; } if (idx < 0) { lcd_putcAtt(x-2, y, '!', att); idx = -idx; } diff --git a/radio/src/lcd.h b/radio/src/lcd.h index 0952a48f4..185f5079f 100644 --- a/radio/src/lcd.h +++ b/radio/src/lcd.h @@ -178,7 +178,7 @@ void putsStrIdx(xcoord_t x, uint8_t y, const pm_char *str, uint8_t idx, LcdFlags void putsModelName(xcoord_t x, uint8_t y, char *name, uint8_t id, LcdFlags att); void putsSwitches(xcoord_t x, uint8_t y, int8_t swtch, LcdFlags att=0); void putsMixerSource(xcoord_t x, uint8_t y, uint8_t idx, LcdFlags att=0); -void putsFlightPhase(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att=0); +void putsFlightMode(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att=0); #if defined(PCBTARANIS) && !defined(BOOT) void putsCurveRef(xcoord_t x, uint8_t y, CurveRef &curve, LcdFlags att); #endif diff --git a/radio/src/lua.cpp b/radio/src/lua.cpp index bb6ed9dff..dd78de586 100644 --- a/radio/src/lua.cpp +++ b/radio/src/lua.cpp @@ -746,7 +746,7 @@ static int luaModelGetGlobalVariable(lua_State *L) { int idx = luaL_checkunsigned(L, 1); int phase = luaL_checkunsigned(L, 2); - if (phase < MAX_PHASES && idx < MAX_GVARS) + if (phase < MAX_FLIGHT_MODES && idx < MAX_GVARS) lua_pushinteger(L, g_model.phaseData[phase].gvars[idx]); else lua_pushnil(L); @@ -758,7 +758,7 @@ static int luaModelSetGlobalVariable(lua_State *L) int idx = luaL_checkunsigned(L, 1); int phase = luaL_checkunsigned(L, 2); int value = luaL_checkinteger(L, 3); - if (phase < MAX_PHASES && idx < MAX_GVARS && value >= -GVAR_LIMIT && value <= GVAR_LIMIT) { + if (phase < MAX_FLIGHT_MODES && idx < MAX_GVARS && value >= -GVAR_LIMIT && value <= GVAR_LIMIT) { g_model.phaseData[phase].gvars[idx] = value; } return 0; @@ -926,7 +926,7 @@ void luaInit() lua_registerint(L, "STICK_ELEVATOR", MIXSRC_Ele); lua_registerint(L, "STICK_THROTTLE", MIXSRC_Thr); lua_registerint(L, "STICK_AILERON", MIXSRC_Ail); - lua_registerint(L, "SWITCH_LAST", SWSRC_LAST_CSW); + lua_registerint(L, "SWITCH_LAST", SWSRC_LAST_LOGICAL_SWITCH); lua_registerint(L, "EVT_MENU_BREAK", EVT_KEY_BREAK(KEY_MENU)); lua_registerint(L, "EVT_PAGE_BREAK", EVT_KEY_BREAK(KEY_PAGE)); lua_registerint(L, "EVT_ENTER_BREAK", EVT_KEY_BREAK(KEY_ENTER)); diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 16018bf3a..223591cdd 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -73,7 +73,7 @@ #if defined(PCBTARANIS) #define MAX_MODELS 60 #define NUM_CHNOUT 32 // number of real output channels CH1-CH32 - #define MAX_PHASES 9 + #define MAX_FLIGHT_MODES 9 #define MAX_MIXERS 64 #define MAX_EXPOS 64 #define NUM_LOGICAL_SWITCH 32 // number of custom switches @@ -86,7 +86,7 @@ #elif defined(CPUARM) #define MAX_MODELS 60 #define NUM_CHNOUT 32 // number of real output channels CH1-CH32 - #define MAX_PHASES 9 + #define MAX_FLIGHT_MODES 9 #define MAX_MIXERS 64 #define MAX_EXPOS 32 #define NUM_LOGICAL_SWITCH 32 // number of custom switches @@ -97,7 +97,7 @@ #elif defined(CPUM2560) || defined(CPUM2561) #define MAX_MODELS 30 #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 - #define MAX_PHASES 6 + #define MAX_FLIGHT_MODES 6 #define MAX_MIXERS 32 #define MAX_EXPOS 16 #define NUM_LOGICAL_SWITCH 15 // number of custom switches @@ -108,7 +108,7 @@ #elif defined(CPUM128) #define MAX_MODELS 30 #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 - #define MAX_PHASES 5 + #define MAX_FLIGHT_MODES 5 #define MAX_MIXERS 32 #define MAX_EXPOS 14 #define NUM_LOGICAL_SWITCH 15 // number of custom switches @@ -119,7 +119,7 @@ #else #define MAX_MODELS 16 #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 - #define MAX_PHASES 5 + #define MAX_FLIGHT_MODES 5 #define MAX_MIXERS 32 #define MAX_EXPOS 14 #define NUM_LOGICAL_SWITCH 12 // number of custom switches @@ -522,9 +522,9 @@ PACK(typedef struct t_ExpoData { #define limit_min_max_t int16_t #define LIMIT_EXT_PERCENT 150 #define LIMIT_EXT_MAX (LIMIT_EXT_PERCENT*10) - #define LIMIT_MAX(lim) (GV_IS_GV_VALUE(lim->max, -LIMIT_EXT_MAX, LIMIT_EXT_MAX) ? GET_GVAR(lim->max, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, s_perout_flight_phase)*10 : lim->max+1000) - #define LIMIT_MIN(lim) (GV_IS_GV_VALUE(lim->min, -LIMIT_EXT_MAX, LIMIT_EXT_MAX) ? GET_GVAR(lim->min, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, s_perout_flight_phase)*10 : lim->min-1000) - #define LIMIT_OFS(lim) (GV_IS_GV_VALUE(lim->offset, -1000, 1000) ? GET_GVAR(lim->offset, -1000, 1000, s_perout_flight_phase)*10 : lim->offset) + #define LIMIT_MAX(lim) (GV_IS_GV_VALUE(lim->max, -LIMIT_EXT_MAX, LIMIT_EXT_MAX) ? GET_GVAR(lim->max, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, s_perout_flight_mode)*10 : lim->max+1000) + #define LIMIT_MIN(lim) (GV_IS_GV_VALUE(lim->min, -LIMIT_EXT_MAX, LIMIT_EXT_MAX) ? GET_GVAR(lim->min, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, s_perout_flight_mode)*10 : lim->min-1000) + #define LIMIT_OFS(lim) (GV_IS_GV_VALUE(lim->offset, -1000, 1000) ? GET_GVAR(lim->offset, -1000, 1000, s_perout_flight_mode)*10 : lim->offset) #define LIMIT_MAX_RESX(lim) calc1000toRESX(LIMIT_MAX(lim)) #define LIMIT_MIN_RESX(lim) calc1000toRESX(LIMIT_MIN(lim)) #define LIMIT_OFS_RESX(lim) calc1000toRESX(LIMIT_OFS(lim)) @@ -1246,7 +1246,7 @@ PACK(typedef struct t_SwashRingData { // Swash Ring data #define NUM_ROTARY_ENCODERS_EXTRA 2 #define NUM_ROTARY_ENCODERS (2+NUM_ROTARY_ENCODERS_EXTRA) #define ROTARY_ENCODER_ARRAY int16_t rotaryEncoders[2]; -#define ROTARY_ENCODER_ARRAY_EXTRA int16_t rotaryEncodersExtra[MAX_PHASES][NUM_ROTARY_ENCODERS_EXTRA]; +#define ROTARY_ENCODER_ARRAY_EXTRA int16_t rotaryEncodersExtra[MAX_FLIGHT_MODES][NUM_ROTARY_ENCODERS_EXTRA]; #elif defined(CPUM2560) && ROTARY_ENCODERS <= 2 #define NUM_ROTARY_ENCODERS_EXTRA 0 #define NUM_ROTARY_ENCODERS 2 @@ -1371,8 +1371,8 @@ enum SwitchSources { SWSRC_REb, #endif - SWSRC_FIRST_CSW, - SWSRC_SW1 = SWSRC_FIRST_CSW, + SWSRC_FIRST_LOGICAL_SWITCH, + SWSRC_SW1 = SWSRC_FIRST_LOGICAL_SWITCH, SWSRC_SW2, SWSRC_SW3, SWSRC_SW4, @@ -1384,13 +1384,24 @@ enum SwitchSources { SWSRC_SWA, SWSRC_SWB, SWSRC_SWC, - SWSRC_LAST_CSW = SWSRC_SW1+NUM_LOGICAL_SWITCH-1, + SWSRC_LAST_LOGICAL_SWITCH = SWSRC_FIRST_LOGICAL_SWITCH+NUM_LOGICAL_SWITCH-1, SWSRC_ON, + +#if defined(CPUARM) + SWSRC_FIRST_FLIGHT_MODE, + SWSRC_LAST_FLIGHT_MODE = SWSRC_FIRST_FLIGHT_MODE+MAX_FLIGHT_MODES-1, +#endif + + SWSRC_COUNT, + SWSRC_OFF = -SWSRC_ON, - SWSRC_FIRST = SWSRC_OFF, - SWSRC_LAST = SWSRC_ON + SWSRC_LAST = SWSRC_COUNT-1, + SWSRC_FIRST = -SWSRC_LAST, + + SWSRC_LAST_SHORT_LIST = SWSRC_LAST_LOGICAL_SWITCH, + SWSRC_FIRST_SHORT_LIST = -SWSRC_LAST_SHORT_LIST, }; enum MixSources { @@ -1682,7 +1693,7 @@ PACK(typedef struct t_ModelData { LogicalSwitchData customSw[NUM_LOGICAL_SWITCH]; CustomFnData funcSw[NUM_CFN]; SwashRingData swashR; - PhaseData phaseData[MAX_PHASES]; + PhaseData phaseData[MAX_FLIGHT_MODES]; AVR_FIELD(int8_t ppmFrameLength) // 0=22.5ms (10ms-30ms) 0.5ms increments uint8_t thrTraceSrc; diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index ac4f422f5..a41d698bf 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -769,7 +769,7 @@ int applyCurve(int x, CurveRef & curve) switch (curve.type) { case CURVE_REF_DIFF: { - int curveParam = calc100to256(GET_GVAR(curve.value, -100, 100, s_perout_flight_phase)); + int curveParam = calc100to256(GET_GVAR(curve.value, -100, 100, s_perout_flight_mode)); if (curveParam > 0 && x < 0) x = (x * (256 - curveParam)) >> 8; else if (curveParam < 0 && x > 0) @@ -778,7 +778,7 @@ int applyCurve(int x, CurveRef & curve) } case CURVE_REF_EXPO: - return expo(x, GET_GVAR(curve.value, -100, 100, s_perout_flight_phase)); + return expo(x, GET_GVAR(curve.value, -100, 100, s_perout_flight_mode)); case CURVE_REF_FUNC: switch (curve.value) { @@ -981,7 +981,7 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) if (!EXPO_VALID(ed)) break; // end of list if (ed->chn == cur_chn) continue; - if (ed->phases & (1<phases & (1<swtch)) { #if defined(PCBTARANIS) @@ -1020,18 +1020,18 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) if (ed->curveMode == MODE_CURVE) v = applyCurve(v, curveParam); else - v = expo(v, GET_GVAR(curveParam, -100, 100, s_perout_flight_phase)); + v = expo(v, GET_GVAR(curveParam, -100, 100, s_perout_flight_mode)); } #endif //========== WEIGHT =============== - int16_t weight = GET_GVAR(ed->weight, MIN_EXPO_WEIGHT, 100, s_perout_flight_phase); + int16_t weight = GET_GVAR(ed->weight, MIN_EXPO_WEIGHT, 100, s_perout_flight_mode); weight = calc100to256(weight); v = ((int32_t)v * weight) >> 8; #if defined(PCBTARANIS) //========== OFFSET =============== - int16_t offset = GET_GVAR(ed->offset, -100, 100, s_perout_flight_phase); + int16_t offset = GET_GVAR(ed->offset, -100, 100, s_perout_flight_mode); if (offset) v += calc100toRESX(offset); //========== TRIMS ================ @@ -1268,7 +1268,7 @@ getvalue_t getValue(uint8_t i) return 0; #endif - else if (i<=MIXSRC_TrimAil) return calc1000toRESX((int16_t)8 * getTrimValue(s_perout_flight_phase, i-MIXSRC_TrimRud)); + else if (i<=MIXSRC_TrimAil) return calc1000toRESX((int16_t)8 * getTrimValue(s_perout_flight_mode, i-MIXSRC_TrimRud)); #if defined(PCBTARANIS) else if (i==MIXSRC_SA) return (switchState(SW_SA0) ? -1024 : (switchState(SW_SA1) ? 0 : 1024)); @@ -1279,7 +1279,7 @@ getvalue_t getValue(uint8_t i) else if (i==MIXSRC_SF) return (switchState(SW_SF0) ? -1024 : 1024); else if (i==MIXSRC_SG) return (switchState(SW_SG0) ? -1024 : (switchState(SW_SG1) ? 0 : 1024)); else if (i==MIXSRC_SH) return (switchState(SW_SH0) ? -1024 : 1024); - else if (i<=MIXSRC_LAST_LOGICAL_SWITCH) return getSwitch(SWSRC_FIRST_CSW+i-MIXSRC_FIRST_LOGICAL_SWITCH) ? 1024 : -1024; + else if (i<=MIXSRC_LAST_LOGICAL_SWITCH) return getSwitch(SWSRC_FIRST_LOGICAL_SWITCH+i-MIXSRC_FIRST_LOGICAL_SWITCH) ? 1024 : -1024; #else else if (i==MIXSRC_3POS) return (getSwitch(SW_ID0-SW_BASE+1) ? -1024 : (getSwitch(SW_ID1-SW_BASE+1) ? 0 : 1024)); // don't use switchState directly to give getSwitch possibility to hack values if needed for switch warning @@ -1294,7 +1294,7 @@ getvalue_t getValue(uint8_t i) else if (i<=MIXSRC_LAST_CH) return ex_chans[i-MIXSRC_CH1]; #if defined(GVARS) - else if (i<=MIXSRC_LAST_GVAR) return GVAR_VALUE(i-MIXSRC_GVAR1, getGVarFlightPhase(s_perout_flight_phase, i-MIXSRC_GVAR1)); + else if (i<=MIXSRC_LAST_GVAR) return GVAR_VALUE(i-MIXSRC_GVAR1, getGVarFlightPhase(s_perout_flight_mode, i-MIXSRC_GVAR1)); #endif else if (i==MIXSRC_FIRST_TELEM-1+TELEM_TX_VOLTAGE) return g_vbat100mV; @@ -1513,9 +1513,15 @@ bool getSwitch(int8_t swtch) else if (cs_idx == SWSRC_REb) { result = REB_DOWN(); } +#endif +#if defined(CPUARM) && defined(FLIGHT_MODES) + else if (cs_idx >= SWSRC_FIRST_FLIGHT_MODE) { + uint8_t idx = cs_idx - SWSRC_FIRST_FLIGHT_MODE; + result = (idx == s_perout_flight_mode); + } #endif else { - cs_idx -= SWSRC_FIRST_CSW; + cs_idx -= SWSRC_FIRST_LOGICAL_SWITCH; GETSWITCH_RECURSIVE_TYPE mask = ((GETSWITCH_RECURSIVE_TYPE)1 << cs_idx); if (s_last_switch_used & mask) { @@ -1801,7 +1807,7 @@ int8_t getMovedSource(GET_MOVED_SOURCE_PARAMS) #if defined(FLIGHT_MODES) uint8_t getFlightPhase() { - for (uint8_t i=1; iswtch && getSwitch(phase->swtch)) { return i; @@ -1825,7 +1831,7 @@ int getTrimValue(uint8_t phase, uint8_t idx) { #if defined(PCBTARANIS) int result = 0; - for (uint8_t i=0; itrim[idx]; if (v.mode == TRIM_MODE_NONE) return; @@ -1884,7 +1890,7 @@ void setTrimValue(uint8_t phase, uint8_t idx, int trim) #if !defined(PCBTARANIS) uint8_t getTrimFlightPhase(uint8_t phase, uint8_t idx) { - for (uint8_t i=0; i 2 int16_t value; @@ -1990,7 +1996,7 @@ uint8_t s_gvar_last = 0; uint8_t getGVarFlightPhase(uint8_t phase, uint8_t idx) { - for (uint8_t i=0; i throttle trim if applicable int16_t trim = getTrimValue(phase, i); @@ -3531,14 +3537,14 @@ void evalFunctions() #if defined(GVARS) case FUNC_ADJUST_GVAR: if (CFN_GVAR_MODE(sd) == 0) { - SET_GVAR(CFN_GVAR_INDEX(sd), CFN_PARAM(sd), s_perout_flight_phase); + SET_GVAR(CFN_GVAR_INDEX(sd), CFN_PARAM(sd), s_perout_flight_mode); } else if (CFN_GVAR_MODE(sd) == 2) { - SET_GVAR(CFN_GVAR_INDEX(sd), GVAR_VALUE(CFN_PARAM(sd), s_perout_flight_phase), s_perout_flight_phase); + SET_GVAR(CFN_GVAR_INDEX(sd), GVAR_VALUE(CFN_PARAM(sd), s_perout_flight_mode), s_perout_flight_mode); } else if (CFN_GVAR_MODE(sd) == 3) { if (!(activeFnSwitches & switch_mask)) { - SET_GVAR(CFN_GVAR_INDEX(sd), GVAR_VALUE(CFN_GVAR_INDEX(sd), getGVarFlightPhase(s_perout_flight_phase, CFN_GVAR_INDEX(sd))) + (CFN_PARAM(sd) ? +1 : -1), s_perout_flight_phase); + SET_GVAR(CFN_GVAR_INDEX(sd), GVAR_VALUE(CFN_GVAR_INDEX(sd), getGVarFlightPhase(s_perout_flight_mode, CFN_GVAR_INDEX(sd))) + (CFN_PARAM(sd) ? +1 : -1), s_perout_flight_mode); } } else if (CFN_PARAM(sd) >= MIXSRC_TrimRud && CFN_PARAM(sd) <= MIXSRC_TrimAil) { @@ -3548,12 +3554,12 @@ void evalFunctions() else if (CFN_PARAM(sd) >= MIXSRC_REa && CFN_PARAM(sd) < MIXSRC_TrimRud) { int8_t scroll = rePreviousValues[CFN_PARAM(sd)-MIXSRC_REa] - (g_rotenc[CFN_PARAM(sd)-MIXSRC_REa] / ROTARY_ENCODER_GRANULARITY); if (scroll) { - SET_GVAR(CFN_GVAR_INDEX(sd), GVAR_VALUE(CFN_GVAR_INDEX(sd), getGVarFlightPhase(s_perout_flight_phase, CFN_GVAR_INDEX(sd))) + scroll, s_perout_flight_phase); + SET_GVAR(CFN_GVAR_INDEX(sd), GVAR_VALUE(CFN_GVAR_INDEX(sd), getGVarFlightPhase(s_perout_flight_mode, CFN_GVAR_INDEX(sd))) + scroll, s_perout_flight_mode); } } #endif else { - SET_GVAR(CFN_GVAR_INDEX(sd), limit((getvalue_t)-LIMIT_EXT_MAX, getValue(CFN_PARAM(sd)), (getvalue_t)LIMIT_EXT_MAX) / 10, s_perout_flight_phase); + SET_GVAR(CFN_GVAR_INDEX(sd), limit((getvalue_t)-LIMIT_EXT_MAX, getValue(CFN_PARAM(sd)), (getvalue_t)LIMIT_EXT_MAX) / 10, s_perout_flight_mode); } break; #endif @@ -3636,7 +3642,7 @@ void evalFunctions() else { #if defined(GVARS) if (CFN_FUNC(sd) == FUNC_PLAY_TRACK && param > 250) - param = GVAR_VALUE(param-251, getGVarFlightPhase(s_perout_flight_phase, param-251)); + param = GVAR_VALUE(param-251, getGVarFlightPhase(s_perout_flight_mode, param-251)); #endif PUSH_CUSTOM_PROMPT(active ? param : param+1, i+1); } @@ -3717,7 +3723,7 @@ void evalFunctions() #define HELI_ANAS_ARRAY anas #endif -uint8_t s_perout_flight_phase; +uint8_t s_perout_flight_mode; void perOut(uint8_t mode, uint8_t tick10ms) { evalInputs(mode); @@ -3822,7 +3828,7 @@ void perOut(uint8_t mode, uint8_t tick10ms) //========== PHASE && SWITCH ===== bool mixCondition = (md->phases != 0 || md->swtch); - delayval_t mixEnabled = !(md->phases & (1 << s_perout_flight_phase)) && getSwitch(md->swtch); + delayval_t mixEnabled = !(md->phases & (1 << s_perout_flight_mode)) && getSwitch(md->swtch); if (mixEnabled && md->srcRaw >= MIXSRC_FIRST_TRAINER && md->srcRaw <= MIXSRC_LAST_TRAINER && !ppmInValid) { mixEnabled = 0; @@ -3911,7 +3917,7 @@ void perOut(uint8_t mode, uint8_t tick10ms) if (apply_offset_and_curve) { #if !defined(PCBTARANIS) // OFFSET is now applied AFTER weight on Taranis //========== OFFSET / SOURCE =============== - int16_t offset = GET_GVAR(MD_OFFSET(md), GV_RANGELARGE_NEG, GV_RANGELARGE, s_perout_flight_phase); + int16_t offset = GET_GVAR(MD_OFFSET(md), GV_RANGELARGE_NEG, GV_RANGELARGE, s_perout_flight_mode); if (offset) v += calc100toRESX_16Bits(offset); #endif @@ -3954,7 +3960,7 @@ void perOut(uint8_t mode, uint8_t tick10ms) } // saves 12 bytes code if done here and not together with weight; unknown reason - int16_t weight = GET_GVAR(MD_WEIGHT(md), GV_RANGELARGE_NEG, GV_RANGELARGE, s_perout_flight_phase); + int16_t weight = GET_GVAR(MD_WEIGHT(md), GV_RANGELARGE_NEG, GV_RANGELARGE, s_perout_flight_mode); weight = calc100to256_16Bits(weight); //========== SPEED =============== @@ -4015,7 +4021,7 @@ void perOut(uint8_t mode, uint8_t tick10ms) //========== OFFSET / AFTER =============== #if defined(PCBTARANIS) if (apply_offset_and_curve) { - int16_t offset = GET_GVAR(MD_OFFSET(md), GV_RANGELARGE_NEG, GV_RANGELARGE, s_perout_flight_phase); + int16_t offset = GET_GVAR(MD_OFFSET(md), GV_RANGELARGE_NEG, GV_RANGELARGE, s_perout_flight_mode); if (offset) dv += calc100toRESX_16Bits(offset) << 8; } #endif @@ -4028,7 +4034,7 @@ void perOut(uint8_t mode, uint8_t tick10ms) #else if (md->curveMode == MODE_DIFFERENTIAL) { // @@@2 also recalculate curveParam to a 256 basis which ease the calculation later a lot - int16_t curveParam = calc100to256(GET_GVAR(md->curveParam, -100, 100, s_perout_flight_phase)); + int16_t curveParam = calc100to256(GET_GVAR(md->curveParam, -100, 100, s_perout_flight_mode)); if (curveParam > 0 && dv < 0) dv = (dv * (256 - curveParam)) >> 8; else if (curveParam < 0 && dv > 0) @@ -4157,7 +4163,7 @@ void doMixerCalculations() #endif #define MAX_ACT 0xffff - static uint16_t fp_act[MAX_PHASES] = {0}; + static uint16_t fp_act[MAX_FLIGHT_MODES] = {0}; static uint16_t delta = 0; static ACTIVE_PHASES_TYPE s_fade_flight_phases = 0; static uint8_t s_last_phase = 255; // TODO reinit everything here when the model changes, no??? @@ -4192,10 +4198,10 @@ void doMixerCalculations() int32_t weight = 0; if (s_fade_flight_phases) { memclear(sum_chans512, sizeof(sum_chans512)); - for (uint8_t p=0; p> 4) * fp_act[p]; @@ -4204,10 +4210,10 @@ void doMixerCalculations() s_last_switch_used = 0; } assert(weight); - s_perout_flight_phase = phase; + s_perout_flight_mode = phase; } else { - s_perout_flight_phase = phase; + s_perout_flight_mode = phase; perOut(e_perout_mode_normal, tick10ms); } @@ -4539,7 +4545,7 @@ void doMixerCalculations() if (s_fade_flight_phases) { uint16_t tick_delta = delta * tick10ms; - for (uint8_t p=0; p(TRIM_EXTENDED_MIN, (calibratedStick[i] + trims[i]) / 2, TRIM_EXTENDED_MAX); #else @@ -5296,8 +5302,8 @@ void moveTrimsToOffsets() // copy state of 3 primary to subtrim // reset all trims, except throttle (if throttle trim) for (uint8_t i=0; i Date: Mon, 5 May 2014 16:35:41 +0200 Subject: [PATCH 54/79] 100mAh will be now the step for telemetry bars (and logical switches on stock 9x) --- companion/src/eeprominterface.cpp | 4 ++-- radio/src/opentx.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 4a04b563d..983e73a7e 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -200,8 +200,8 @@ RawSourceRange RawSource::getRange(bool singleprec) result.decimals = 1; break; case TELEMETRY_SOURCE_CONSUMPTION: - result.step = singleprec ? 40 : 1; - result.max = singleprec ? 10200 : 10000; + result.step = singleprec ? 100 : 1; + result.max = singleprec ? 25500 : 10000; break; case TELEMETRY_SOURCE_POWER: case TELEMETRY_SOURCE_POWER_MAX: diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index a41d698bf..520853308 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -2151,7 +2151,7 @@ getvalue_t convert8bitsTelemValue(uint8_t channel, ls_telemetry_value_t value) result = value * 5; break; case TELEM_CONSUMPTION: - result = value * 40; + result = value * 100; break; case TELEM_VSPEED: result = ((getvalue_t)value - 125) * 10; From 50774a90181cfac727711339adb932be91e93b5d Mon Sep 17 00:00:00 2001 From: bsongis Date: Mon, 5 May 2014 16:35:51 +0200 Subject: [PATCH 55/79] Cosmetics --- companion/src/simulation/simulatordialog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/companion/src/simulation/simulatordialog.cpp b/companion/src/simulation/simulatordialog.cpp index 2003abf18..761fc0c06 100644 --- a/companion/src/simulation/simulatordialog.cpp +++ b/companion/src/simulation/simulatordialog.cpp @@ -600,7 +600,7 @@ void SimulatorDialog9X::getValues() void SimulatorDialog9X::saveSwitches(void) { - qDebug() << "SimulatorDialog9X::saveSwitches()"; + // qDebug() << "SimulatorDialog9X::saveSwitches()"; switchstatus=ui->switchTHR->isChecked(); switchstatus<<=1; switchstatus+=(ui->switchRUD->isChecked()&0x1); @@ -620,7 +620,7 @@ void SimulatorDialog9X::saveSwitches(void) void SimulatorDialog9X::restoreSwitches(void) { - qDebug() << "SimulatorDialog9X::restoreSwitches()"; + // qDebug() << "SimulatorDialog9X::restoreSwitches()"; ui->switchAIL->setChecked(switchstatus & 0x1); switchstatus >>=1; ui->switchELE->setChecked(switchstatus & 0x1); @@ -705,7 +705,7 @@ void SimulatorDialogTaranis::getValues() void SimulatorDialogTaranis::saveSwitches(void) { - qDebug() << "SimulatorDialogTaranis::saveSwitches()"; + // qDebug() << "SimulatorDialogTaranis::saveSwitches()"; switchstatus=ui->switchA->value(); switchstatus<<=2; switchstatus+=ui->switchB->value(); @@ -725,7 +725,7 @@ void SimulatorDialogTaranis::saveSwitches(void) void SimulatorDialogTaranis::restoreSwitches(void) { - qDebug() << "SimulatorDialogTaranis::restoreSwitches()"; + // qDebug() << "SimulatorDialogTaranis::restoreSwitches()"; ui->switchH->setValue(switchstatus & 0x3); switchstatus>>=2; ui->switchG->setValue(switchstatus & 0x3); From 809a3cfd60cea1e20f6c75fd42eee31ef9be28fd Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Mon, 5 May 2014 20:25:41 +0200 Subject: [PATCH 56/79] Added "Alt+S" shortcut to start model simulation --- companion/src/mainwindow.cpp | 19 ++++++++++++------- companion/src/mainwindow.h | 7 ++++--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/companion/src/mainwindow.cpp b/companion/src/mainwindow.cpp index 0644b339e..046ea3b9c 100644 --- a/companion/src/mainwindow.cpp +++ b/companion/src/mainwindow.cpp @@ -1563,7 +1563,12 @@ MdiChild *MainWindow::createMdiChild() return child; } -QAction * MainWindow::addAct(QString icon, QString sName, QString lName, QKeySequence::StandardKey shortcut, const char *slot, QObject *slotObj) +QAction * MainWindow::addAct(const QString & icon, const QString & sName, const QString & lName, enum QKeySequence::StandardKey shortcut, const char *slot, QObject *slotObj) +{ + return addAct(icon, sName, lName, QKeySequence(shortcut), slot, slotObj); +} + +QAction * MainWindow::addAct(const QString & icon, const QString & sName, const QString & lName, const QKeySequence & shortcut, const char *slot, QObject *slotObj) { QAction * newAction = new QAction( this ); if (!icon.isEmpty()) @@ -1572,20 +1577,20 @@ QAction * MainWindow::addAct(QString icon, QString sName, QString lName, QKeySeq newAction->setText(sName); if (!lName.isEmpty()) newAction->setStatusTip(lName); - if (shortcut != 0) - newAction->setShortcut(QKeySequence(shortcut)); + newAction->setShortcut(shortcut); if (slotObj == NULL) slotObj = this; connect(newAction, SIGNAL(triggered()), slotObj, slot); return newAction; } -QAction * MainWindow::addAct(QString icon, QString sName, QString lName, const char *slot) + +QAction * MainWindow::addAct(const QString & icon, const QString & sName, const QString & lName, const char *slot) { return addAct(icon, sName, lName, QKeySequence::UnknownKey, slot); } -QAction * MainWindow::addAct(QActionGroup *aGroup, QString sName, QString lName, const char *slot) +QAction * MainWindow::addAct(QActionGroup *aGroup, const QString & sName, const QString & lName, const char *slot) { QAction *action = addAct("", sName, lName, QKeySequence::UnknownKey, slot); action->setCheckable(true); @@ -1653,8 +1658,8 @@ void MainWindow::createActions() // dutchLangAct = addAct( langAlignGroup, tr("Dutch"), tr("Use Dutch in menus"), SLOT(setNLLanguage())); aboutAct = addAct("information.png", tr("About..."), tr("Show the application's About box"), SLOT(about())); - printAct = addAct("print.png", tr("Print..."), tr("Print current model"), QKeySequence::Print, SLOT(print())); - simulateAct = addAct("simulate.png", tr("Simulate..."), tr("Simulate current model"), SLOT(simulate())); + printAct = addAct("print.png", tr("Print..."), tr("Print current model"), QKeySequence::Print, SLOT(print())); + simulateAct = addAct("simulate.png", tr("Simulate..."), tr("Simulate current model"), QKeySequence(tr("Alt+S")), SLOT(simulate())); loadbackupAct = addAct("open.png", tr("Load Backup..."), tr("Load backup from file"), SLOT(loadBackup())); logsAct = addAct("logs.png", tr("View Log File..."), tr("Open and view log file"), SLOT(logFile())); appPrefsAct = addAct("apppreferences.png",tr("Settings..."), tr("Edit Settings"), SLOT(appPrefs())); diff --git a/companion/src/mainwindow.h b/companion/src/mainwindow.h index c6c2d2003..3d5ba1f1a 100644 --- a/companion/src/mainwindow.h +++ b/companion/src/mainwindow.h @@ -159,9 +159,10 @@ class MainWindow : public QMainWindow private: void createActions(); - QAction * addAct(QString, QString, QString, QKeySequence::StandardKey, const char *, QObject *slotObj=NULL); - QAction * addAct(QActionGroup *, QString, QString, const char *); - QAction * addAct(QString, QString, QString, const char *); + QAction * addAct(const QString &, const QString &, const QString &, enum QKeySequence::StandardKey, const char *, QObject *slotObj=NULL); + QAction * addAct(const QString &, const QString &, const QString &, const QKeySequence &, const char *, QObject *slotObj=NULL); + QAction * addAct(QActionGroup *, const QString &, const QString &, const char *); + QAction * addAct(const QString &, const QString &, const QString &, const char *); void createMenus(); void createToolBars(); From b9b4e441e734f4a36fbe0a8bd2376b0151bf109b Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Mon, 5 May 2014 21:02:26 +0200 Subject: [PATCH 57/79] renamed printExpo() to printInputs() and compacted code, output is the same. --- companion/src/helpers.cpp | 2 +- companion/src/helpers.h | 2 +- companion/src/printdialog.cpp | 58 +++++++++++++++-------------------- companion/src/printdialog.h | 2 +- 4 files changed, 27 insertions(+), 37 deletions(-) diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp index 8522773d4..577608e54 100644 --- a/companion/src/helpers.cpp +++ b/companion/src/helpers.cpp @@ -40,7 +40,7 @@ const QColor colors[C9X_MAX_CURVES] = { QColor(255,127,0), }; -QString getPhaseName(int val, char * phasename) +QString getPhaseName(int val, const char * phasename) { if (!val) return "---"; if (!phasename) { diff --git a/companion/src/helpers.h b/companion/src/helpers.h index 82a775395..d368c7ae7 100644 --- a/companion/src/helpers.h +++ b/companion/src/helpers.h @@ -107,7 +107,7 @@ QString getPhasesStr(unsigned int phases, ModelData & model); void populateGVCB(QComboBox *b, int value); void populateSourceCB(QComboBox *b, const RawSource &source, const ModelData & model, unsigned int flags); void populateCSWCB(QComboBox *b, int value); -QString getPhaseName(int val, char * phasename=NULL); +QString getPhaseName(int val, const char * phasename=NULL); QString getInputStr(ModelData & model, int index); QString image2qstring(QImage image); QImage qstring2image(QString imagestr); diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index cfb94d62f..9077c5697 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -47,7 +47,7 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS if (gvars) { te->append(printPhases()+"
"); } - printExpo(); + printInputs(); printMixes(); printLimits(); printCurves(); @@ -208,7 +208,7 @@ QString PrintDialog::printPhases() return(str); } -void PrintDialog::printExpo() +void PrintDialog::printInputs() { QString str = "
"); str.append(""; diff --git a/companion/src/printdialog.h b/companion/src/printdialog.h index 2084b7596..b0ec3da41 100644 --- a/companion/src/printdialog.h +++ b/companion/src/printdialog.h @@ -33,7 +33,7 @@ private: void printSetup(); QString printPhases(); - void printExpo(); + void printInputs(); void printMixes(); void printLimits(); void printCurves(); From 97bbdd3be15c9f36b2cfec42a0ef0f293235fbe4 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Mon, 5 May 2014 21:04:50 +0200 Subject: [PATCH 58/79] More compaction of printInputs() --- companion/src/printdialog.cpp | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index 9077c5697..7f56f58ef 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -244,31 +244,27 @@ void PrintDialog::printInputs() if (firmware->getCapability(VirtualInputs)) { str += " " + tr("Source") + QString("(%1)").arg(ed->srcRaw.toString()); - if (ed->carryTrim>0) { - str += " " + tr("NoTrim"); - } - else if (ed->carryTrim<0) { - str += " " + RawSource(SOURCE_TYPE_TRIM, (-(ed->carryTrim)-1)).toString(); - } + if (ed->carryTrim>0) str += " " + tr("NoTrim"); + else if (ed->carryTrim<0) str += " " + RawSource(SOURCE_TYPE_TRIM, (-(ed->carryTrim)-1)).toString(); } if (ed->curve.value) str += " " + Qt::escape(ed->curve.toString()); if (firmware->getCapability(FlightPhases)) { if(ed->phases) { if (ed->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { - int mask=1; + unsigned int mask=1; bool first = true; - QString strPhases; bool multiple = false; + QString strPhases; for (int j=0; jgetCapability(FlightPhases);j++) { if (!(ed->phases & mask)) { //PhaseData *pd = &g_model->phaseData[j]; const char * pdName = g_model->phaseData[j].name; if (first) { - strPhases += QString("%1").arg(getPhaseName(j+1,pdName)); + strPhases += Qt::escape(QString("%1").arg(getPhaseName(j+1,pdName))); first = false; } else { - strPhases += QString(", %1").arg(getPhaseName(j+1, pdName)); + strPhases += Qt::escape(QString(", %1").arg(getPhaseName(j+1, pdName))); multiple = true; } } @@ -282,14 +278,8 @@ void PrintDialog::printInputs() } } } - if (ed->swtch.type) - str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString()); - if (firmware->getCapability(HasExpoNames)) { - QString ExpoName(ed->name); - if (ed->name[0]) { - str += QString(" [%1]").arg(ed->name); - } - } + if (ed->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString()); + if (firmware->getCapability(HasExpoNames) && ed->name[0]) str += Qt::escape(QString(" [%1]").arg(ed->name)); str += ""; } str += "

"; str.append(tr("Inputs")); @@ -225,27 +225,25 @@ void PrintDialog::printExpo() lastCHN=ed->chn; str.append(""+getInputStr(*g_model, ed->chn)+""); } - else - str.append(" "); str.append("

"); switch(ed->mode) { case (1): - str += "<- "; + str += "<-"; break; case (2): - str += "-> "; + str += "->"; break; default: - str += "   "; + str += "  "; break; }; - str += tr("Weight(") + QString("%1").arg(getGVarString(ed->weight,true)) + ")"; + str += " " + tr("Weight") + QString("(%1)").arg(getGVarString(ed->weight,true)); if (firmware->getCapability(VirtualInputs)) { - str += " " + tr("Source(%1)").arg(ed->srcRaw.toString()); + str += " " + tr("Source") + QString("(%1)").arg(ed->srcRaw.toString()); if (ed->carryTrim>0) { str += " " + tr("NoTrim"); } @@ -259,33 +257,26 @@ void PrintDialog::printExpo() if(ed->phases) { if (ed->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { int mask=1; - int first=0; - for (int i=0; igetCapability(FlightPhases);i++) { - if (!(ed->phases & mask)) { - first++; - } - mask <<=1; - } - if (first>1) { - str += " " + tr("Flight modes") + QString("("); - } else { - str += " " + tr("Flight mode") + QString("("); - } - mask=1; - first=1; + bool first = true; + QString strPhases; + bool multiple = false; for (int j=0; jgetCapability(FlightPhases);j++) { if (!(ed->phases & mask)) { - PhaseData *pd = &g_model->phaseData[j]; - if (!first) { - str += QString(", ")+ QString("%1").arg(getPhaseName(j+1, pd->name)); + //PhaseData *pd = &g_model->phaseData[j]; + const char * pdName = g_model->phaseData[j].name; + if (first) { + strPhases += QString("%1").arg(getPhaseName(j+1,pdName)); + first = false; } else { - str += QString("%1").arg(getPhaseName(j+1,pd->name)); - first=0; + strPhases += QString(", %1").arg(getPhaseName(j+1, pdName)); + multiple = true; } } - mask <<=1; + mask <<= 1; + } + if (!strPhases.isEmpty()) { + str += " " + tr(multiple?"Flight modes":"Flight mode") + "(" + strPhases + ")"; } - str += QString(")"); } else { str += tr("DISABLED")+QString(" !!!"); } @@ -294,10 +285,9 @@ void PrintDialog::printExpo() if (ed->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString()); if (firmware->getCapability(HasExpoNames)) { - QString ExpoName; - ExpoName.append(ed->name); - if (!ExpoName.isEmpty()) { - str+= " " + QString(" [%1]").arg(ExpoName); + QString ExpoName(ed->name); + if (ed->name[0]) { + str += QString(" [%1]").arg(ed->name); } } str += "

"; From b9ee1d5dee1c7ae9a96702fef3eca3dc70e1b68a Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Mon, 5 May 2014 21:51:56 +0200 Subject: [PATCH 59/79] Sorted fade times for printPhases() --- companion/src/printdialog.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index 7f56f58ef..6c2b51bf9 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -156,8 +156,10 @@ QString PrintDialog::printPhases() } str.append("
"+tr("Switch")+"
"+tr("Flight mode name")); str.append(""+tr("IN")+""+tr("OUT")+"%1%1
"+tr("FM")+QString("%1 %2%3%4
"+tr("FM")+QString("%1 %2%1%1%1
"+tr("FM")+QString("%1 ").arg(i)); @@ -346,10 +346,10 @@ void CompareDialog::printPhases() if (gvars==1) { gvarnum=GetCurrentFirmware()->getCapability(Gvars); } - if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightPhases)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) { + if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightModes)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) { str.append("
"); str.append(""); - if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) { + if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) { str.append(QString(""); } @@ -357,7 +357,7 @@ void CompareDialog::printPhases() str.append(QString(""); } str.append(""); - if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) { + if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) { for (i=0; iGV%1
%2").arg(i+1).arg(g_model1->gvars_names[i])); } @@ -366,13 +366,13 @@ void CompareDialog::printPhases() str.append(QString("
").arg((i==0 ? 'A': 'B'))); } str.append(""); - for (i=0; igetCapability(FlightPhases); i++) { + for (i=0; igetCapability(FlightModes); i++) { PhaseData *pd1=&g_model1->phaseData[i]; PhaseData *pd2=&g_model2->phaseData[i]; str.append("").arg(pd1->name).arg(color)); - if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) { + if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) { for (k=0; kgvars[k],pd2->gvars[k]); if (pd1->gvars[k]<=1024) { @@ -411,7 +411,7 @@ void CompareDialog::printPhases() str.append(QString("").arg(getInputStr(*g_model1, i))); } str.append(""); - for (i=0; igetCapability(FlightPhases); i++) { + for (i=0; igetCapability(FlightModes); i++) { PhaseData *pd1=&g_model1->phaseData[i]; PhaseData *pd2=&g_model2->phaseData[i]; str.append("
 ").arg(gvarnum)+tr("Gvars")+"").arg(GetCurrentFirmware()->getCapability(RotaryEncoders))+tr("Rot. Enc.")+"
"+tr("Flight mode name")+"RE%1
"+tr("FM")+QString("%1 ").arg(i)); color=getColor1(pd1->name,pd2->name); str.append(QString("%1%1
"+tr("FM")+QString("%1 ").arg(i)); @@ -436,17 +436,17 @@ void CompareDialog::printPhases() } str.append("
"); - if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightPhases)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) { + if ((gvars==1 && GetCurrentFirmware()->getCapability(GvarsFlightModes)) || GetCurrentFirmware()->getCapability(RotaryEncoders)) { str.append("
"); str.append(""); - if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) { + if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) { str.append(QString(""); } if (GetCurrentFirmware()->getCapability(RotaryEncoders)) { str.append(QString(""); } str.append(""); - if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) { + if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) { for (i=0; iGV%1
%2").arg(i+1).arg(g_model2->gvars_names[i])); } @@ -455,13 +455,13 @@ void CompareDialog::printPhases() str.append(QString("
").arg((i==0 ? 'A': 'B'))); } str.append(""); - for (i=0; igetCapability(FlightPhases); i++) { + for (i=0; igetCapability(FlightModes); i++) { PhaseData *pd1=&g_model1->phaseData[i]; PhaseData *pd2=&g_model2->phaseData[i]; str.append("").arg(pd2->name).arg(color)); - if (GetCurrentFirmware()->getCapability(GvarsFlightPhases)) { + if (GetCurrentFirmware()->getCapability(GvarsFlightModes)) { for (k=0; kgvars[k],pd2->gvars[k]); if (pd2->gvars[k]<=1024) { @@ -569,7 +569,7 @@ void CompareDialog::printGvars() gvarnum=GetCurrentFirmware()->getCapability(Gvars); } - if (!GetCurrentFirmware()->getCapability(GvarsFlightPhases) && (gvars==1 && GetCurrentFirmware()->getCapability(Gvars))) { + if (!GetCurrentFirmware()->getCapability(GvarsFlightModes) && (gvars==1 && GetCurrentFirmware()->getCapability(Gvars))) { QString str = "
 ").arg(gvarnum)+tr("Gvars")+"").arg(GetCurrentFirmware()->getCapability(RotaryEncoders))+tr("Rot. Enc.")+"
"+tr("Flight mode name")+"RE%1
"+tr("FM")+QString("%1 ").arg(i)); color=getColor1(pd1->name,pd2->name); str.append(QString("%1
"; str.append(""); str.append(""; -} - -QString doTR(const QString s, const QString color="", bool bold=false) -{ - QString str = s; - if(bold) str = "" + str + ""; - if(!color.isEmpty()) str = "" + str + ""; - return ""; -} - -QString doTL(const QString s, const QString color="", bool bold=false) -{ - QString str = s; - if(bold) str = "" + str + ""; - if(!color.isEmpty()) str = "" + str + ""; - return ""; -} - -QString PrintDialog::fv(const QString name, const QString value) -{ - return "" + name + ": " + value + "
"; -} - -void PrintDialog::printSetup() -{ - QString str = "

"+tr("Global Variables")+"

"); @@ -653,12 +653,12 @@ void CompareDialog::printExpos() str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight)).rightJustified(6, ' '); str += ed->curve.toString().replace("<", "<").replace(">", ">"); - if (GetCurrentFirmware()->getCapability(FlightPhases)) { + if (GetCurrentFirmware()->getCapability(FlightModes)) { if(ed->phases) { - if (ed->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { + if (ed->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { int mask=1; int first=0; - for (int i=0; igetCapability(FlightPhases);i++) { + for (int i=0; igetCapability(FlightModes);i++) { if (!(ed->phases & mask)) { first++; } @@ -671,7 +671,7 @@ void CompareDialog::printExpos() } mask=1; first=1; - for (int j=0; jgetCapability(FlightPhases);j++) { + for (int j=0; jgetCapability(FlightModes);j++) { if (!(ed->phases & mask)) { PhaseData *pd = &g_model1->phaseData[j]; if (!first) { @@ -731,12 +731,12 @@ void CompareDialog::printExpos() str += tr("Weight") + QString("%1").arg(getGVarString(ed->weight)).rightJustified(6, ' '); str += ed->curve.toString().replace("<", "<").replace(">", ">"); - if (GetCurrentFirmware()->getCapability(FlightPhases)) { + if (GetCurrentFirmware()->getCapability(FlightModes)) { if(ed->phases) { - if (ed->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { + if (ed->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { int mask=1; int first=0; - for (int i=0; igetCapability(FlightPhases);i++) { + for (int i=0; igetCapability(FlightModes);i++) { if (!(ed->phases & mask)) { first++; } @@ -749,7 +749,7 @@ void CompareDialog::printExpos() } mask=1; first=1; - for (int j=0; jgetCapability(FlightPhases);j++) { + for (int j=0; jgetCapability(FlightModes);j++) { if (!(ed->phases & mask)) { PhaseData *pd = &g_model2->phaseData[j]; if (!first) { @@ -829,12 +829,12 @@ void CompareDialog::printMixers() if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale); if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale); if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn); - if (GetCurrentFirmware()->getCapability(FlightPhases)) { + if (GetCurrentFirmware()->getCapability(FlightModes)) { if(md->phases) { - if (md->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { + if (md->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { int mask=1; int first=0; - for (int i=0; igetCapability(FlightPhases);i++) { + for (int i=0; igetCapability(FlightModes);i++) { if (!(md->phases & mask)) { first++; } @@ -847,7 +847,7 @@ void CompareDialog::printMixers() } mask=1; first=1; - for (int j=0; jgetCapability(FlightPhases);j++) { + for (int j=0; jgetCapability(FlightModes);j++) { if (!(md->phases & mask)) { PhaseData *pd = &g_model1->phaseData[j]; if (!first) { @@ -908,12 +908,12 @@ void CompareDialog::printMixers() if (md->delayDown || md->delayUp) str += tr(" Delay(u%1:d%2)").arg(md->delayUp/scale).arg(md->delayDown/scale); if (md->speedDown || md->speedUp) str += tr(" Slow(u%1:d%2)").arg(md->speedUp/scale).arg(md->speedDown/scale); if (md->mixWarn) str += " "+tr("Warn")+QString("(%1)").arg(md->mixWarn); - if (GetCurrentFirmware()->getCapability(FlightPhases)) { + if (GetCurrentFirmware()->getCapability(FlightModes)) { if(md->phases) { - if (md->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { + if (md->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { int mask=1; int first=0; - for (int i=0; igetCapability(FlightPhases);i++) { + for (int i=0; igetCapability(FlightModes);i++) { if (!(md->phases & mask)) { first++; } @@ -926,7 +926,7 @@ void CompareDialog::printMixers() } mask=1; first=1; - for (int j=0; jgetCapability(FlightPhases);j++) { + for (int j=0; jgetCapability(FlightModes);j++) { if (!(md->phases & mask)) { PhaseData *pd = &g_model2->phaseData[j]; if (!first) { diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 1e3868830..b00b7c32c 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -200,8 +200,8 @@ RawSourceRange RawSource::getRange(bool singleprec) result.decimals = 1; break; case TELEMETRY_SOURCE_CONSUMPTION: - result.step = singleprec ? 20 : 1; - result.max = singleprec ? 5100 : 10000; + result.step = singleprec ? 100 : 1; + result.max = singleprec ? 25500 : 10000; break; case TELEMETRY_SOURCE_POWER: case TELEMETRY_SOURCE_POWER_MAX: @@ -272,7 +272,7 @@ QString RawSource::toString() QObject::tr("ACC"), QObject::tr("Time"), }; - static const QString virtualSwitches[] = { + static const QString logicalSwitches[] = { QObject::tr("L1"), QObject::tr("L2"), QObject::tr("L3"), QObject::tr("L4"), QObject::tr("L5"), QObject::tr("L6"), QObject::tr("L7"), QObject::tr("L8"), QObject::tr("L9"), QObject::tr("L10"), QObject::tr("L11"), QObject::tr("L12"), QObject::tr("L13"), QObject::tr("L14"), QObject::tr("L15"), QObject::tr("L16"), QObject::tr("L17"), QObject::tr("L18"), QObject::tr("L19"), QObject::tr("L20"), QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"), @@ -302,7 +302,7 @@ QString RawSource::toString() case SOURCE_TYPE_SWITCH: return (IS_TARANIS(GetEepromInterface()->getBoard()) ? CHECK_IN_ARRAY(switchesX9D, index) : CHECK_IN_ARRAY(switches9X, index)); case SOURCE_TYPE_CUSTOM_SWITCH: - return virtualSwitches[index]; + return logicalSwitches[index]; case SOURCE_TYPE_CYC: return QObject::tr("CYC%1").arg(index+1); case SOURCE_TYPE_PPM: @@ -349,13 +349,17 @@ QString RawSwitch::toString() SwitchUp('H'), SwitchDn('H'), }; - static const QString virtualSwitches[] = { + static const QString logicalSwitches[] = { QObject::tr("L1"), QObject::tr("L2"), QObject::tr("L3"), QObject::tr("L4"), QObject::tr("L5"), QObject::tr("L6"), QObject::tr("L7"), QObject::tr("L8"), QObject::tr("L9"), QObject::tr("L10"), QObject::tr("L11"), QObject::tr("L12"), QObject::tr("L13"), QObject::tr("L14"), QObject::tr("L15"), QObject::tr("L16"), QObject::tr("L17"), QObject::tr("L18"), QObject::tr("L19"), QObject::tr("L20"), QObject::tr("L21"), QObject::tr("L22"), QObject::tr("L23"), QObject::tr("L24"), QObject::tr("L25"), QObject::tr("L26"), QObject::tr("L27"), QObject::tr("L28"), QObject::tr("L29"), QObject::tr("L30"), QObject::tr("L31"), QObject::tr("L32") }; + static const QString flightModes[] = { + QObject::tr("FM0"), QObject::tr("FM1"), QObject::tr("FM2"), QObject::tr("FM3"), QObject::tr("FM4"), QObject::tr("FM5"), QObject::tr("FM6"), QObject::tr("FM7"), QObject::tr("FM8") + }; + static const QString multiposPots[] = { QObject::tr("S11"), QObject::tr("S12"), QObject::tr("S13"), QObject::tr("S14"), QObject::tr("S15"), QObject::tr("S16"), QObject::tr("S21"), QObject::tr("S22"), QObject::tr("S23"), QObject::tr("S24"), QObject::tr("S25"), QObject::tr("S26"), @@ -389,7 +393,7 @@ QString RawSwitch::toString() else return CHECK_IN_ARRAY(switches9X, index-1); case SWITCH_TYPE_VIRTUAL: - return CHECK_IN_ARRAY(virtualSwitches, index-1); + return CHECK_IN_ARRAY(logicalSwitches, index-1); case SWITCH_TYPE_MULTIPOS_POT: return CHECK_IN_ARRAY(multiposPots, index-1); case SWITCH_TYPE_TRIM: @@ -400,6 +404,8 @@ QString RawSwitch::toString() return QObject::tr("ON"); case SWITCH_TYPE_OFF: return QObject::tr("OFF"); + case SWITCH_TYPE_FLIGHT_MODE: + return CHECK_IN_ARRAY(flightModes, index-1); case SWITCH_TYPE_NONE: return QObject::tr("----"); case SWITCH_TYPE_TIMER_MODE: @@ -1060,7 +1066,7 @@ void ModelData::clear() moduleData[0].protocol=PPM; moduleData[1].protocol=OFF; } - for (int i=0; i 125) { @@ -689,7 +689,7 @@ t_Gruvin9xModelData_v106::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { diff --git a/companion/src/firmwares/gruvin9x/gruvin9xeeprom.h b/companion/src/firmwares/gruvin9x/gruvin9xeeprom.h index 8886c83d1..7a763ef6a 100644 --- a/companion/src/firmwares/gruvin9x/gruvin9xeeprom.h +++ b/companion/src/firmwares/gruvin9x/gruvin9xeeprom.h @@ -277,7 +277,7 @@ PACK(typedef struct t_Gruvin9xTimerData { t_Gruvin9xTimerData() { memset(this, 0, sizeof(t_Gruvin9xTimerData)); } }) Gruvin9xTimerData; -#define G9X_MAX_PHASES 5 +#define G9X_MAX_FLIGHT_MODES 5 #define G9X_MAX_MIXERS 32 #define G9X_MAX_EXPOS 14 #define G9X_MAX_CURVE5 8 @@ -312,7 +312,7 @@ PACK(typedef struct t_Gruvin9xModelData_v102 { Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW]; Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT]; Gruvin9xSwashRingData swashR; - Gruvin9xPhaseData_v102 phaseData[G9X_MAX_PHASES]; + Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES]; Gruvin9xFrSkyData frsky; operator ModelData(); @@ -344,7 +344,7 @@ PACK(typedef struct t_Gruvin9xModelData_v103 { Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW]; Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT]; Gruvin9xSwashRingData swashR; - Gruvin9xPhaseData_v102 phaseData[G9X_MAX_PHASES]; + Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES]; Gruvin9xFrSkyData frsky; operator ModelData(); @@ -377,7 +377,7 @@ PACK(typedef struct t_Gruvin9xModelData_v105 { Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT]; Gruvin9xFuncSwData funcSw[G9X_NUM_FSW]; Gruvin9xSwashRingData swashR; - Gruvin9xPhaseData_v102 phaseData[G9X_MAX_PHASES]; + Gruvin9xPhaseData_v102 phaseData[G9X_MAX_FLIGHT_MODES]; int16_t subtrim[NUM_STICKS]; Gruvin9xFrSkyData frsky; @@ -409,7 +409,7 @@ PACK(typedef struct t_Gruvin9xModelData_v106 { Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT]; Gruvin9xFuncSwData funcSw[G9X_NUM_FSW]; Gruvin9xSwashRingData swashR; - Gruvin9xPhaseData_v106 phaseData[G9X_MAX_PHASES]; + Gruvin9xPhaseData_v106 phaseData[G9X_MAX_FLIGHT_MODES]; Gruvin9xFrSkyData frsky; operator ModelData(); diff --git a/companion/src/firmwares/opentx/open9xGruvin9xeeprom.cpp b/companion/src/firmwares/opentx/open9xGruvin9xeeprom.cpp index 6ec5f402d..c69aa61da 100644 --- a/companion/src/firmwares/opentx/open9xGruvin9xeeprom.cpp +++ b/companion/src/firmwares/opentx/open9xGruvin9xeeprom.cpp @@ -460,7 +460,7 @@ t_Open9xGruvin9xModelData_v207::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -545,7 +545,7 @@ t_Open9xGruvin9xModelData_v208::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -634,7 +634,7 @@ t_Open9xGruvin9xModelData_v209::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -724,7 +724,7 @@ t_Open9xGruvin9xModelData_v210::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -811,7 +811,7 @@ t_Open9xGruvin9xModelData_v211::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { diff --git a/companion/src/firmwares/opentx/open9xGruvin9xeeprom.h b/companion/src/firmwares/opentx/open9xGruvin9xeeprom.h index 214e2ef6d..5ae1d0377 100644 --- a/companion/src/firmwares/opentx/open9xGruvin9xeeprom.h +++ b/companion/src/firmwares/opentx/open9xGruvin9xeeprom.h @@ -197,7 +197,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 { Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xGruvin9xSwashRingData_v208 swashR; - Open9xGruvin9xPhaseData_v207 phaseData[O9X_MAX_PHASES]; + Open9xGruvin9xPhaseData_v207 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v205 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -231,7 +231,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 { Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW]; Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xGruvin9xSwashRingData_v208 swashR; - Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES]; + Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v208 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -270,7 +270,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 { Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW]; Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xGruvin9xSwashRingData_v209 swashR; - Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES]; + Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v208 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -310,7 +310,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 { Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW]; Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW]; Open9xGruvin9xSwashRingData_v209 swashR; - Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES]; + Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES]; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -348,7 +348,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 { Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW]; Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW]; Open9xGruvin9xSwashRingData_v209 swashR; - Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES]; + Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_FLIGHT_MODES]; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; diff --git a/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp b/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp index d50b42cf0..2ea5bfbe1 100644 --- a/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp +++ b/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp @@ -767,7 +767,7 @@ t_Open9xArmModelData_v208::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -856,7 +856,7 @@ t_Open9xArmModelData_v209::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -946,7 +946,7 @@ t_Open9xArmModelData_v210::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1030,7 +1030,7 @@ t_Open9xArmModelData_v211::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1117,7 +1117,7 @@ t_Open9xArmModelData_v212::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { diff --git a/companion/src/firmwares/opentx/open9xSky9xeeprom.h b/companion/src/firmwares/opentx/open9xSky9xeeprom.h index fdb3974ee..036f9f786 100644 --- a/companion/src/firmwares/opentx/open9xSky9xeeprom.h +++ b/companion/src/firmwares/opentx/open9xSky9xeeprom.h @@ -19,7 +19,7 @@ #include "open9xStockeeprom.h" -#define O9X_ARM_MAX_PHASES 9 +#define O9X_ARM_MAX_FLIGHT_MODES 9 #define O9X_ARM_MAX_MIXERS 64 #define O9X_ARM_MAX_EXPOS 32 #define O9X_ARM_NUM_CHNOUT 32 // number of real output channels CH1-CH16 @@ -346,7 +346,7 @@ PACK(typedef struct t_Open9xArmModelData_v208 { Open9xArmLogicalSwitchData_v208 customSw[O9X_ARM_NUM_CSW]; Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW]; Open9xArmSwashRingData_v208 swashR; - Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES]; + Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES]; Open9xFrSkyData_v208 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -385,7 +385,7 @@ PACK(typedef struct t_Open9xArmModelData_v209 { Open9xArmLogicalSwitchData_v209 customSw[O9X_ARM_NUM_CSW]; Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW]; Open9xArmSwashRingData_v209 swashR; - Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES]; + Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES]; Open9xFrSkyData_v208 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -425,7 +425,7 @@ PACK(typedef struct t_Open9xArmModelData_v210 { Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW]; Open9xArmFuncSwData_v210 funcSw[O9X_ARM_NUM_FSW]; Open9xArmSwashRingData_v209 swashR; - Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES]; + Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES]; Open9xArmFrSkyData_v210 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -464,7 +464,7 @@ PACK(typedef struct t_Open9xArmModelData_v211 { Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW]; Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW]; Open9xArmSwashRingData_v209 swashR; - Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES]; + Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_FLIGHT_MODES]; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -502,7 +502,7 @@ PACK(typedef struct t_Open9xArmModelData_v212 { Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW]; Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW]; Open9xArmSwashRingData_v210 swashR; - Open9xArmPhaseData_v212 phaseData[O9X_ARM_MAX_PHASES]; + Open9xArmPhaseData_v212 phaseData[O9X_ARM_MAX_FLIGHT_MODES]; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; diff --git a/companion/src/firmwares/opentx/open9xStockeeprom.cpp b/companion/src/firmwares/opentx/open9xStockeeprom.cpp index 8c8d1abc3..e44d4fb26 100644 --- a/companion/src/firmwares/opentx/open9xStockeeprom.cpp +++ b/companion/src/firmwares/opentx/open9xStockeeprom.cpp @@ -948,7 +948,7 @@ t_Open9xModelData_v201::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1022,7 +1022,7 @@ t_Open9xModelData_v202::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1098,7 +1098,7 @@ t_Open9xModelData_v203::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1172,7 +1172,7 @@ t_Open9xModelData_v204::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1251,7 +1251,7 @@ t_Open9xModelData_v205::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1337,7 +1337,7 @@ t_Open9xModelData_v208::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1430,7 +1430,7 @@ t_Open9xModelData_v209::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1524,7 +1524,7 @@ t_Open9xModelData_v210::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { @@ -1612,7 +1612,7 @@ t_Open9xModelData_v211::operator ModelData () c9x.moduleData[0].ppmPulsePol = pulsePol; c9x.extendedLimits = extendedLimits; c9x.extendedTrims = extendedTrims; - for (int i=0; i 500) { diff --git a/companion/src/firmwares/opentx/open9xStockeeprom.h b/companion/src/firmwares/opentx/open9xStockeeprom.h index 8f121441e..41ad29c01 100644 --- a/companion/src/firmwares/opentx/open9xStockeeprom.h +++ b/companion/src/firmwares/opentx/open9xStockeeprom.h @@ -482,7 +482,7 @@ PACK(typedef struct t_Open9xTimerDataExtra { }) Open9xTimerDataExtra; #define O9X_MAX_TIMERS 2 -#define O9X_MAX_PHASES 5 +#define O9X_MAX_FLIGHT_MODES 5 #define O9X_MAX_MIXERS 32 #define O9X_MAX_EXPOS 14 #define O9X_NUM_CHNOUT 16 // number of real output channels CH1-CH16 @@ -520,7 +520,7 @@ PACK(typedef struct t_Open9xModelData_v201 { Open9xSafetySwData safetySw[O9X_NUM_CHNOUT]; Open9xFuncSwData_v201 funcSw[12]; Open9xSwashRingData_v208 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v201 frsky; operator ModelData(); @@ -551,7 +551,7 @@ PACK(typedef struct t_Open9xModelData_v202 { Open9xSafetySwData safetySw[O9X_NUM_CHNOUT]; Open9xFuncSwData_v201 funcSw[12]; Open9xSwashRingData_v208 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v202 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -584,7 +584,7 @@ PACK(typedef struct t_Open9xModelData_v203 { Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v208 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v202 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -617,7 +617,7 @@ PACK(typedef struct t_Open9xModelData_v204 { Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v208 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v204 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -650,7 +650,7 @@ PACK(typedef struct t_Open9xModelData_v205 { Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v208 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v205 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -685,7 +685,7 @@ PACK(typedef struct t_Open9xModelData_v208 { Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v208 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v208 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -724,7 +724,7 @@ PACK(typedef struct t_Open9xModelData_v209 { Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v209 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; Open9xFrSkyData_v208 frsky; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -764,7 +764,7 @@ PACK(typedef struct t_Open9xModelData_v210 { Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v209 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; @@ -802,7 +802,7 @@ PACK(typedef struct t_Open9xModelData_v211 { Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW]; Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW]; Open9xSwashRingData_v209 swashR; - Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES]; + Open9xPhaseData_v201 phaseData[O9X_MAX_FLIGHT_MODES]; int8_t ppmFrameLength; // 0=22.5ms (10ms-30ms) 0.5msec increments uint8_t thrTraceSrc; diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 911734919..5b0ba85b7 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -15,7 +15,7 @@ #define MAX_SWITCHES(board) (IS_TARANIS(board) ? 8 : 7) #define MAX_SWITCHES_POSITION(board) (IS_TARANIS(board) ? 22 : 9) #define MAX_ROTARY_ENCODERS(board) (board==BOARD_GRUVIN9X ? 2 : (board==BOARD_SKY9X ? 1 : 0)) -#define MAX_PHASES(board, version) (IS_ARM(board) ? 9 : (IS_DBLRAM(board, version) ? 6 : 5)) +#define MAX_FLIGHT_MODES(board, version) (IS_ARM(board) ? 9 : (IS_DBLRAM(board, version) ? 6 : 5)) #define MAX_MIXERS(board, version) (IS_ARM(board) ? 64 : 32) #define MAX_CHANNELS(board, version) (IS_ARM(board) ? 32 : 16) #define MAX_EXPOS(board, version) (IS_ARM(board) ? ((IS_TARANIS(board) && version >= 216) ? 64 : 32) : (IS_DBLRAM(board, version) ? 16 : 14)) @@ -91,6 +91,13 @@ class SwitchesConversionTable: public ConversionTable { addConversion(RawSwitch(SWITCH_TYPE_ON), val++); } + if (IS_ARM(board)) { + for (int i=1; i<=MAX_FLIGHT_MODES(board, version); i++) { + addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, -i), -val+offset); + addConversion(RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i), val++); + } + } + if (version < 216) { // previous "moment" switches for (int i=1; i<=MAX_SWITCHES_POSITION(board); i++) { @@ -2401,7 +2408,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne internalField.Append(new AvrCustomFunctionField(modelData.funcSw[i], board, version, variant)); } internalField.Append(new HeliField(modelData.swashRingData, board, version, variant)); - for (int i=0; igetCapability(FlightPhases); i<=GetCurrentFirmware()->getCapability(FlightPhases); i++) { + for (int i=-GetCurrentFirmware()->getCapability(FlightModes); i<=GetCurrentFirmware()->getCapability(FlightModes); i++) { if (i < 0) b->addItem(QObject::tr("!Flight mode %1").arg(-i-1), i); else if (i > 0) @@ -137,7 +137,7 @@ void populatePhasesCB(QComboBox *b, int value) else b->addItem(QObject::tr("----"), 0); } - b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightPhases)); + b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightModes)); } bool gvarsEnabled() @@ -344,7 +344,7 @@ void CurveGroup::valuesChanged() void populateGvarUseCB(QComboBox *b, unsigned int phase) { b->addItem(QObject::tr("Own value")); - for (int i=0; igetCapability(FlightPhases); i++) { + for (int i=0; igetCapability(FlightModes); i++) { if (i != (int)phase) { b->addItem(QObject::tr("Flight mode %1 value").arg(i)); } @@ -400,6 +400,13 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin b->clear(); if (attr & POPULATE_ONOFF) { + if (IS_ARM(GetCurrentFirmware()->getBoard())) { + for (int i=-GetCurrentFirmware()->getCapability(FlightModes); i<0; i++) { + item = RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i); + b->addItem(item.toString(), item.toValue()); + if (item == value) b->setCurrentIndex(b->count()-1); + } + } item = RawSwitch(SWITCH_TYPE_OFF); b->addItem(item.toString(), item.toValue()); if (item == value) b->setCurrentIndex(b->count()-1); @@ -490,6 +497,13 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin item = RawSwitch(SWITCH_TYPE_ON); b->addItem(item.toString(), item.toValue()); if (item == value) b->setCurrentIndex(b->count()-1); + if (IS_ARM(GetCurrentFirmware()->getBoard())) { + for (int i=1; i<=GetCurrentFirmware()->getCapability(FlightModes); i++) { + item = RawSwitch(SWITCH_TYPE_FLIGHT_MODE, i); + b->addItem(item.toString(), item.toValue()); + if (item == value) b->setCurrentIndex(b->count()-1); + } + } } b->setMaxVisibleItems(10); @@ -835,7 +849,7 @@ QString getProtocol(ModelData * g_model) QString getPhasesStr(unsigned int phases, ModelData & model) { - int numphases = GetCurrentFirmware()->getCapability(FlightPhases); + int numphases = GetCurrentFirmware()->getCapability(FlightModes); if (numphases && phases) { QString str; diff --git a/companion/src/modeledit/customfunctions.cpp b/companion/src/modeledit/customfunctions.cpp index 51de7cc69..c95d34d6e 100644 --- a/companion/src/modeledit/customfunctions.cpp +++ b/companion/src/modeledit/customfunctions.cpp @@ -329,8 +329,14 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified) if (modified) model.funcSw[i].param = fswtchParam[i]->value(); fswtchParam[i]->setDecimals(0); fswtchParam[i]->setSingleStep(1); - fswtchParam[i]->setMinimum(-125); - fswtchParam[i]->setMaximum(125); + if (IS_ARM(GetEepromInterface()->getBoard())) { + fswtchParam[i]->setMinimum(-500); + fswtchParam[i]->setMaximum(500); + } + else { + fswtchParam[i]->setMinimum(-125); + fswtchParam[i]->setMaximum(125); + } fswtchParam[i]->setValue(model.funcSw[i].param); widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM; } diff --git a/companion/src/modeledit/expodialog.cpp b/companion/src/modeledit/expodialog.cpp index c1a5941dd..0d66f874a 100644 --- a/companion/src/modeledit/expodialog.cpp +++ b/companion/src/modeledit/expodialog.cpp @@ -29,7 +29,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G ui->sideCB->setCurrentIndex(ed->mode-1); - if (!firmware->getCapability(FlightPhases)) { + if (!firmware->getCapability(FlightModes)) { ui->label_phases->hide(); for (int i=0; i<9; i++) { lb_fp[i]->hide(); @@ -44,7 +44,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G } mask <<= 1; } - for (int i=firmware->getCapability(FlightPhases); i<9;i++) { + for (int i=firmware->getCapability(FlightModes); i<9;i++) { lb_fp[i]->hide(); cb_fp[i]->hide(); } @@ -154,11 +154,11 @@ void ExpoDialog::valuesChanged() ed->phases<<=1; } ed->phases>>=1; - if (firmware->getCapability(FlightPhases)) { + if (firmware->getCapability(FlightModes)) { int zeros=0; int ones=0; int phtemp=ed->phases; - for (int i=0; igetCapability(FlightPhases); i++) { + for (int i=0; igetCapability(FlightModes); i++) { if (phtemp & 1) { ones++; } @@ -169,7 +169,7 @@ void ExpoDialog::valuesChanged() } if (zeros==1) { phtemp=ed->phases; - for (int i=0; igetCapability(FlightPhases); i++) { + for (int i=0; igetCapability(FlightModes); i++) { if ((phtemp & 1)==0) { break; } @@ -178,7 +178,7 @@ void ExpoDialog::valuesChanged() } else if (ones==1) { phtemp=ed->phases; - for (int i=0; igetCapability(FlightPhases); i++) { + for (int i=0; igetCapability(FlightModes); i++) { if (phtemp & 1) { break; } diff --git a/companion/src/modeledit/flightmodes.cpp b/companion/src/modeledit/flightmodes.cpp index fee46f2ea..e8e93fb24 100644 --- a/companion/src/modeledit/flightmodes.cpp +++ b/companion/src/modeledit/flightmodes.cpp @@ -5,7 +5,7 @@ #include #include -FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware): +FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware): ModelPanel(parent, model, generalSettings, firmware), ui(new Ui::FlightMode), phaseIdx(phaseIdx), @@ -16,7 +16,7 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera { ui->setupUi(this); - int modesCount = firmware->getCapability(FlightPhases); + int modesCount = firmware->getCapability(FlightModes); // Phase name QRegExp rx(CHAR_FOR_NAMES_REGEX); @@ -39,7 +39,7 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera } // FadeIn / FadeOut - if (firmware->getCapability(FlightPhasesHaveFades)) { + if (firmware->getCapability(FlightModesHaveFades)) { int scale = firmware->getCapability(SlowScale); int range = firmware->getCapability(SlowRange); ui->fadeIn->setMaximum(float(range)/scale); @@ -174,12 +174,12 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera update(); } -FlightMode::~FlightMode() +FlightModePanel::~FlightModePanel() { delete ui; } -void FlightMode::update() +void FlightModePanel::update() { ui->name->setText(phase.name); @@ -232,7 +232,7 @@ void FlightMode::update() } } -void FlightMode::phaseName_editingFinished() +void FlightModePanel::phaseName_editingFinished() { QLineEdit *lineEdit = qobject_cast(sender()); strcpy(phase.name, lineEdit->text().toAscii()); @@ -240,14 +240,14 @@ void FlightMode::phaseName_editingFinished() emit nameModified(); } -void FlightMode::phaseSwitch_currentIndexChanged(int index) +void FlightModePanel::phaseSwitch_currentIndexChanged(int index) { QComboBox *comboBox = qobject_cast(sender()); phase.swtch = RawSwitch(comboBox->itemData(index).toInt()); emit modified(); } -void FlightMode::phaseFadeIn_editingFinished() +void FlightModePanel::phaseFadeIn_editingFinished() { QDoubleSpinBox *spinBox = qobject_cast(sender()); int scale = firmware->getCapability(SlowScale); @@ -255,7 +255,7 @@ void FlightMode::phaseFadeIn_editingFinished() emit modified(); } -void FlightMode::phaseFadeOut_editingFinished() +void FlightModePanel::phaseFadeOut_editingFinished() { QDoubleSpinBox *spinBox = qobject_cast(sender()); int scale = firmware->getCapability(SlowScale); @@ -263,7 +263,7 @@ void FlightMode::phaseFadeOut_editingFinished() emit modified(); } -void FlightMode::trimUpdate(unsigned int trim) +void FlightModePanel::trimUpdate(unsigned int trim) { lock = true; int chn = CONVERT_MODE(trim+1)-1; @@ -283,7 +283,7 @@ void FlightMode::trimUpdate(unsigned int trim) lock = false; } -void FlightMode::phaseGVValue_editingFinished() +void FlightModePanel::phaseGVValue_editingFinished() { if (!lock) { QSpinBox *spinBox = qobject_cast(sender()); @@ -293,7 +293,7 @@ void FlightMode::phaseGVValue_editingFinished() } } -void FlightMode::GVName_editingFinished() +void FlightModePanel::GVName_editingFinished() { if (!lock) { QLineEdit *lineedit = qobject_cast(sender()); @@ -304,7 +304,7 @@ void FlightMode::GVName_editingFinished() } } -void FlightMode::GVSource_currentIndexChanged(int index) +void FlightModePanel::GVSource_currentIndexChanged(int index) { QComboBox *comboBox = qobject_cast(sender()); int gvar = comboBox->property("index").toInt(); @@ -312,7 +312,7 @@ void FlightMode::GVSource_currentIndexChanged(int index) emit modified(); } -void FlightMode::phaseGVUse_currentIndexChanged(int index) +void FlightModePanel::phaseGVUse_currentIndexChanged(int index) { if (!lock) { lock = true; @@ -330,14 +330,14 @@ void FlightMode::phaseGVUse_currentIndexChanged(int index) } } -void FlightMode::phaseGVPopupToggled(bool checked) +void FlightModePanel::phaseGVPopupToggled(bool checked) { QCheckBox *cb = qobject_cast(sender()); int gvar = cb->property("index").toInt(); model.gvars_popups[gvar] = checked; } -void FlightMode::phaseREValue_editingFinished() +void FlightModePanel::phaseREValue_editingFinished() { if (!lock) { QSpinBox *spinBox = qobject_cast(sender()); @@ -347,7 +347,7 @@ void FlightMode::phaseREValue_editingFinished() } } -void FlightMode::phaseREUse_currentIndexChanged(int index) +void FlightModePanel::phaseREUse_currentIndexChanged(int index) { if (!lock) { lock = true; @@ -365,7 +365,7 @@ void FlightMode::phaseREUse_currentIndexChanged(int index) } } -void FlightMode::phaseTrimUse_currentIndexChanged(int index) +void FlightModePanel::phaseTrimUse_currentIndexChanged(int index) { if (!lock) { QComboBox *comboBox = qobject_cast(sender()); @@ -387,7 +387,7 @@ void FlightMode::phaseTrimUse_currentIndexChanged(int index) } } -void FlightMode::phaseTrim_valueChanged() +void FlightModePanel::phaseTrim_valueChanged() { if (!lock) { QSpinBox *spinBox = qobject_cast(sender()); @@ -402,7 +402,7 @@ void FlightMode::phaseTrim_valueChanged() } } -void FlightMode::phaseTrimSlider_valueChanged() +void FlightModePanel::phaseTrimSlider_valueChanged() { if (!lock) { QSlider *slider = qobject_cast(sender()); @@ -419,14 +419,14 @@ void FlightMode::phaseTrimSlider_valueChanged() /**********************************************************/ -FlightModes::FlightModes(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware): +FlightModesPanel::FlightModesPanel(QWidget * parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware): ModelPanel(parent, model, generalSettings, firmware), - modesCount(firmware->getCapability(FlightPhases)) + modesCount(firmware->getCapability(FlightModes)) { QGridLayout * gridLayout = new QGridLayout(this); tabWidget = new QTabWidget(this); for (int i=0; isetProperty("index", i); panels << tab; connect(tab, SIGNAL(modified()), this, SLOT(onPhaseModified())); @@ -437,16 +437,16 @@ FlightModes::FlightModes(QWidget * parent, ModelData & model, GeneralSettings & connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(on_tabWidget_currentChanged(int))); } -FlightModes::~FlightModes() +FlightModesPanel::~FlightModesPanel() { } -void FlightModes::onPhaseModified() +void FlightModesPanel::onPhaseModified() { emit modified(); } -QString FlightModes::getTabName(int index) +QString FlightModesPanel::getTabName(int index) { QString result = tr("Flight Mode %1").arg(index); const char *name = model.phaseData[index].name; @@ -460,18 +460,18 @@ QString FlightModes::getTabName(int index) return result; } -void FlightModes::onPhaseNameChanged() +void FlightModesPanel::onPhaseNameChanged() { int index = sender()->property("index").toInt(); tabWidget->setTabText(index, getTabName(index)); } -void FlightModes::update() +void FlightModesPanel::update() { on_tabWidget_currentChanged(tabWidget->currentIndex()); } -void FlightModes::on_tabWidget_currentChanged(int index) +void FlightModesPanel::on_tabWidget_currentChanged(int index) { panels[index]->update(); } diff --git a/companion/src/modeledit/flightmodes.h b/companion/src/modeledit/flightmodes.h index 618040f4b..e2127ac5c 100644 --- a/companion/src/modeledit/flightmodes.h +++ b/companion/src/modeledit/flightmodes.h @@ -13,13 +13,13 @@ namespace Ui { class FlightMode; } -class FlightMode : public ModelPanel +class FlightModePanel : public ModelPanel { Q_OBJECT public: - FlightMode(QWidget *parent, ModelData &model, int modeIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware); - virtual ~FlightMode(); + FlightModePanel(QWidget *parent, ModelData &model, int modeIdx, GeneralSettings & generalSettings, FirmwareInterface * firmware); + virtual ~FlightModePanel(); virtual void update(); @@ -61,13 +61,13 @@ class FlightMode : public ModelPanel }; -class FlightModes : public ModelPanel +class FlightModesPanel : public ModelPanel { Q_OBJECT public: - FlightModes(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware); - virtual ~FlightModes(); + FlightModesPanel(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, FirmwareInterface * firmware); + virtual ~FlightModesPanel(); virtual void update(); @@ -80,7 +80,7 @@ class FlightModes : public ModelPanel int modesCount; QTabWidget *tabWidget; QString getTabName(int index); - QVector panels; + QVector panels; }; diff --git a/companion/src/modeledit/mixerdialog.cpp b/companion/src/modeledit/mixerdialog.cpp index 4423df656..c1a7fc4cb 100644 --- a/companion/src/modeledit/mixerdialog.cpp +++ b/companion/src/modeledit/mixerdialog.cpp @@ -55,7 +55,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G ui->mixerName->setValidator(new QRegExpValidator(rx, this)); ui->mixerName->setText(md->name); - if (!firmware->getCapability(FlightPhases)) { + if (!firmware->getCapability(FlightModes)) { ui->label_phases->hide(); for (int i=0; i<9; i++) { lb_fp[i]->hide(); @@ -70,7 +70,7 @@ MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, G } mask <<= 1; } - for (int i=firmware->getCapability(FlightPhases); i<9;i++) { + for (int i=firmware->getCapability(FlightModes); i<9;i++) { lb_fp[i]->hide(); cb_fp[i]->hide(); } diff --git a/companion/src/modeledit/modeledit.cpp b/companion/src/modeledit/modeledit.cpp index 0bccd5512..a7c9cfbcd 100644 --- a/companion/src/modeledit/modeledit.cpp +++ b/companion/src/modeledit/modeledit.cpp @@ -29,7 +29,7 @@ ModelEdit::ModelEdit(QWidget * parent, RadioData & radioData, int modelId, Firmw SetupPanel * setupPanel = new SetupPanel(this, model, generalSettings, firmware); addTab(setupPanel, tr("Setup")); addTab(new HeliPanel(this, model, generalSettings, firmware), tr("Heli")); - addTab(new FlightModes(this, model, generalSettings, firmware), tr("Flight Modes")); + addTab(new FlightModesPanel(this, model, generalSettings, firmware), tr("Flight Modes")); addTab(new InputsPanel(this, model, generalSettings, firmware), tr("Inputs")); addTab(new MixesPanel(this, model, generalSettings, firmware), tr("Mixes")); Channels * chnPanel = new Channels(this, model, generalSettings, firmware); diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index 6c2b51bf9..e347fbd94 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -1,874 +1,873 @@ -#include "printdialog.h" -#include "ui_printdialog.h" -#include "helpers.h" -#include "eeprominterface.h" -#include -#include -#include -#include - -#if !defined WIN32 && defined __GNUC__ -#include -#endif - -#define ISIZE 200 // curve image size -#define ISIZEW 400 // curve image size - -PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralSettings *gg, ModelData *gm, QString filename) : - QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), - firmware(firmware), - g_eeGeneral(gg), - g_model(gm), - printfilename(filename), - ui(new Ui::PrintDialog), - gvars(gvarsEnabled()), - gvarnum (0) -{ - if (gvars) { - gvarnum=firmware->getCapability(Gvars); - } - - ui->setupUi(this); - this->setWindowIcon(CompanionIcon("print.png")); - te = ui->textEdit; - - setWindowTitle(tr("Setup for: ") + g_model->name); - te->clear(); - QString modelname=g_model->name; - if (modelname.isEmpty()) { - curvefile5=QString("%1/curve5.png").arg(qd->tempPath()); - curvefile9=QString("%1/curve9.png").arg(qd->tempPath()); - } - else { - curvefile5=QString("%1/%2-curve5.png").arg(qd->tempPath()).arg(modelname); - curvefile9=QString("%1/%2-curve9.png").arg(qd->tempPath()).arg(modelname); - } - printSetup(); - if (gvars) { - te->append(printPhases()+"
"); - } - printInputs(); - printMixes(); - printLimits(); - printCurves(); - printGvars(); - printSwitches(); - printFSwitches(); - printFrSky(); - - te->scrollToAnchor("1"); - if (!printfilename.isEmpty()) { - printToFile(); - QTimer::singleShot(0, this, SLOT(autoClose())); - } -} - -void PrintDialog::closeEvent(QCloseEvent *event) -{ - if (printfilename.isEmpty()) { - QByteArray ba = curvefile5.toLatin1(); - char *name = ba.data(); - unlink(name); - ba = curvefile9.toLatin1(); - name = ba.data(); - unlink(name); - } -} - -PrintDialog::~PrintDialog() -{ - delete ui; -} - -QString doTC(const QString s, const QString color="", bool bold=false) -{ - QString str = s; - if(bold) str = "" + str + ""; - if(!color.isEmpty()) str = "" + str + ""; - return "
" + str + "" + str + "" + str + "
"; - str.append(QString(""); - if (!gvars) { - str.append(""); - } - str.append("

").arg((firmware->getCapability(FlightPhases) && !gvars) ? 2 : 1)); - str.append(g_model->name); - str.append(" ("); - str.append(firmware->getEepromInterface()->getName()); - str.append(")

"+tr("printed on: %1").arg(QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate))+"
"); - str.append(""); - str.append("

"+tr("General Model Settings")+"

"); - str.append(fv(tr("Name"), g_model->name)); - str.append(fv(tr("EEprom Size"), QString("%1").arg(firmware->getEepromInterface()->getSize(*g_model)))); - str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down - str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down - str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay, - str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].ppmPulsePol ? "NEG" : "POS")); - str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled"))); - str.append(fv(tr("Throttle Expo"), g_model->thrExpo ? tr("Enabled") : tr("Disabled"))); - // TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw))); - str.append(fv(tr("Trim Increment"), getTrimInc(g_model))); - str.append(fv(tr("Center Beep"), getCenterBeep(g_model))); // specify which channels beep - str.append("
"); - str.append(printPhases()); - str.append("

"); - te->append(str); -} - -QString PrintDialog::printPhases() -{ - QString str=""; - str.append(QString(""); - str.append(""); - if (gvars) { - str.append(QString(""); - } - if (firmware->getCapability(RotaryEncoders)) { - str.append(QString(""); - } - str.append(""); - QString labels[] = { tr("Rud"), tr("Ele"), tr("Thr"), tr("Ail") }; // TODO is elsewhere for sure - for (int i=0; i<4; i++) { - GeneralSettings generalSettings = *g_eeGeneral; - str.append(QString("").arg(labels[CONVERT_MODE(i+1)-1])); - } - if (gvars) { - for (unsigned int i=0; iGV%1
%2").arg(i+1).arg(g_model->gvars_names[i])); - } - } - for (int i=0; igetCapability(RotaryEncoders); i++) { - str.append(QString("
").arg((i==0 ? 'A': 'B'))); - } - str.append(""); - - for (int i=0; igetCapability(FlightPhases); i++) { - PhaseData *pd=&g_model->phaseData[i]; - str.append("").arg(i).arg(pd->name)); - str.append(QString("").arg((qreal)pd->fadeIn/firmware->getCapability(SlowScale))); - str.append(QString("").arg((qreal)pd->fadeOut/firmware->getCapability(SlowScale))); - for (int k=0; k<4; k++) { - //TODO trim values - if (pd->trimRef[k]==-1) { - str.append(QString("").arg(pd->trim[k])); - } else { - str.append("").arg(pd->trimRef[k])); - } - } - if (gvars) { - for (unsigned int k=0; kgvars[k]<=1024) { - str.append(QString(""); - } - else { - int num = pd->gvars[k] - 1025; - if (num>=i) num++; - str.append("").arg(num)); - } - } - } - for (int k=0; kgetCapability(RotaryEncoders); k++) { - if (pd->rotaryEncoders[k]<=1024) { - str.append(QString(""); - } - else { - int num = pd->rotaryEncoders[k] - 1025; - if (num>=i) num++; - str.append(QString("").arg(num)); - } - } - str.append(QString("").arg(pd->swtch.toString())); - str.append(""); - } - str.append("

").arg(!gvars ? 8+firmware->getCapability(RotaryEncoders) : 8+gvarnum+firmware->getCapability(RotaryEncoders))); - str.append(tr("Flight modes Settings")); - str.append("

 "); - str.append(tr("Fades")+""+tr("Trims")+"").arg(gvarnum)+tr("Gvars")+"").arg(firmware->getCapability(RotaryEncoders))+tr("Rot.Enc.")+""+tr("Switch")+"
"+tr("Flight mode name")); - str.append(""+tr("IN")+""+tr("OUT")+"%1RE%1
"+tr("FM")+QString("%1 %2%1%1%1"+tr("FM")+QString("%1%1").arg(pd->gvars[k])+""+tr("FM")+QString("%1%1").arg(pd->rotaryEncoders[k])+"")+tr("FM")+QString("%1%1
"); - return(str); -} - -void PrintDialog::printInputs() -{ - QString str = "

"; - str.append(tr("Inputs")); - str.append("

"); - int ec=0; - unsigned int lastCHN = 255; - for(int i=0; iexpoData[i]; - if(ed->mode==0) - continue; - ec++; - str.append(""); - str.append(""; - } - str += "
"); - if(lastCHN!=ed->chn) { - lastCHN=ed->chn; - str.append(""+getInputStr(*g_model, ed->chn)+""); - } - str.append(""); - - switch(ed->mode) { - case (1): - str += "<-"; - break; - case (2): - str += "->"; - break; - default: - str += "  "; - break; - }; - - str += " " + tr("Weight") + QString("(%1)").arg(getGVarString(ed->weight,true)); - - if (firmware->getCapability(VirtualInputs)) { - str += " " + tr("Source") + QString("(%1)").arg(ed->srcRaw.toString()); - if (ed->carryTrim>0) str += " " + tr("NoTrim"); - else if (ed->carryTrim<0) str += " " + RawSource(SOURCE_TYPE_TRIM, (-(ed->carryTrim)-1)).toString(); - } - if (ed->curve.value) str += " " + Qt::escape(ed->curve.toString()); - - if (firmware->getCapability(FlightPhases)) { - if(ed->phases) { - if (ed->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { - unsigned int mask=1; - bool first = true; - bool multiple = false; - QString strPhases; - for (int j=0; jgetCapability(FlightPhases);j++) { - if (!(ed->phases & mask)) { - //PhaseData *pd = &g_model->phaseData[j]; - const char * pdName = g_model->phaseData[j].name; - if (first) { - strPhases += Qt::escape(QString("%1").arg(getPhaseName(j+1,pdName))); - first = false; - } else { - strPhases += Qt::escape(QString(", %1").arg(getPhaseName(j+1, pdName))); - multiple = true; - } - } - mask <<= 1; - } - if (!strPhases.isEmpty()) { - str += " " + tr(multiple?"Flight modes":"Flight mode") + "(" + strPhases + ")"; - } - } else { - str += tr("DISABLED")+QString(" !!!"); - } - } - } - if (ed->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString()); - if (firmware->getCapability(HasExpoNames) && ed->name[0]) str += Qt::escape(QString(" [%1]").arg(ed->name)); - str += "

"; - if (ec>0) - te->append(str); -} - - -void PrintDialog::printMixes() -{ - QString str = "

"; - str.append(tr("Mixers")); - str.append("

"); - - unsigned int lastCHN = 255; - for(int i=0; igetCapability(Mixes); i++) { - MixData *md = &g_model->mixData[i]; - if(!md->destCh || md->destCh>(unsigned int)firmware->getCapability(Outputs) ) break; - str.append(""); - str.append(""); - } - str.append("
"); - if(lastCHN!=md->destCh) { - lastCHN=md->destCh; - - QString chname = QObject::tr("CH%1").arg(lastCHN); - // TODO not nice, Qt brings a function for that, I don't remember right now - (chname.length() < 4) ? chname.append(" ") : chname.append(" "); - if (firmware->getCapability(HasChNames)) { - QString name = g_model->limitData[lastCHN-1].name; - if (!name.isEmpty()) { - name = QString("(") + name + QString(")"); - } - name.append(" "); - chname += name.left(8); - } - chname = Qt::escape(chname); - str.append(chname.replace(" ", " ")); - } - else { - str.append(" "); - } - str.append(""); - switch(md->mltpx) { - case (1): str += " *"; break; - case (2): str += " R"; break; - default: str += "  "; break; - }; - //set mixer src model if it is unset (srcRaw needs this to generate proper toString() for input source type) - if (md->srcRaw.model == 0) - md->srcRaw.model = g_model; - str += " " + md->srcRaw.toString(); - - str += " " + Qt::escape(tr("Weight(%1)").arg(getGVarString(md->weight, true))); - - QString phasesStr = getPhasesStr(md->phases, *g_model); - if (!phasesStr.isEmpty()) str += " " + Qt::escape(phasesStr); - - if (md->swtch.type != SWITCH_TYPE_NONE) { - str += " " + Qt::escape(tr("Switch(%1)").arg(md->swtch.toString())); - } - - if (md->carryTrim) { - str += " " + Qt::escape(tr("NoTrim")); - } - - if (md->noExpo) str += " " + Qt::escape(tr("No DR/Expo")); - if (md->sOffset) str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(md->sOffset))); - if (md->curve.value) str += " " + Qt::escape(md->curve.toString()); - - - int scale = firmware->getCapability(SlowScale); - if (scale == 0) - scale = 1; - if (md->delayDown || md->delayUp) - str += Qt::escape(tr(" Delay(u%1:d%2)").arg((double)md->delayUp/scale).arg((double)md->delayDown/scale)); - if (md->speedDown || md->speedUp) - str += Qt::escape(tr(" Slow(u%1:d%2)").arg((double)md->speedUp/scale).arg((double)md->speedDown/scale)); - if (md->mixWarn) str += Qt::escape(tr(" Warn(%1)").arg(md->mixWarn)); - if (firmware->getCapability(HasMixerNames)) { - QString MixerName; - MixerName.append(md->name); - if (!MixerName.isEmpty()) { - str += " " + Qt::escape(QString("(%1)").arg(MixerName)); - } - } - str.append("

"); - te->append(str); -} - -void PrintDialog::printLimits() -{ - QString str = ""; - int numcol; - numcol=(firmware->getCapability(Outputs)+1)>17 ? 17:firmware->getCapability(Outputs)+1; - str.append(QString(""); - str.append(""); - if (firmware->getCapability(Outputs)<17) { - for(int i=0; igetCapability(Outputs); i++) { - str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); - } - str.append(""); - if (firmware->getCapability(HasChNames)) { - str.append(""); - for(int i=0; igetCapability(Outputs); i++) { - str.append(doTR(g_model->limitData[i].name,"green")); - } - } - str.append(""); - for(int i=0; igetCapability(Outputs); i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); - } - str.append(""); - str.append(""); - for(int i=0; igetCapability(Outputs); i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); - } - str.append(""); - str.append(""); - for(int i=0; igetCapability(Outputs); i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); - } - str.append(""); - str.append(""); - for(int i=0; igetCapability(Outputs); i++) { - str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); - } - } else { - for(int i=0; i<16; i++) { - str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); - } - str.append(""); - if (firmware->getCapability(HasChNames)) { - str.append(""); - for(int i=0; i<16; i++) { - str.append(doTR(g_model->limitData[i].name,"green")); - } - } - str.append(""); - for(int i=0; i<16; i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); - } - str.append(""); - str.append(""); - for(int i=0; i<16; i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); - } - str.append(""); - str.append(""); - for(int i=0; i<16; i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); - } - str.append(""); - str.append(""); - for(int i=0; i<16; i++) { - str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); - } - str.append(""); - str.append(QString(""); - str.append(""); - for(int i=16; igetCapability(Outputs); i++) { - str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); - } - str.append(""); - if (firmware->getCapability(HasChNames)) { - str.append(""); - for(int i=16; igetCapability(Outputs); i++) { - str.append(doTR(g_model->limitData[i].name,"green")); - } - } - str.append(""); - for(int i=16; igetCapability(Outputs); i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); - } - str.append(""); - str.append(""); - for(int i=16; igetCapability(Outputs); i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); - } - str.append(""); - str.append(""); - for(int i=16; igetCapability(Outputs); i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); - } - str.append(""); - str.append(""); - for(int i=16; igetCapability(Outputs); i++) { - str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); - } - } - str.append(""); - str.append("

").arg(numcol)+tr("Limits")+"

 
"+tr("Name")+"
"+tr("Offset")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
"+tr("Name")+"
"+tr("Offset")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
 ").arg(numcol)+"
 
"+tr("Name")+"
"+tr("Offset")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
"); - str.append("
"); - te->append(str); -} - -void PrintDialog::printCurves() -{ - int i,r,g,b,c,count; - char buffer[16]; - QPen pen(Qt::black, 2, Qt::SolidLine); - - QString str = "

"; - str.append(tr("Curves")); - str.append("

"); - int numcurves=firmware->getCapability(NumCurves); - if (numcurves==0) { - numcurves=16; - } - { - QImage qi(ISIZEW+1,ISIZEW+1,QImage::Format_RGB32); - QPainter painter(&qi); - painter.setBrush(QBrush("#FFFFFF")); - painter.setPen(QColor(0,0,0)); - painter.drawRect(0,0,ISIZEW,ISIZEW); - str.append(""+QString("
").arg(curvefile5)); - for(i=0; i"); - str.append(QString("").arg(i+1)); - if(i%2) str.append(""); - } - str.append("
").arg(buffer)+tr("Curve")+QString(" %1
"); - str.append(""); - str.append(doTC(" ")); - str.append(doTC(" ")); - int numpoint=0; - for(i=0; icurves[i].count>numpoint) - numpoint=g_model->curves[i].count; - } - for(i=0; i"); - for(i=0; i"); - int curvepoints=g_model->curves[i].count; - if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) - str.append(QString("").arg(i+1)); - else - str.append(QString("").arg(i+1)); - count=0; - for(int j=0; jcurves[i].points[j].y!=0) - count++; - } - for(int j=0; jcurves[i].points[j].y),"green")); - if (j>0 && count!=0) { - if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) - painter.drawLine(ISIZEW/2+(ISIZEW*g_model->curves[i].points[j-1].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW/2+(ISIZEW*g_model->curves[i].points[j].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200); - else - painter.drawLine(ISIZEW*(j-1)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW*(j)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200); - } - } - for(int j=curvepoints; j"); - if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) { - str.append(""); - for(int j=0; jcurves[i].points[j].x),"green")); - } - for(int j=curvepoints; j"); - } - } - str.append("
").arg(buffer)+tr("Curve")+QString(" %1Y").arg(buffer)+tr("Curve")+QString(" %1Y
X
"); - str.append("
"); - painter.setPen(QColor(0,0,0)); - painter.drawLine(0,ISIZEW/2,ISIZEW,ISIZEW/2); - painter.drawLine(ISIZEW/2,0,ISIZEW/2,ISIZEW); - for(i=0; i<21; i++) { - painter.drawLine(ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5,(ISIZEW*i)/(20)); - painter.drawLine((ISIZEW*i)/(20),ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5); - } - - qi.save(curvefile5, "png",100); - - } - te->append(str); -} - -void PrintDialog::printSwitches() -{ - int sc=0; - QString str = ""; - str.append(""); - str.append("

"+tr("Logical Switches")+"

"); - - for (int i=0; igetCapability(LogicalSwitches); i++) { - if (g_model->customSw[i].func) { - str.append(""); - str.append("").arg(i+1)); - QString tstr = g_model->customSw[i].toString(*g_model); - str.append(doTL(tstr,"green")); - str.append(""); - sc++; - } - } - str.append("
"+tr("L")+QString("%1
"); - str.append("
"); - if (sc!=0) - te->append(str); -} - -void PrintDialog::printGvars() -{ - if (!firmware->getCapability(GvarsFlightPhases) && (gvars && firmware->getCapability(Gvars))) { - QString str = ""; - str.append(""); - str.append("

"+tr("Global Variables")+"

"); - PhaseData *pd=&g_model->phaseData[0]; - int width=100/gvarnum; - str.append(""); - for(unsigned int i=0; i").arg(width)+tr("GV")+QString("%1").arg(i+1)); - } - str.append(""); - str.append(""); - for(unsigned int i=0; i").arg(width)+QString("%1").arg(pd->gvars[i])); - } - str.append(""); - str.append("
"); - str.append("
"); - te->append(str); - } -} - -void PrintDialog::printFSwitches() -{ - int sc=0; - QString str = ""; - str.append(""); - str.append("

"+tr("Special Functions")+"

"); - str.append(""); - str.append(doTL(tr("Switch"), "", true)); - str.append(doTL(tr("Function"), "", true)); - str.append(doTL(tr("Parameter"), "", true)); - str.append(doTL(tr("Repeat"), "", true)); - str.append(doTL(tr("Enabled"), "", true)); - str.append(""); - for(int i=0; igetCapability(CustomFunctions); i++) { - if (g_model->funcSw[i].swtch.type!=SWITCH_TYPE_NONE) { - str.append(""); - str.append(doTL(tr("SF%1").arg(i+1),"", true)); - str.append(doTL(g_model->funcSw[i].swtch.toString(),"green")); - str.append(doTL(g_model->funcSw[i].funcToString(),"green")); - str.append(doTL(g_model->funcSw[i].paramToString(),"green")); - int index=g_model->funcSw[i].func; - if ((g_model->funcSw[i].repeatParam>0) && - (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic)) { - str.append(doTL(QString("%1").arg(g_model->funcSw[i].repeatParam),"green")); - } else { - str.append(doTL( " ","green")); - } - if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) { - str.append(doTL((g_model->funcSw[i].enabled ? "ON" : "OFF"),"green")); - } else { - str.append(doTL( "---","green")); - } - str.append(""); - sc++; - } - } - str.append("
#
"); - str.append("
"); - if (sc!=0) - te->append(str); -} - -void PrintDialog::printFrSky() -{ - int tc=0; - QString str = ""; - - if (IS_TARANIS(GetEepromInterface()->getBoard())) { - str.append(""); - str.append(""); - str.append(doTC(tr("Analog"),"", true)); - str.append(doTC(tr("Range"),"", true)); - str.append(doTC(tr("Offset"),"", true)); - str.append(""); - - FrSkyData *fd=&g_model->frsky; - for (int i=0; i<2; i++) { - if (fd->channels[i].ratio!=0) { - tc++; - float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); - QString unit = " " + getFrSkyUnits(fd->channels[i].type); - str.append(""); - str.append(doTL(tr("A%1").arg(i+1), "", true)); - str.append(doTC(QString::number(ratio,10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); - str.append(doTC(QString::number((fd->channels[i].offset*ratio)/255,10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); - str.append(""); - } - } - - str.append(""); - str.append(""); - str.append(doTC(tr("Alarms"),"", true)); - str.append(doTC(tr("Low Alarm"),"", true)); - str.append(doTC(tr("Critical Alarm"),"", true)); - str.append(""); - str.append(""); - str.append(doTL(tr("RSSI"),"", true)); - str.append(doTC(QString::number(fd->rssiAlarms[0].value,10),"green")); - str.append(doTC(QString::number(fd->rssiAlarms[1].value,10),"green")); - str.append(""); - for (int i=0; i<2; i++) { - if (fd->channels[i].ratio!=0) { - float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); - QString unit = " " + getFrSkyUnits(fd->channels[i].type); - str.append(""); - str.append(doTL(tr("A%1").arg(i+1), "", true)); - str.append(doTC(QString::number(ratio*(fd->channels[i].alarms[0].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); - str.append(doTC(QString::number(ratio*(fd->channels[i].alarms[1].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); - str.append(""); - } - } - - //TODO preferrably in new tables - str.append(""); - //str.append(""); - //str.append(""); - str.append(""); - str.append("

"+tr("Telemetry Settings")+"

"+tr("Frsky serial protocol")+""+getFrSkyProtocol(fd->usrProto)+"
"+tr("Units system")+""+getFrSkyMeasure(fd->imperial)+"
"+tr("Blades")+""+QString("%1").arg(fd->blades)+"
"); - } - else { //other boards - str.append("

"+tr("Telemetry Settings")+"

 "+tr("Alarm 1")+""+tr("Alarm 2")+"
"+tr("Analog")+""+tr("Unit")+""+tr("Scale")+""+tr("Offset")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+"
"+tr("A%1").arg(i+1)+""+getFrSkyUnits(fd->channels[i].type)+""+QString::number(ratio,10,(fd->channels[i].type==0 ? 1:0))+""+QString::number((fd->channels[i].offset*ratio)/255,10,(fd->channels[i].type==0 ? 1:0))+""+getFrSkyAlarmType(fd->channels[i].alarms[0].level)+""); - str.append((fd->channels[i].alarms[0].greater==1) ? ">" : "<"); - str.append(""+QString::number(ratio*(fd->channels[i].alarms[0].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+""+getFrSkyAlarmType(fd->channels[i].alarms[1].level)+""); - str.append((fd->channels[i].alarms[1].greater==1) ? ">" : "<"); - str.append(""+QString::number(ratio*(fd->channels[i].alarms[1].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+"
 "+tr("Alarm 1")+""+tr("Alarm 2")+"
"+tr("Type")+""+tr("Condition")+""+tr("Value")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+"
"+tr("RSSI Alarm")+""+getFrSkyAlarmType(fd->rssiAlarms[0].level)+"<"+QString::number(fd->rssiAlarms[0].value,10)+""+getFrSkyAlarmType(fd->rssiAlarms[1].level)+"<"+QString::number(fd->rssiAlarms[1].value,10)+"
"+tr("Frsky serial protocol")+""+getFrSkyProtocol(fd->usrProto)+"
"+tr("Units system")+""+getFrSkyMeasure(fd->imperial)+"
"+tr("Blades")+""+fd->blades+"
"); - } -#if 0 - if (firmware->getCapability(TelemetryBars) || (firmware->getCapability(TelemetryCSFields))) { - int cols=firmware->getCapability(TelemetryColsCSFields); - if (cols==0) cols=2; - for (int j=0; jgetCapability(TelemetryCSFields)/(4*cols); j++ ) { - if (fd->screens[j].type==0) { - if (cols==2) { - str.append(""); - } else { - str.append("
"+tr("Custom Telemetry View")+"
"); - } - for (int r=0; r<4; r++) { - str.append(""); - for (int c=0; cscreens[j].body.lines[r].source[c]!=0) - tc++; - if (cols==2) { - str.append(""); - } else { - str.append(""); - } - if (c<(cols-1)) { - if (cols==2) { - str.append(""); - } else { - str.append(""); - } - } - } - str.append(""); - } - str.append("
"+tr("Custom Telemetry View")+"
"+getFrSkySrc(fd->screens[j].body.lines[r].source[c])+""+getFrSkySrc(fd->screens[j].body.lines[r].source[c])+"  
"); - } else { - str.append(""); - str.append(""); - for (int i=0; i<4; i++) { - if (fd->screens[j].body.bars[i].source!=0) - tc++; - // TODO str.append(""); - } - str.append("
"+tr("Telemetry Bars")+"
"+tr("Bar Number")+""+tr("Source")+""+tr("Min")+""+tr("Max")+"
"+QString::number(i+1,10)+""+getFrSkySrc(fd->screens[j].body.bars[i].source)+""+(fd->screens[j].body.bars[i].source>0 ? QString::number(getBarValue(fd->screens[j].body.bars[i].source, fd->screens[j].body.bars[i].barMin,fd)):"----")+""+(fd->screens[j].body.bars[i].source>0 ? QString::number(getBarValue(fd->screens[j].body.bars[i].source,(255-fd->screens[j].body.bars[i].barMax),fd)) :"----")+"
"); - } - } - } -#endif - if (tc>0) - te->append(str); -} - -void PrintDialog::on_printButton_clicked() -{ - QPrinter printer; - printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); - QPrintDialog *dialog = new QPrintDialog(&printer, this); - dialog->setWindowTitle(tr("Print Document")); - if (dialog->exec() != QDialog::Accepted) - return; - te->print(&printer); -} - -void PrintDialog::on_printFileButton_clicked() -{ - QString fn = QFileDialog::getSaveFileName(this,tr("Select PDF output file"),QString(),tr("ODF files (*.odt);;PDF Files(*.pdf);;HTML-Files (*.htm *.html);;All Files (*)")); - if (fn.isEmpty()) - return; - if (! (fn.endsWith(".odt", Qt::CaseInsensitive) || fn.endsWith(".pdf", Qt::CaseInsensitive) || fn.endsWith(".htm", Qt::CaseInsensitive) || fn.endsWith(".html", Qt::CaseInsensitive)) ) - fn += ".pdf"; // default - if (fn.endsWith(".pdf", Qt::CaseInsensitive)) { - QPrinter printer; - printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); - printer.setOutputFormat(QPrinter::PdfFormat); - printer.setColorMode(QPrinter::Color); - printer.setOutputFileName(fn); - te->print(&printer); - } else { - QTextDocumentWriter writer(fn); - writer.write(te->document()); - } -} - -void PrintDialog::printToFile() -{ - if (printfilename.isEmpty()) - return; - if (! (printfilename.endsWith(".odt", Qt::CaseInsensitive) || printfilename.endsWith(".pdf", Qt::CaseInsensitive) || printfilename.endsWith(".htm", Qt::CaseInsensitive) || printfilename.endsWith(".html", Qt::CaseInsensitive)) ) - printfilename += ".pdf"; // default - if (printfilename.endsWith(".pdf", Qt::CaseInsensitive)) { - QPrinter printer; - printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); - printer.setOutputFormat(QPrinter::PdfFormat); - printer.setColorMode(QPrinter::Color); - printer.setOutputFileName(printfilename); - te->print(&printer); - } else { - QTextDocumentWriter writer(printfilename); - writer.write(te->document()); - } -} - -void PrintDialog::autoClose() -{ - this->close(); -} +#include "printdialog.h" +#include "ui_printdialog.h" +#include "helpers.h" +#include "eeprominterface.h" +#include +#include +#include +#include + +#if !defined WIN32 && defined __GNUC__ +#include +#endif + +#define ISIZE 200 // curve image size +#define ISIZEW 400 // curve image size + +PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralSettings *gg, ModelData *gm, QString filename) : + QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), + firmware(firmware), + g_eeGeneral(gg), + g_model(gm), + printfilename(filename), + ui(new Ui::PrintDialog), + gvars(gvarsEnabled()), + gvarnum (0) +{ + if (gvars) { + gvarnum=firmware->getCapability(Gvars); + } + + ui->setupUi(this); + this->setWindowIcon(CompanionIcon("print.png")); + te = ui->textEdit; + + setWindowTitle(tr("Setup for: ") + g_model->name); + te->clear(); + QString modelname=g_model->name; + if (modelname.isEmpty()) { + curvefile5=QString("%1/curve5.png").arg(qd->tempPath()); + curvefile9=QString("%1/curve9.png").arg(qd->tempPath()); + } + else { + curvefile5=QString("%1/%2-curve5.png").arg(qd->tempPath()).arg(modelname); + curvefile9=QString("%1/%2-curve9.png").arg(qd->tempPath()).arg(modelname); + } + printSetup(); + if (gvars) { + te->append(printFlightModes()+"
"); + } + printInputs(); + printMixes(); + printLimits(); + printCurves(); + printGvars(); + printSwitches(); + printFSwitches(); + printFrSky(); + + te->scrollToAnchor("1"); + if (!printfilename.isEmpty()) { + printToFile(); + QTimer::singleShot(0, this, SLOT(autoClose())); + } +} + +void PrintDialog::closeEvent(QCloseEvent *event) +{ + if (printfilename.isEmpty()) { + QByteArray ba = curvefile5.toLatin1(); + char *name = ba.data(); + unlink(name); + ba = curvefile9.toLatin1(); + name = ba.data(); + unlink(name); + } +} + +PrintDialog::~PrintDialog() +{ + delete ui; +} + +QString doTC(const QString s, const QString color="", bool bold=false) +{ + QString str = s; + if(bold) str = "" + str + ""; + if(!color.isEmpty()) str = "" + str + ""; + return "
" + str + "" + str + "" + str + "
"; + str.append(QString(""); + if (!gvars) { + str.append(""); + } + str.append("

").arg((firmware->getCapability(FlightModes) && !gvars) ? 2 : 1)); + str.append(g_model->name); + str.append(" ("); + str.append(firmware->getEepromInterface()->getName()); + str.append(")

"+tr("printed on: %1").arg(QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate))+"
"); + str.append(""); + str.append("

"+tr("General Model Settings")+"

"); + str.append(fv(tr("Name"), g_model->name)); + str.append(fv(tr("EEprom Size"), QString("%1").arg(firmware->getEepromInterface()->getSize(*g_model)))); + str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down + str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down + str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay, + str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].ppmPulsePol ? "NEG" : "POS")); + str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled"))); + str.append(fv(tr("Throttle Expo"), g_model->thrExpo ? tr("Enabled") : tr("Disabled"))); + // TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw))); + str.append(fv(tr("Trim Increment"), getTrimInc(g_model))); + str.append(fv(tr("Center Beep"), getCenterBeep(g_model))); // specify which channels beep + str.append("
"); + str.append(printFlightModes()); + str.append("

"); + te->append(str); +} + +QString PrintDialog::printFlightModes() +{ + QString str=""; + str.append(QString(""); + str.append(""); + if (gvars) { + str.append(QString(""); + } + if (firmware->getCapability(RotaryEncoders)) { + str.append(QString(""); + } + str.append(""); + QString labels[] = { tr("Rud"), tr("Ele"), tr("Thr"), tr("Ail") }; // TODO is elsewhere for sure + for (int i=0; i<4; i++) { + GeneralSettings generalSettings = *g_eeGeneral; + str.append(QString("").arg(labels[CONVERT_MODE(i+1)-1])); + } + if (gvars) { + for (unsigned int i=0; iGV%1
%2").arg(i+1).arg(g_model->gvars_names[i])); + } + } + for (int i=0; igetCapability(RotaryEncoders); i++) { + str.append(QString("
").arg((i==0 ? 'A': 'B'))); + } + str.append(""); + for (int i=0; igetCapability(FlightModes); i++) { + PhaseData *pd=&g_model->phaseData[i]; + str.append("").arg(i).arg(pd->name)); + str.append(QString("").arg((qreal)pd->fadeIn/firmware->getCapability(SlowScale))); + str.append(QString("").arg((qreal)pd->fadeOut/firmware->getCapability(SlowScale))); + for (int k=0; k<4; k++) { + //TODO trim values + if (pd->trimRef[k]==-1) { + str.append(QString("").arg(pd->trim[k])); + } else { + str.append("").arg(pd->trimRef[k])); + } + } + if (gvars) { + for (unsigned int k=0; kgvars[k]<=1024) { + str.append(QString(""); + } + else { + int num = pd->gvars[k] - 1025; + if (num>=i) num++; + str.append("").arg(num)); + } + } + } + for (int k=0; kgetCapability(RotaryEncoders); k++) { + if (pd->rotaryEncoders[k]<=1024) { + str.append(QString(""); + } + else { + int num = pd->rotaryEncoders[k] - 1025; + if (num>=i) num++; + str.append(QString("").arg(num)); + } + } + str.append(QString("").arg(pd->swtch.toString())); + str.append(""); + } + str.append("

").arg(!gvars ? 8+firmware->getCapability(RotaryEncoders) : 8+gvarnum+firmware->getCapability(RotaryEncoders))); + str.append(tr("Flight modes")); + str.append("

 "); + str.append(tr("Fades")+""+tr("Trims")+"").arg(gvarnum)+tr("Gvars")+"").arg(firmware->getCapability(RotaryEncoders))+tr("Rot.Enc.")+""+tr("Switch")+"
"+tr("Flight mode name")); + str.append(""+tr("IN")+""+tr("OUT")+"%1RE%1
"+tr("FM")+QString("%1 %2%1%1%1"+tr("FM")+QString("%1%1").arg(pd->gvars[k])+""+tr("FM")+QString("%1%1").arg(pd->rotaryEncoders[k])+"")+tr("FM")+QString("%1%1
"); + return(str); +} + +void PrintDialog::printInputs() +{ + QString str = "

"; + str.append(tr("Inputs")); + str.append("

"); + int ec=0; + unsigned int lastCHN = 255; + for(int i=0; iexpoData[i]; + if(ed->mode==0) + continue; + ec++; + str.append(""); + str.append(""; + } + str += "
"); + if(lastCHN!=ed->chn) { + lastCHN=ed->chn; + str.append(""+getInputStr(*g_model, ed->chn)+""); + } + str.append(""); + + switch(ed->mode) { + case (1): + str += "<-"; + break; + case (2): + str += "->"; + break; + default: + str += "  "; + break; + }; + + str += " " + tr("Weight") + QString("(%1)").arg(getGVarString(ed->weight,true)); + + if (firmware->getCapability(VirtualInputs)) { + str += " " + tr("Source") + QString("(%1)").arg(ed->srcRaw.toString()); + if (ed->carryTrim>0) str += " " + tr("NoTrim"); + else if (ed->carryTrim<0) str += " " + RawSource(SOURCE_TYPE_TRIM, (-(ed->carryTrim)-1)).toString(); + } + if (ed->curve.value) str += " " + Qt::escape(ed->curve.toString()); + + if (firmware->getCapability(FlightModes)) { + if(ed->phases) { + if (ed->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { + unsigned int mask=1; + bool first = true; + bool multiple = false; + QString strModes; + for (int j=0; jgetCapability(FlightModes);j++) { + if (!(ed->phases & mask)) { + //PhaseData *pd = &g_model->phaseData[j]; + const char * pdName = g_model->phaseData[j].name; + if (first) { + strModes += Qt::escape(QString("%1").arg(getPhaseName(j+1,pdName))); + first = false; + } else { + strModes += Qt::escape(QString(", %1").arg(getPhaseName(j+1, pdName))); + multiple = true; + } + } + mask <<= 1; + } + if (!strModes.isEmpty()) { + str += " " + tr(multiple?"Flight modes":"Flight mode") + "(" + strModes + ")"; + } + } else { + str += tr("DISABLED")+QString(" !!!"); + } + } + } + if (ed->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString()); + if (firmware->getCapability(HasExpoNames) && ed->name[0]) str += Qt::escape(QString(" [%1]").arg(ed->name)); + str += "

"; + if (ec>0) + te->append(str); +} + + +void PrintDialog::printMixes() +{ + QString str = "

"; + str.append(tr("Mixers")); + str.append("

"); + + unsigned int lastCHN = 255; + for(int i=0; igetCapability(Mixes); i++) { + MixData *md = &g_model->mixData[i]; + if(!md->destCh || md->destCh>(unsigned int)firmware->getCapability(Outputs) ) break; + str.append(""); + str.append(""); + } + str.append("
"); + if(lastCHN!=md->destCh) { + lastCHN=md->destCh; + + QString chname = QObject::tr("CH%1").arg(lastCHN); + // TODO not nice, Qt brings a function for that, I don't remember right now + (chname.length() < 4) ? chname.append(" ") : chname.append(" "); + if (firmware->getCapability(HasChNames)) { + QString name = g_model->limitData[lastCHN-1].name; + if (!name.isEmpty()) { + name = QString("(") + name + QString(")"); + } + name.append(" "); + chname += name.left(8); + } + chname = Qt::escape(chname); + str.append(chname.replace(" ", " ")); + } + else { + str.append(" "); + } + str.append(""); + switch(md->mltpx) { + case (1): str += " *"; break; + case (2): str += " R"; break; + default: str += "  "; break; + }; + //set mixer src model if it is unset (srcRaw needs this to generate proper toString() for input source type) + if (md->srcRaw.model == 0) + md->srcRaw.model = g_model; + str += " " + md->srcRaw.toString(); + + str += " " + Qt::escape(tr("Weight(%1)").arg(getGVarString(md->weight, true))); + + QString phasesStr = getPhasesStr(md->phases, *g_model); + if (!phasesStr.isEmpty()) str += " " + Qt::escape(phasesStr); + + if (md->swtch.type != SWITCH_TYPE_NONE) { + str += " " + Qt::escape(tr("Switch(%1)").arg(md->swtch.toString())); + } + + if (md->carryTrim) { + str += " " + Qt::escape(tr("NoTrim")); + } + + if (md->noExpo) str += " " + Qt::escape(tr("No DR/Expo")); + if (md->sOffset) str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(md->sOffset))); + if (md->curve.value) str += " " + Qt::escape(md->curve.toString()); + + + int scale = firmware->getCapability(SlowScale); + if (scale == 0) + scale = 1; + if (md->delayDown || md->delayUp) + str += Qt::escape(tr(" Delay(u%1:d%2)").arg((double)md->delayUp/scale).arg((double)md->delayDown/scale)); + if (md->speedDown || md->speedUp) + str += Qt::escape(tr(" Slow(u%1:d%2)").arg((double)md->speedUp/scale).arg((double)md->speedDown/scale)); + if (md->mixWarn) str += Qt::escape(tr(" Warn(%1)").arg(md->mixWarn)); + if (firmware->getCapability(HasMixerNames)) { + QString MixerName; + MixerName.append(md->name); + if (!MixerName.isEmpty()) { + str += " " + Qt::escape(QString("(%1)").arg(MixerName)); + } + } + str.append("

"); + te->append(str); +} + +void PrintDialog::printLimits() +{ + QString str = ""; + int numcol; + numcol=(firmware->getCapability(Outputs)+1)>17 ? 17:firmware->getCapability(Outputs)+1; + str.append(QString(""); + str.append(""); + if (firmware->getCapability(Outputs)<17) { + for(int i=0; igetCapability(Outputs); i++) { + str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); + } + str.append(""); + if (firmware->getCapability(HasChNames)) { + str.append(""); + for(int i=0; igetCapability(Outputs); i++) { + str.append(doTR(g_model->limitData[i].name,"green")); + } + } + str.append(""); + for(int i=0; igetCapability(Outputs); i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); + } + str.append(""); + str.append(""); + for(int i=0; igetCapability(Outputs); i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); + } + str.append(""); + str.append(""); + for(int i=0; igetCapability(Outputs); i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); + } + str.append(""); + str.append(""); + for(int i=0; igetCapability(Outputs); i++) { + str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); + } + } else { + for(int i=0; i<16; i++) { + str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); + } + str.append(""); + if (firmware->getCapability(HasChNames)) { + str.append(""); + for(int i=0; i<16; i++) { + str.append(doTR(g_model->limitData[i].name,"green")); + } + } + str.append(""); + for(int i=0; i<16; i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); + } + str.append(""); + str.append(""); + for(int i=0; i<16; i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); + } + str.append(""); + str.append(""); + for(int i=0; i<16; i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); + } + str.append(""); + str.append(""); + for(int i=0; i<16; i++) { + str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); + } + str.append(""); + str.append(QString(""); + str.append(""); + for(int i=16; igetCapability(Outputs); i++) { + str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); + } + str.append(""); + if (firmware->getCapability(HasChNames)) { + str.append(""); + for(int i=16; igetCapability(Outputs); i++) { + str.append(doTR(g_model->limitData[i].name,"green")); + } + } + str.append(""); + for(int i=16; igetCapability(Outputs); i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); + } + str.append(""); + str.append(""); + for(int i=16; igetCapability(Outputs); i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); + } + str.append(""); + str.append(""); + for(int i=16; igetCapability(Outputs); i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); + } + str.append(""); + str.append(""); + for(int i=16; igetCapability(Outputs); i++) { + str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); + } + } + str.append(""); + str.append("

").arg(numcol)+tr("Limits")+"

 
"+tr("Name")+"
"+tr("Offset")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
"+tr("Name")+"
"+tr("Offset")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
 ").arg(numcol)+"
 
"+tr("Name")+"
"+tr("Offset")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
"); + str.append("
"); + te->append(str); +} + +void PrintDialog::printCurves() +{ + int i,r,g,b,c,count; + char buffer[16]; + QPen pen(Qt::black, 2, Qt::SolidLine); + + QString str = "

"; + str.append(tr("Curves")); + str.append("

"); + int numcurves=firmware->getCapability(NumCurves); + if (numcurves==0) { + numcurves=16; + } + { + QImage qi(ISIZEW+1,ISIZEW+1,QImage::Format_RGB32); + QPainter painter(&qi); + painter.setBrush(QBrush("#FFFFFF")); + painter.setPen(QColor(0,0,0)); + painter.drawRect(0,0,ISIZEW,ISIZEW); + str.append(""+QString("
").arg(curvefile5)); + for(i=0; i"); + str.append(QString("").arg(i+1)); + if(i%2) str.append(""); + } + str.append("
").arg(buffer)+tr("Curve")+QString(" %1
"); + str.append(""); + str.append(doTC(" ")); + str.append(doTC(" ")); + int numpoint=0; + for(i=0; icurves[i].count>numpoint) + numpoint=g_model->curves[i].count; + } + for(i=0; i"); + for(i=0; i"); + int curvepoints=g_model->curves[i].count; + if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) + str.append(QString("").arg(i+1)); + else + str.append(QString("").arg(i+1)); + count=0; + for(int j=0; jcurves[i].points[j].y!=0) + count++; + } + for(int j=0; jcurves[i].points[j].y),"green")); + if (j>0 && count!=0) { + if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) + painter.drawLine(ISIZEW/2+(ISIZEW*g_model->curves[i].points[j-1].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW/2+(ISIZEW*g_model->curves[i].points[j].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200); + else + painter.drawLine(ISIZEW*(j-1)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW*(j)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200); + } + } + for(int j=curvepoints; j"); + if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) { + str.append(""); + for(int j=0; jcurves[i].points[j].x),"green")); + } + for(int j=curvepoints; j"); + } + } + str.append("
").arg(buffer)+tr("Curve")+QString(" %1Y").arg(buffer)+tr("Curve")+QString(" %1Y
X
"); + str.append("
"); + painter.setPen(QColor(0,0,0)); + painter.drawLine(0,ISIZEW/2,ISIZEW,ISIZEW/2); + painter.drawLine(ISIZEW/2,0,ISIZEW/2,ISIZEW); + for(i=0; i<21; i++) { + painter.drawLine(ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5,(ISIZEW*i)/(20)); + painter.drawLine((ISIZEW*i)/(20),ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5); + } + + qi.save(curvefile5, "png",100); + + } + te->append(str); +} + +void PrintDialog::printSwitches() +{ + int sc=0; + QString str = ""; + str.append(""); + str.append("

"+tr("Logical Switches")+"

"); + + for (int i=0; igetCapability(LogicalSwitches); i++) { + if (g_model->customSw[i].func) { + str.append(""); + str.append("").arg(i+1)); + QString tstr = g_model->customSw[i].toString(*g_model); + str.append(doTL(tstr,"green")); + str.append(""); + sc++; + } + } + str.append("
"+tr("L")+QString("%1
"); + str.append("
"); + if (sc!=0) + te->append(str); +} + +void PrintDialog::printGvars() +{ + if (!firmware->getCapability(GvarsFlightModes) && (gvars && firmware->getCapability(Gvars))) { + QString str = ""; + str.append(""); + str.append("

"+tr("Global Variables")+"

"); + PhaseData *pd=&g_model->phaseData[0]; + int width=100/gvarnum; + str.append(""); + for(unsigned int i=0; i").arg(width)+tr("GV")+QString("%1").arg(i+1)); + } + str.append(""); + str.append(""); + for(unsigned int i=0; i").arg(width)+QString("%1").arg(pd->gvars[i])); + } + str.append(""); + str.append("
"); + str.append("
"); + te->append(str); + } +} + +void PrintDialog::printFSwitches() +{ + int sc=0; + QString str = ""; + str.append(""); + str.append("

"+tr("Special Functions")+"

"); + str.append(""); + str.append(doTL(tr("Switch"), "", true)); + str.append(doTL(tr("Function"), "", true)); + str.append(doTL(tr("Parameter"), "", true)); + str.append(doTL(tr("Repeat"), "", true)); + str.append(doTL(tr("Enabled"), "", true)); + str.append(""); + for(int i=0; igetCapability(CustomFunctions); i++) { + if (g_model->funcSw[i].swtch.type!=SWITCH_TYPE_NONE) { + str.append(""); + str.append(doTL(tr("SF%1").arg(i+1),"", true)); + str.append(doTL(g_model->funcSw[i].swtch.toString(),"green")); + str.append(doTL(g_model->funcSw[i].funcToString(),"green")); + str.append(doTL(g_model->funcSw[i].paramToString(),"green")); + int index=g_model->funcSw[i].func; + if ((g_model->funcSw[i].repeatParam>0) && + (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic)) { + str.append(doTL(QString("%1").arg(g_model->funcSw[i].repeatParam),"green")); + } else { + str.append(doTL( " ","green")); + } + if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) { + str.append(doTL((g_model->funcSw[i].enabled ? "ON" : "OFF"),"green")); + } else { + str.append(doTL( "---","green")); + } + str.append(""); + sc++; + } + } + str.append("
#
"); + str.append("
"); + if (sc!=0) + te->append(str); +} + +void PrintDialog::printFrSky() +{ + int tc=0; + QString str = ""; + + if (IS_TARANIS(GetEepromInterface()->getBoard())) { + str.append(""); + str.append(""); + str.append(doTC(tr("Analog"),"", true)); + str.append(doTC(tr("Range"),"", true)); + str.append(doTC(tr("Offset"),"", true)); + str.append(""); + + FrSkyData *fd=&g_model->frsky; + for (int i=0; i<2; i++) { + if (fd->channels[i].ratio!=0) { + tc++; + float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); + QString unit = " " + getFrSkyUnits(fd->channels[i].type); + str.append(""); + str.append(doTL(tr("A%1").arg(i+1), "", true)); + str.append(doTC(QString::number(ratio,10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); + str.append(doTC(QString::number((fd->channels[i].offset*ratio)/255,10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); + str.append(""); + } + } + + str.append(""); + str.append(""); + str.append(doTC(tr("Alarms"),"", true)); + str.append(doTC(tr("Low Alarm"),"", true)); + str.append(doTC(tr("Critical Alarm"),"", true)); + str.append(""); + str.append(""); + str.append(doTL(tr("RSSI"),"", true)); + str.append(doTC(QString::number(fd->rssiAlarms[0].value,10),"green")); + str.append(doTC(QString::number(fd->rssiAlarms[1].value,10),"green")); + str.append(""); + for (int i=0; i<2; i++) { + if (fd->channels[i].ratio!=0) { + float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); + QString unit = " " + getFrSkyUnits(fd->channels[i].type); + str.append(""); + str.append(doTL(tr("A%1").arg(i+1), "", true)); + str.append(doTC(QString::number(ratio*(fd->channels[i].alarms[0].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); + str.append(doTC(QString::number(ratio*(fd->channels[i].alarms[1].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); + str.append(""); + } + } + + //TODO preferrably in new tables + str.append(""); + //str.append(""); + //str.append(""); + str.append(""); + str.append("

"+tr("Telemetry Settings")+"

"+tr("Frsky serial protocol")+""+getFrSkyProtocol(fd->usrProto)+"
"+tr("Units system")+""+getFrSkyMeasure(fd->imperial)+"
"+tr("Blades")+""+QString("%1").arg(fd->blades)+"
"); + } + else { //other boards + str.append("

"+tr("Telemetry Settings")+"

 "+tr("Alarm 1")+""+tr("Alarm 2")+"
"+tr("Analog")+""+tr("Unit")+""+tr("Scale")+""+tr("Offset")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+"
"+tr("A%1").arg(i+1)+""+getFrSkyUnits(fd->channels[i].type)+""+QString::number(ratio,10,(fd->channels[i].type==0 ? 1:0))+""+QString::number((fd->channels[i].offset*ratio)/255,10,(fd->channels[i].type==0 ? 1:0))+""+getFrSkyAlarmType(fd->channels[i].alarms[0].level)+""); + str.append((fd->channels[i].alarms[0].greater==1) ? ">" : "<"); + str.append(""+QString::number(ratio*(fd->channels[i].alarms[0].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+""+getFrSkyAlarmType(fd->channels[i].alarms[1].level)+""); + str.append((fd->channels[i].alarms[1].greater==1) ? ">" : "<"); + str.append(""+QString::number(ratio*(fd->channels[i].alarms[1].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+"
 "+tr("Alarm 1")+""+tr("Alarm 2")+"
"+tr("Type")+""+tr("Condition")+""+tr("Value")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+"
"+tr("RSSI Alarm")+""+getFrSkyAlarmType(fd->rssiAlarms[0].level)+"<"+QString::number(fd->rssiAlarms[0].value,10)+""+getFrSkyAlarmType(fd->rssiAlarms[1].level)+"<"+QString::number(fd->rssiAlarms[1].value,10)+"
"+tr("Frsky serial protocol")+""+getFrSkyProtocol(fd->usrProto)+"
"+tr("Units system")+""+getFrSkyMeasure(fd->imperial)+"
"+tr("Blades")+""+fd->blades+"
"); + } +#if 0 + if (firmware->getCapability(TelemetryBars) || (firmware->getCapability(TelemetryCSFields))) { + int cols=firmware->getCapability(TelemetryColsCSFields); + if (cols==0) cols=2; + for (int j=0; jgetCapability(TelemetryCSFields)/(4*cols); j++ ) { + if (fd->screens[j].type==0) { + if (cols==2) { + str.append(""); + } else { + str.append("
"+tr("Custom Telemetry View")+"
"); + } + for (int r=0; r<4; r++) { + str.append(""); + for (int c=0; cscreens[j].body.lines[r].source[c]!=0) + tc++; + if (cols==2) { + str.append(""); + } else { + str.append(""); + } + if (c<(cols-1)) { + if (cols==2) { + str.append(""); + } else { + str.append(""); + } + } + } + str.append(""); + } + str.append("
"+tr("Custom Telemetry View")+"
"+getFrSkySrc(fd->screens[j].body.lines[r].source[c])+""+getFrSkySrc(fd->screens[j].body.lines[r].source[c])+"  
"); + } else { + str.append(""); + str.append(""); + for (int i=0; i<4; i++) { + if (fd->screens[j].body.bars[i].source!=0) + tc++; + // TODO str.append(""); + } + str.append("
"+tr("Telemetry Bars")+"
"+tr("Bar Number")+""+tr("Source")+""+tr("Min")+""+tr("Max")+"
"+QString::number(i+1,10)+""+getFrSkySrc(fd->screens[j].body.bars[i].source)+""+(fd->screens[j].body.bars[i].source>0 ? QString::number(getBarValue(fd->screens[j].body.bars[i].source, fd->screens[j].body.bars[i].barMin,fd)):"----")+""+(fd->screens[j].body.bars[i].source>0 ? QString::number(getBarValue(fd->screens[j].body.bars[i].source,(255-fd->screens[j].body.bars[i].barMax),fd)) :"----")+"
"); + } + } + } +#endif + if (tc>0) + te->append(str); +} + +void PrintDialog::on_printButton_clicked() +{ + QPrinter printer; + printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); + QPrintDialog *dialog = new QPrintDialog(&printer, this); + dialog->setWindowTitle(tr("Print Document")); + if (dialog->exec() != QDialog::Accepted) + return; + te->print(&printer); +} + +void PrintDialog::on_printFileButton_clicked() +{ + QString fn = QFileDialog::getSaveFileName(this,tr("Select PDF output file"),QString(),tr("ODF files (*.odt);;PDF Files(*.pdf);;HTML-Files (*.htm *.html);;All Files (*)")); + if (fn.isEmpty()) + return; + if (! (fn.endsWith(".odt", Qt::CaseInsensitive) || fn.endsWith(".pdf", Qt::CaseInsensitive) || fn.endsWith(".htm", Qt::CaseInsensitive) || fn.endsWith(".html", Qt::CaseInsensitive)) ) + fn += ".pdf"; // default + if (fn.endsWith(".pdf", Qt::CaseInsensitive)) { + QPrinter printer; + printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); + printer.setOutputFormat(QPrinter::PdfFormat); + printer.setColorMode(QPrinter::Color); + printer.setOutputFileName(fn); + te->print(&printer); + } else { + QTextDocumentWriter writer(fn); + writer.write(te->document()); + } +} + +void PrintDialog::printToFile() +{ + if (printfilename.isEmpty()) + return; + if (! (printfilename.endsWith(".odt", Qt::CaseInsensitive) || printfilename.endsWith(".pdf", Qt::CaseInsensitive) || printfilename.endsWith(".htm", Qt::CaseInsensitive) || printfilename.endsWith(".html", Qt::CaseInsensitive)) ) + printfilename += ".pdf"; // default + if (printfilename.endsWith(".pdf", Qt::CaseInsensitive)) { + QPrinter printer; + printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); + printer.setOutputFormat(QPrinter::PdfFormat); + printer.setColorMode(QPrinter::Color); + printer.setOutputFileName(printfilename); + te->print(&printer); + } else { + QTextDocumentWriter writer(printfilename); + writer.write(te->document()); + } +} + +void PrintDialog::autoClose() +{ + this->close(); +} diff --git a/companion/src/printdialog.h b/companion/src/printdialog.h index b0ec3da41..a6c717d7b 100644 --- a/companion/src/printdialog.h +++ b/companion/src/printdialog.h @@ -32,7 +32,7 @@ private: unsigned int gvarnum; void printSetup(); - QString printPhases(); + QString printFlightModes(); void printInputs(); void printMixes(); void printLimits(); diff --git a/companion/src/simulation/simulatordialog.cpp b/companion/src/simulation/simulatordialog.cpp index 2003abf18..761fc0c06 100644 --- a/companion/src/simulation/simulatordialog.cpp +++ b/companion/src/simulation/simulatordialog.cpp @@ -600,7 +600,7 @@ void SimulatorDialog9X::getValues() void SimulatorDialog9X::saveSwitches(void) { - qDebug() << "SimulatorDialog9X::saveSwitches()"; + // qDebug() << "SimulatorDialog9X::saveSwitches()"; switchstatus=ui->switchTHR->isChecked(); switchstatus<<=1; switchstatus+=(ui->switchRUD->isChecked()&0x1); @@ -620,7 +620,7 @@ void SimulatorDialog9X::saveSwitches(void) void SimulatorDialog9X::restoreSwitches(void) { - qDebug() << "SimulatorDialog9X::restoreSwitches()"; + // qDebug() << "SimulatorDialog9X::restoreSwitches()"; ui->switchAIL->setChecked(switchstatus & 0x1); switchstatus >>=1; ui->switchELE->setChecked(switchstatus & 0x1); @@ -705,7 +705,7 @@ void SimulatorDialogTaranis::getValues() void SimulatorDialogTaranis::saveSwitches(void) { - qDebug() << "SimulatorDialogTaranis::saveSwitches()"; + // qDebug() << "SimulatorDialogTaranis::saveSwitches()"; switchstatus=ui->switchA->value(); switchstatus<<=2; switchstatus+=ui->switchB->value(); @@ -725,7 +725,7 @@ void SimulatorDialogTaranis::saveSwitches(void) void SimulatorDialogTaranis::restoreSwitches(void) { - qDebug() << "SimulatorDialogTaranis::restoreSwitches()"; + // qDebug() << "SimulatorDialogTaranis::restoreSwitches()"; ui->switchH->setValue(switchstatus & 0x3); switchstatus>>=2; ui->switchG->setValue(switchstatus & 0x3); diff --git a/companion/src/xmlinterface.cpp b/companion/src/xmlinterface.cpp index 0c6185d96..8e1701ebe 100644 --- a/companion/src/xmlinterface.cpp +++ b/companion/src/xmlinterface.cpp @@ -155,7 +155,7 @@ void saveModel(ModelData & m, model & xm) phases xphases; phases::phase_sequence & phases_sequence (xphases.phase()); - for (int i=0; i-[on|off].wav - for (int i=0; istart, 60); switch (m_posHorz) { case 0: - CHECK_INCDEC_MODELVAR(event, timer->mode, SWSRC_FIRST, TMR_VAROFS+SWSRC_LAST-1/*--- which is OFF*/); + CHECK_INCDEC_MODELVAR(event, timer->mode, SWSRC_FIRST, TMR_VAROFS+SWSRC_LAST-1); break; case 1: CHECK_INCDEC_MODELVAR_ZERO(event, qr.quot, 59); @@ -1108,7 +1108,7 @@ void menuModelSetup(uint8_t event) s_editMode = 0; if (event==EVT_KEY_LONG(KEY_ENTER)) { s_noHi = NO_HI_LEN; - for (uint8_t i=0; i EXPO_ONE_2ND_COLUMN-FW))) continue; @@ -1835,14 +1835,14 @@ bool isTrimModeAvailable(int mode) void menuModelFlightModesAll(uint8_t event) { - MENU(STR_MENUFLIGHTPHASES, menuTabModel, e_FlightModesAll, 1+MAX_PHASES+1, {0, NAVIGATION_LINE_BY_LINE|(ITEM_PHASES_LAST-5), NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, 0}); + MENU(STR_MENUFLIGHTPHASES, menuTabModel, e_FlightModesAll, 1+MAX_FLIGHT_MODES+1, {0, NAVIGATION_LINE_BY_LINE|(ITEM_PHASES_LAST-5), NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, NAVIGATION_LINE_BY_LINE|ITEM_PHASES_LAST, 0}); int8_t sub = m_posVert - 1; horzpos_t posHorz = m_posHorz; if (sub==0 && posHorz > 0) { posHorz += 5; } - if (sub=0) { + if (sub=0) { displayColumnHeader(STR_PHASES_HEADERS, posHorz); } @@ -1850,11 +1850,11 @@ void menuModelFlightModesAll(uint8_t event) uint8_t y = 1 + (i+1)*FH; uint8_t k = i+s_pgOfs; - if (k==MAX_PHASES) { + if (k==MAX_FLIGHT_MODES) { // last line available - add the "check trims" line lcd_putsLeft((LCD_LINES-1)*FH+1, STR_CHECKTRIMS); - putsFlightPhase(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, s_perout_flight_phase+1); - if (sub==MAX_PHASES && !trimsCheckTimer) { + putsFlightMode(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, s_perout_flight_mode+1); + if (sub==MAX_FLIGHT_MODES && !trimsCheckTimer) { lcd_status_line(); } return; @@ -1862,7 +1862,7 @@ void menuModelFlightModesAll(uint8_t event) PhaseData *p = phaseAddress(k); - putsFlightPhase(0, y, k+1, (getFlightPhase()==k ? BOLD : 0) | ((sub==k && m_posHorz<0) ? INVERS : 0)); + putsFlightMode(0, y, k+1, (getFlightPhase()==k ? BOLD : 0) | ((sub==k && m_posHorz<0) ? INVERS : 0)); for (uint8_t j=0; j0) ? BLINK|INVERS : INVERS) : 0); @@ -1878,7 +1878,7 @@ void menuModelFlightModesAll(uint8_t event) } else { putsSwitches((5+LEN_FP_NAME)*FW+FW/2, y, p->swtch, attr); - if (active) CHECK_INCDEC_MODELSWITCH(event, p->swtch, SWSRC_FIRST, SWSRC_LAST); + if (active) CHECK_INCDEC_MODELSWITCH(event, p->swtch, SWSRC_FIRST_SHORT_LIST, SWSRC_LAST_SHORT_LIST); } break; @@ -1891,7 +1891,7 @@ void menuModelFlightModesAll(uint8_t event) putsTrimMode((4+LEN_FP_NAME)*FW+j*(5*FW/2), y, k, t, attr); if (active) { trim_t & v = p->trim[t]; - v.mode = checkIncDec(event, v.mode==TRIM_MODE_NONE ? -1 : v.mode, -1, 2*MAX_PHASES-1, EE_MODEL, isTrimModeAvailable); + v.mode = checkIncDec(event, v.mode==TRIM_MODE_NONE ? -1 : v.mode, -1, 2*MAX_FLIGHT_MODES-1, EE_MODEL, isTrimModeAvailable); } } break; @@ -1933,7 +1933,7 @@ enum menuModelPhaseItems { void menuModelPhaseOne(uint8_t event) { PhaseData *phase = phaseAddress(s_currIdx); - putsFlightPhase(13*FW, 0, s_currIdx+1, (getFlightPhase()==s_currIdx ? BOLD : 0)); + putsFlightMode(13*FW, 0, s_currIdx+1, (getFlightPhase()==s_currIdx ? BOLD : 0)); #if defined(GVARS) && !defined(PCBSTD) static const pm_uint8_t mstate_tab_phase1[] PROGMEM = {0, 0, 0, (uint8_t)-1, 1, 1, 1, 1, 1}; @@ -1979,7 +1979,7 @@ void menuModelPhaseOne(uint8_t event) if (attr && m_posHorz==t && ((editMode>0) || p1valdiff)) { int16_t v = getRawTrimValue(s_currIdx, t); if (v < TRIM_EXTENDED_MAX) v = TRIM_EXTENDED_MAX; - v = checkIncDec(event, v, TRIM_EXTENDED_MAX, TRIM_EXTENDED_MAX+MAX_PHASES-1, EE_MODEL); + v = checkIncDec(event, v, TRIM_EXTENDED_MAX, TRIM_EXTENDED_MAX+MAX_FLIGHT_MODES-1, EE_MODEL); if (checkIncDec_Ret) { if (v == TRIM_EXTENDED_MAX) v = 0; setTrimValue(s_currIdx, t, v); @@ -2004,7 +2004,7 @@ void menuModelPhaseOne(uint8_t event) int16_t v = phaseAddress(s_currIdx)->rotaryEncoders[t]; #endif if (v < ROTARY_ENCODER_MAX) v = ROTARY_ENCODER_MAX; - v = checkIncDec(event, v, ROTARY_ENCODER_MAX, ROTARY_ENCODER_MAX+MAX_PHASES-1, EE_MODEL); + v = checkIncDec(event, v, ROTARY_ENCODER_MAX, ROTARY_ENCODER_MAX+MAX_FLIGHT_MODES-1, EE_MODEL); if (checkIncDec_Ret) { if (v == ROTARY_ENCODER_MAX) v = 0; #if ROTARY_ENCODERS > 2 @@ -2048,14 +2048,14 @@ void menuModelPhaseOne(uint8_t event) if (v > GVAR_MAX) { uint8_t p = v - GVAR_MAX - 1; if (p >= s_currIdx) p++; - putsFlightPhase(11*FW, y, p+1, posHorz==1 ? attr : 0); + putsFlightMode(11*FW, y, p+1, posHorz==1 ? attr : 0); } else { lcd_putsAtt(11*FW, y, STR_OWN, posHorz==1 ? attr : 0); } if (attr && s_currIdx>0 && posHorz==1 && (editMode>0 || p1valdiff)) { if (v < GVAR_MAX) v = GVAR_MAX; - v = checkIncDec(event, v, GVAR_MAX, GVAR_MAX+MAX_PHASES-1, EE_MODEL); + v = checkIncDec(event, v, GVAR_MAX, GVAR_MAX+MAX_FLIGHT_MODES-1, EE_MODEL); if (checkIncDec_Ret) { if (v == GVAR_MAX) v = 0; phase->gvars[idx] = v; @@ -2095,20 +2095,20 @@ void menuModelPhaseOne(uint8_t event) void menuModelFlightModesAll(uint8_t event) { - SIMPLE_MENU(STR_MENUFLIGHTPHASES, menuTabModel, e_FlightModesAll, 1+MAX_PHASES+1); + SIMPLE_MENU(STR_MENUFLIGHTPHASES, menuTabModel, e_FlightModesAll, 1+MAX_FLIGHT_MODES+1); int8_t sub = m_posVert - 1; switch (event) { CASE_EVT_ROTARY_BREAK case EVT_KEY_FIRST(KEY_ENTER): - if (sub == MAX_PHASES) { + if (sub == MAX_FLIGHT_MODES) { s_editMode = 0; trimsCheckTimer = 200; // 2 seconds } // no break case EVT_KEY_FIRST(KEY_RIGHT): - if (sub >= 0 && sub < MAX_PHASES) { + if (sub >= 0 && sub < MAX_FLIGHT_MODES) { s_currIdx = sub; pushMenu(menuModelPhaseOne); } @@ -2116,7 +2116,7 @@ void menuModelFlightModesAll(uint8_t event) } uint8_t att; - for (uint8_t i=0; i(LCD_LINES-1)*FH+1) continue; @@ -2126,9 +2126,9 @@ void menuModelFlightModesAll(uint8_t event) att = (i==sub ? INVERS : 0); PhaseData *p = phaseAddress(i); #if ROTARY_ENCODERS > 2 - putsFlightPhase(0, y, i+1, att|CONDENSED|(getFlightPhase()==i ? BOLD : 0)); + putsFlightMode(0, y, i+1, att|CONDENSED|(getFlightPhase()==i ? BOLD : 0)); #else - putsFlightPhase(0, y, i+1, att|(getFlightPhase()==i ? BOLD : 0)); + putsFlightMode(0, y, i+1, att|(getFlightPhase()==i ? BOLD : 0)); #endif lcd_putsnAtt(4*FW+NAME_OFS, y, p->name, sizeof(p->name), ZCHAR); @@ -2153,12 +2153,12 @@ void menuModelFlightModesAll(uint8_t event) } #if defined(CPUARM) - if (s_pgOfs != MAX_PHASES-(LCD_LINES-2)) return; + if (s_pgOfs != MAX_FLIGHT_MODES-(LCD_LINES-2)) return; #endif lcd_putsLeft((LCD_LINES-1)*FH+1, STR_CHECKTRIMS); - putsFlightPhase(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, s_perout_flight_phase+1); - if (sub==MAX_PHASES && !trimsCheckTimer) { + putsFlightMode(OFS_CHECKTRIMS, (LCD_LINES-1)*FH+1, s_perout_flight_mode+1); + if (sub==MAX_FLIGHT_MODES && !trimsCheckTimer) { lcd_status_line(); } } @@ -2910,7 +2910,7 @@ void menuModelExpoOne(uint8_t event) putsMixerSource(7*FW+FW/2, 0, MIXSRC_Rud+ed->chn, 0); #endif - SUBMENU(STR_MENUINPUTS, EXPO_FIELD_MAX, {CASE_PCBTARANIS(0) IF_CPUARM(0) CASE_PCBTARANIS(0) CASE_PCBTARANIS((ed->srcRaw >= MIXSRC_FIRST_TELEM ? (uint8_t)0 : (uint8_t)HIDDEN_ROW)) 0, CASE_PCBTARANIS(0) CASE_9X(0) IF_CURVES(CURVE_ROWS) IF_FLIGHT_MODES((MAX_PHASES-1) | NAVIGATION_LINE_BY_LINE) 0 /*, ...*/}); + SUBMENU(STR_MENUINPUTS, EXPO_FIELD_MAX, {CASE_PCBTARANIS(0) IF_CPUARM(0) CASE_PCBTARANIS(0) CASE_PCBTARANIS((ed->srcRaw >= MIXSRC_FIRST_TELEM ? (uint8_t)0 : (uint8_t)HIDDEN_ROW)) 0, CASE_PCBTARANIS(0) CASE_9X(0) IF_CURVES(CURVE_ROWS) IF_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0 /*, ...*/}); SET_SCROLLBAR_X(EXPO_ONE_2ND_COLUMN+10*FW); @@ -3111,11 +3111,11 @@ void menuModelMixOne(uint8_t event) #else if (m_posVert == MIX_FIELD_TRIM && md2->srcRaw > NUM_STICKS) #endif - SUBMENU_NOTITLE(MIX_FIELD_COUNT, {IF_CPUARM(0) 0, 0, 0, CASE_9X(0) IF_CURVES(0) IF_FLIGHT_MODES((MAX_PHASES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}) + SUBMENU_NOTITLE(MIX_FIELD_COUNT, {IF_CPUARM(0) 0, 0, 0, CASE_9X(0) IF_CURVES(0) IF_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}) else - SUBMENU_NOTITLE(MIX_FIELD_COUNT, {IF_CPUARM(0) 0, 0, 0, CASE_9X(1) IF_CURVES(1) IF_FLIGHT_MODES((MAX_PHASES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}); + SUBMENU_NOTITLE(MIX_FIELD_COUNT, {IF_CPUARM(0) 0, 0, 0, CASE_9X(1) IF_CURVES(1) IF_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}); #else - SUBMENU_NOTITLE(MIX_FIELD_COUNT, {IF_CPUARM(0) 0, 0, 0, CASE_9X(1) CASE_PCBTARANIS(0) IF_CURVES(1) IF_FLIGHT_MODES((MAX_PHASES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}); + SUBMENU_NOTITLE(MIX_FIELD_COUNT, {IF_CPUARM(0) 0, 0, 0, CASE_9X(1) CASE_PCBTARANIS(0) IF_CURVES(1) IF_FLIGHT_MODES((MAX_FLIGHT_MODES-1) | NAVIGATION_LINE_BY_LINE) 0, 0 /*, ...*/}); #endif #if MENU_COLUMNS > 1 @@ -3314,7 +3314,7 @@ static uint8_t s_copySrcCh; #define EXPO_LINE_WEIGHT_POS 7*FW+1 #define EXPO_LINE_EXPO_POS 11*FW #define EXPO_LINE_SWITCH_POS 11*FW+4 - #if MAX_PHASES == 6 + #if MAX_FLIGHT_MODES == 6 #define EXPO_LINE_SIDE_POS 15*FW #else #define EXPO_LINE_SIDE_POS 15*FW+2 @@ -4102,7 +4102,7 @@ void onGVARSMenu(const char *result) eeDirty(EE_MODEL); } else if (result == STR_CLEAR) { - for (int i=0; i0) ? BLINK|INVERS : INVERS) : 0); xcoord_t x = GVARS_FM_COLUMN(j-1); @@ -4170,8 +4170,8 @@ void menuModelGVars(uint8_t event) if (v > GVAR_MAX) { uint8_t p = v - GVAR_MAX - 1; if (p >= j-1) p++; - putsFlightPhase(x-15, y, p+1, attr|SMLSIZE); - vmin = GVAR_MAX+1; vmax = GVAR_MAX+MAX_PHASES-1; + putsFlightMode(x-15, y, p+1, attr|SMLSIZE); + vmin = GVAR_MAX+1; vmax = GVAR_MAX+MAX_FLIGHT_MODES-1; } else { if (abs(v) >= 100) @@ -4967,10 +4967,11 @@ void menuModelCustomFunctions(uint8_t event) { INCDEC_DECLARE_VARS(); int16_t val_displayed = CFN_PARAM(sd); - int8_t val_min = 0; #if defined(CPUARM) + int16_t val_min = 0; int16_t val_max = 255; #else + int8_t val_min = 0; uint8_t val_max = 255; #endif if (func == FUNC_SAFETY_CHANNEL) { @@ -5084,7 +5085,7 @@ void menuModelCustomFunctions(uint8_t event) switch (CFN_GVAR_MODE(sd)) { case FUNC_ADJUST_GVAR_CONSTANT: val_displayed = (int8_t)CFN_PARAM(sd); - val_min = -125; val_max = 125; + val_min = -CFN_GVAR_CST_MAX; val_max = +CFN_GVAR_CST_MAX; lcd_outdezAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT); break; case FUNC_ADJUST_GVAR_SOURCE: diff --git a/radio/src/gui/menus.cpp b/radio/src/gui/menus.cpp index 24f3b15bb..b9453d73a 100644 --- a/radio/src/gui/menus.cpp +++ b/radio/src/gui/menus.cpp @@ -1132,7 +1132,7 @@ int8_t switchMenuItem(uint8_t x, uint8_t y, int8_t value, LcdFlags attr, uint8_t { lcd_putsColumnLeft(x, y, STR_SWITCH); putsSwitches(x, y, value, attr); - if (attr) CHECK_INCDEC_MODELSWITCH(event, value, SWSRC_FIRST, SWSRC_LAST); + if (attr) CHECK_INCDEC_MODELSWITCH(event, value, SWSRC_FIRST_SHORT_LIST, SWSRC_LAST_SHORT_LIST); return value; } @@ -1152,11 +1152,11 @@ int16_t gvarMenuItem(uint8_t x, uint8_t y, int16_t value, int16_t min, int16_t m s_editMode = !s_editMode; #if defined(CPUARM) if (attr & PREC1) - value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, s_perout_flight_phase)*10 : delta); + value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, s_perout_flight_mode)*10 : delta); else - value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, s_perout_flight_phase) : delta); + value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, s_perout_flight_mode) : delta); #else - value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, s_perout_flight_phase) : delta); + value = (GV_IS_GV_VALUE(value, min, max) ? GET_GVAR(value, min, max, s_perout_flight_mode) : delta); #endif eeDirty(EE_MODEL); } @@ -1500,8 +1500,8 @@ bool isSwitchAvailable(int swtch) swtch = -swtch; } - if (swtch >= SWSRC_FIRST_CSW && swtch <= SWSRC_LAST_CSW) { - LogicalSwitchData * cs = cswAddress(swtch-SWSRC_FIRST_CSW); + if (swtch >= SWSRC_FIRST_LOGICAL_SWITCH && swtch <= SWSRC_LAST_LOGICAL_SWITCH) { + LogicalSwitchData * cs = cswAddress(swtch-SWSRC_FIRST_LOGICAL_SWITCH); return (cs->func != LS_FUNC_NONE); } diff --git a/radio/src/gui/view_main.cpp b/radio/src/gui/view_main.cpp index c311706ee..480ec89b7 100644 --- a/radio/src/gui/view_main.cpp +++ b/radio/src/gui/view_main.cpp @@ -650,7 +650,7 @@ void menuMainView(uint8_t event) { // Flight Phase Name - uint8_t phase = s_perout_flight_phase; + uint8_t phase = s_perout_flight_mode; lcd_putsnAtt(PHASE_X, PHASE_Y, g_model.phaseData[phase].name, sizeof(g_model.phaseData[phase].name), ZCHAR|PHASE_FLAGS); // Model Name @@ -862,13 +862,13 @@ void menuMainView(uint8_t event) putsStrIdx(BITMAP_X+FW, BITMAP_Y+FH-1, STR_GV, s_gvar_last+1); lcd_putsnAtt(BITMAP_X+4*FW+FW/2, BITMAP_Y+FH-1, g_model.gvars[s_gvar_last].name, LEN_GVAR_NAME, ZCHAR); lcd_putsAtt(BITMAP_X+FW, BITMAP_Y+2*FH+3, PSTR("[\010]"), BOLD); - lcd_outdezAtt(BITMAP_X+5*FW+FW/2, BITMAP_Y+2*FH+3, GVAR_VALUE(s_gvar_last, s_perout_flight_phase), BOLD); + lcd_outdezAtt(BITMAP_X+5*FW+FW/2, BITMAP_Y+2*FH+3, GVAR_VALUE(s_gvar_last, s_perout_flight_mode), BOLD); #else s_warning = STR_GLOBAL_VAR; displayBox(); lcd_putsnAtt(16, 5*FH, g_model.gvars[s_gvar_last].name, LEN_GVAR_NAME, ZCHAR); lcd_putsAtt(16+7*FW, 5*FH, PSTR("[\010]"), BOLD); - lcd_outdezAtt(16+7*FW+4*FW+FW/2, 5*FH, GVAR_VALUE(s_gvar_last, s_perout_flight_phase), BOLD); + lcd_outdezAtt(16+7*FW+4*FW+FW/2, 5*FH, GVAR_VALUE(s_gvar_last, s_perout_flight_mode), BOLD); s_warning = NULL; #endif } diff --git a/radio/src/lcd.cpp b/radio/src/lcd.cpp index 24347e956..e5926f877 100644 --- a/radio/src/lcd.cpp +++ b/radio/src/lcd.cpp @@ -1020,11 +1020,16 @@ void putsSwitches(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att) lcd_putcAtt(x-2, y, '!', att); idx = -idx; } +#if defined(CPUARM) && defined(FLIGHT_MODES) + if (idx >= SWSRC_FIRST_FLIGHT_MODE) + putsStrIdx(x, y, STR_FP, idx-SWSRC_FIRST_FLIGHT_MODE, att); + else +#endif lcd_putsiAtt(x, y, STR_VSWITCHES, idx-1, att); } #if defined(FLIGHT_MODES) -void putsFlightPhase(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att) +void putsFlightMode(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att) { if (idx==0) { lcd_putsiAtt(x, y, STR_MMMINV, 0, att); return; } if (idx < 0) { lcd_putcAtt(x-2, y, '!', att); idx = -idx; } diff --git a/radio/src/lcd.h b/radio/src/lcd.h index 0952a48f4..185f5079f 100644 --- a/radio/src/lcd.h +++ b/radio/src/lcd.h @@ -178,7 +178,7 @@ void putsStrIdx(xcoord_t x, uint8_t y, const pm_char *str, uint8_t idx, LcdFlags void putsModelName(xcoord_t x, uint8_t y, char *name, uint8_t id, LcdFlags att); void putsSwitches(xcoord_t x, uint8_t y, int8_t swtch, LcdFlags att=0); void putsMixerSource(xcoord_t x, uint8_t y, uint8_t idx, LcdFlags att=0); -void putsFlightPhase(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att=0); +void putsFlightMode(xcoord_t x, uint8_t y, int8_t idx, LcdFlags att=0); #if defined(PCBTARANIS) && !defined(BOOT) void putsCurveRef(xcoord_t x, uint8_t y, CurveRef &curve, LcdFlags att); #endif diff --git a/radio/src/lua.cpp b/radio/src/lua.cpp index 2aacda979..dd78de586 100644 --- a/radio/src/lua.cpp +++ b/radio/src/lua.cpp @@ -741,6 +741,29 @@ static int luaModelSetOutput(lua_State *L) return 0; } + +static int luaModelGetGlobalVariable(lua_State *L) +{ + int idx = luaL_checkunsigned(L, 1); + int phase = luaL_checkunsigned(L, 2); + if (phase < MAX_FLIGHT_MODES && idx < MAX_GVARS) + lua_pushinteger(L, g_model.phaseData[phase].gvars[idx]); + else + lua_pushnil(L); + return 1; +} + +static int luaModelSetGlobalVariable(lua_State *L) +{ + int idx = luaL_checkunsigned(L, 1); + int phase = luaL_checkunsigned(L, 2); + int value = luaL_checkinteger(L, 3); + if (phase < MAX_FLIGHT_MODES && idx < MAX_GVARS && value >= -GVAR_LIMIT && value <= GVAR_LIMIT) { + g_model.phaseData[phase].gvars[idx] = value; + } + return 0; +} + static int luaPopupInput(lua_State *L) { uint8_t event = luaL_checkinteger(L, 2); @@ -849,6 +872,8 @@ static const luaL_Reg modelLib[] = { { "setCustomFunction", luaModelSetCustomFunction }, { "getOutput", luaModelGetOutput }, { "setOutput", luaModelSetOutput }, + { "getGlobalVariable", luaModelGetGlobalVariable }, + { "setGlobalVariable", luaModelSetGlobalVariable }, { NULL, NULL } /* sentinel */ }; @@ -901,7 +926,7 @@ void luaInit() lua_registerint(L, "STICK_ELEVATOR", MIXSRC_Ele); lua_registerint(L, "STICK_THROTTLE", MIXSRC_Thr); lua_registerint(L, "STICK_AILERON", MIXSRC_Ail); - lua_registerint(L, "SWITCH_LAST", SWSRC_LAST_CSW); + lua_registerint(L, "SWITCH_LAST", SWSRC_LAST_LOGICAL_SWITCH); lua_registerint(L, "EVT_MENU_BREAK", EVT_KEY_BREAK(KEY_MENU)); lua_registerint(L, "EVT_PAGE_BREAK", EVT_KEY_BREAK(KEY_PAGE)); lua_registerint(L, "EVT_ENTER_BREAK", EVT_KEY_BREAK(KEY_ENTER)); diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 0d6a1bbe1..223591cdd 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -73,7 +73,7 @@ #if defined(PCBTARANIS) #define MAX_MODELS 60 #define NUM_CHNOUT 32 // number of real output channels CH1-CH32 - #define MAX_PHASES 9 + #define MAX_FLIGHT_MODES 9 #define MAX_MIXERS 64 #define MAX_EXPOS 64 #define NUM_LOGICAL_SWITCH 32 // number of custom switches @@ -86,7 +86,7 @@ #elif defined(CPUARM) #define MAX_MODELS 60 #define NUM_CHNOUT 32 // number of real output channels CH1-CH32 - #define MAX_PHASES 9 + #define MAX_FLIGHT_MODES 9 #define MAX_MIXERS 64 #define MAX_EXPOS 32 #define NUM_LOGICAL_SWITCH 32 // number of custom switches @@ -97,7 +97,7 @@ #elif defined(CPUM2560) || defined(CPUM2561) #define MAX_MODELS 30 #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 - #define MAX_PHASES 6 + #define MAX_FLIGHT_MODES 6 #define MAX_MIXERS 32 #define MAX_EXPOS 16 #define NUM_LOGICAL_SWITCH 15 // number of custom switches @@ -108,7 +108,7 @@ #elif defined(CPUM128) #define MAX_MODELS 30 #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 - #define MAX_PHASES 5 + #define MAX_FLIGHT_MODES 5 #define MAX_MIXERS 32 #define MAX_EXPOS 14 #define NUM_LOGICAL_SWITCH 15 // number of custom switches @@ -119,7 +119,7 @@ #else #define MAX_MODELS 16 #define NUM_CHNOUT 16 // number of real output channels CH1-CH16 - #define MAX_PHASES 5 + #define MAX_FLIGHT_MODES 5 #define MAX_MIXERS 32 #define MAX_EXPOS 14 #define NUM_LOGICAL_SWITCH 12 // number of custom switches @@ -522,9 +522,9 @@ PACK(typedef struct t_ExpoData { #define limit_min_max_t int16_t #define LIMIT_EXT_PERCENT 150 #define LIMIT_EXT_MAX (LIMIT_EXT_PERCENT*10) - #define LIMIT_MAX(lim) (GV_IS_GV_VALUE(lim->max, -LIMIT_EXT_MAX, LIMIT_EXT_MAX) ? GET_GVAR(lim->max, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, s_perout_flight_phase)*10 : lim->max+1000) - #define LIMIT_MIN(lim) (GV_IS_GV_VALUE(lim->min, -LIMIT_EXT_MAX, LIMIT_EXT_MAX) ? GET_GVAR(lim->min, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, s_perout_flight_phase)*10 : lim->min-1000) - #define LIMIT_OFS(lim) (GV_IS_GV_VALUE(lim->offset, -1000, 1000) ? GET_GVAR(lim->offset, -1000, 1000, s_perout_flight_phase)*10 : lim->offset) + #define LIMIT_MAX(lim) (GV_IS_GV_VALUE(lim->max, -LIMIT_EXT_MAX, LIMIT_EXT_MAX) ? GET_GVAR(lim->max, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, s_perout_flight_mode)*10 : lim->max+1000) + #define LIMIT_MIN(lim) (GV_IS_GV_VALUE(lim->min, -LIMIT_EXT_MAX, LIMIT_EXT_MAX) ? GET_GVAR(lim->min, -LIMIT_EXT_MAX, LIMIT_EXT_MAX, s_perout_flight_mode)*10 : lim->min-1000) + #define LIMIT_OFS(lim) (GV_IS_GV_VALUE(lim->offset, -1000, 1000) ? GET_GVAR(lim->offset, -1000, 1000, s_perout_flight_mode)*10 : lim->offset) #define LIMIT_MAX_RESX(lim) calc1000toRESX(LIMIT_MAX(lim)) #define LIMIT_MIN_RESX(lim) calc1000toRESX(LIMIT_MIN(lim)) #define LIMIT_OFS_RESX(lim) calc1000toRESX(LIMIT_OFS(lim)) @@ -692,7 +692,7 @@ PACK(typedef struct t_MixData { PACK( union u_gvarint_t { struct { int8_t lo; - uint8_t hi; + uint8_t hi; } bytes_t; int16_t word; @@ -916,6 +916,7 @@ PACK(typedef struct t_CustomFnData { // Function Switches data #define CFN_GVAR_MODE(p) ((p)->all.mode) #define CFN_PARAM(p) ((p)->all.val) #define CFN_RESET(p) ((p)->active=0, (p)->clear.val1=0, (p)->clear.val2=0) +#define CFN_GVAR_CST_MAX GVAR_LIMIT #else PACK(typedef struct t_CustomFnData { PACK(union { @@ -948,6 +949,7 @@ PACK(typedef struct t_CustomFnData { #define CFN_GVAR_MODE(p) ((p)->gvar.mode) #define CFN_PARAM(p) ((p)->value) #define CFN_RESET(p) ((p)->all.active = 0, CFN_PARAM(p) = 0) +#define CFN_GVAR_CST_MAX 125 #endif enum TelemetryUnit { @@ -1244,7 +1246,7 @@ PACK(typedef struct t_SwashRingData { // Swash Ring data #define NUM_ROTARY_ENCODERS_EXTRA 2 #define NUM_ROTARY_ENCODERS (2+NUM_ROTARY_ENCODERS_EXTRA) #define ROTARY_ENCODER_ARRAY int16_t rotaryEncoders[2]; -#define ROTARY_ENCODER_ARRAY_EXTRA int16_t rotaryEncodersExtra[MAX_PHASES][NUM_ROTARY_ENCODERS_EXTRA]; +#define ROTARY_ENCODER_ARRAY_EXTRA int16_t rotaryEncodersExtra[MAX_FLIGHT_MODES][NUM_ROTARY_ENCODERS_EXTRA]; #elif defined(CPUM2560) && ROTARY_ENCODERS <= 2 #define NUM_ROTARY_ENCODERS_EXTRA 0 #define NUM_ROTARY_ENCODERS 2 @@ -1369,8 +1371,8 @@ enum SwitchSources { SWSRC_REb, #endif - SWSRC_FIRST_CSW, - SWSRC_SW1 = SWSRC_FIRST_CSW, + SWSRC_FIRST_LOGICAL_SWITCH, + SWSRC_SW1 = SWSRC_FIRST_LOGICAL_SWITCH, SWSRC_SW2, SWSRC_SW3, SWSRC_SW4, @@ -1382,13 +1384,24 @@ enum SwitchSources { SWSRC_SWA, SWSRC_SWB, SWSRC_SWC, - SWSRC_LAST_CSW = SWSRC_SW1+NUM_LOGICAL_SWITCH-1, + SWSRC_LAST_LOGICAL_SWITCH = SWSRC_FIRST_LOGICAL_SWITCH+NUM_LOGICAL_SWITCH-1, SWSRC_ON, + +#if defined(CPUARM) + SWSRC_FIRST_FLIGHT_MODE, + SWSRC_LAST_FLIGHT_MODE = SWSRC_FIRST_FLIGHT_MODE+MAX_FLIGHT_MODES-1, +#endif + + SWSRC_COUNT, + SWSRC_OFF = -SWSRC_ON, - SWSRC_FIRST = SWSRC_OFF, - SWSRC_LAST = SWSRC_ON + SWSRC_LAST = SWSRC_COUNT-1, + SWSRC_FIRST = -SWSRC_LAST, + + SWSRC_LAST_SHORT_LIST = SWSRC_LAST_LOGICAL_SWITCH, + SWSRC_FIRST_SHORT_LIST = -SWSRC_LAST_SHORT_LIST, }; enum MixSources { @@ -1680,7 +1693,7 @@ PACK(typedef struct t_ModelData { LogicalSwitchData customSw[NUM_LOGICAL_SWITCH]; CustomFnData funcSw[NUM_CFN]; SwashRingData swashR; - PhaseData phaseData[MAX_PHASES]; + PhaseData phaseData[MAX_FLIGHT_MODES]; AVR_FIELD(int8_t ppmFrameLength) // 0=22.5ms (10ms-30ms) 0.5ms increments uint8_t thrTraceSrc; diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index fd08ea0e4..520853308 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -319,7 +319,8 @@ void per10ms() if (lightOffCounter) lightOffCounter--; if (flashCounter) flashCounter--; if (s_noHi) s_noHi--; - if (trimsCheckTimer) trimsCheckTimer --; + if (trimsCheckTimer) trimsCheckTimer--; + if (ppmInValid) ppmInValid--; #if defined(RTCLOCK) /* Update global Date/Time every 100 per10ms cycles */ @@ -768,7 +769,7 @@ int applyCurve(int x, CurveRef & curve) switch (curve.type) { case CURVE_REF_DIFF: { - int curveParam = calc100to256(GET_GVAR(curve.value, -100, 100, s_perout_flight_phase)); + int curveParam = calc100to256(GET_GVAR(curve.value, -100, 100, s_perout_flight_mode)); if (curveParam > 0 && x < 0) x = (x * (256 - curveParam)) >> 8; else if (curveParam < 0 && x > 0) @@ -777,7 +778,7 @@ int applyCurve(int x, CurveRef & curve) } case CURVE_REF_EXPO: - return expo(x, GET_GVAR(curve.value, -100, 100, s_perout_flight_phase)); + return expo(x, GET_GVAR(curve.value, -100, 100, s_perout_flight_mode)); case CURVE_REF_FUNC: switch (curve.value) { @@ -980,7 +981,7 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) if (!EXPO_VALID(ed)) break; // end of list if (ed->chn == cur_chn) continue; - if (ed->phases & (1<phases & (1<swtch)) { #if defined(PCBTARANIS) @@ -1019,18 +1020,18 @@ void applyExpos(int16_t *anas, uint8_t mode APPLY_EXPOS_EXTRA_PARAMS) if (ed->curveMode == MODE_CURVE) v = applyCurve(v, curveParam); else - v = expo(v, GET_GVAR(curveParam, -100, 100, s_perout_flight_phase)); + v = expo(v, GET_GVAR(curveParam, -100, 100, s_perout_flight_mode)); } #endif //========== WEIGHT =============== - int16_t weight = GET_GVAR(ed->weight, MIN_EXPO_WEIGHT, 100, s_perout_flight_phase); + int16_t weight = GET_GVAR(ed->weight, MIN_EXPO_WEIGHT, 100, s_perout_flight_mode); weight = calc100to256(weight); v = ((int32_t)v * weight) >> 8; #if defined(PCBTARANIS) //========== OFFSET =============== - int16_t offset = GET_GVAR(ed->offset, -100, 100, s_perout_flight_phase); + int16_t offset = GET_GVAR(ed->offset, -100, 100, s_perout_flight_mode); if (offset) v += calc100toRESX(offset); //========== TRIMS ================ @@ -1267,7 +1268,7 @@ getvalue_t getValue(uint8_t i) return 0; #endif - else if (i<=MIXSRC_TrimAil) return calc1000toRESX((int16_t)8 * getTrimValue(s_perout_flight_phase, i-MIXSRC_TrimRud)); + else if (i<=MIXSRC_TrimAil) return calc1000toRESX((int16_t)8 * getTrimValue(s_perout_flight_mode, i-MIXSRC_TrimRud)); #if defined(PCBTARANIS) else if (i==MIXSRC_SA) return (switchState(SW_SA0) ? -1024 : (switchState(SW_SA1) ? 0 : 1024)); @@ -1278,7 +1279,7 @@ getvalue_t getValue(uint8_t i) else if (i==MIXSRC_SF) return (switchState(SW_SF0) ? -1024 : 1024); else if (i==MIXSRC_SG) return (switchState(SW_SG0) ? -1024 : (switchState(SW_SG1) ? 0 : 1024)); else if (i==MIXSRC_SH) return (switchState(SW_SH0) ? -1024 : 1024); - else if (i<=MIXSRC_LAST_LOGICAL_SWITCH) return getSwitch(SWSRC_FIRST_CSW+i-MIXSRC_FIRST_LOGICAL_SWITCH) ? 1024 : -1024; + else if (i<=MIXSRC_LAST_LOGICAL_SWITCH) return getSwitch(SWSRC_FIRST_LOGICAL_SWITCH+i-MIXSRC_FIRST_LOGICAL_SWITCH) ? 1024 : -1024; #else else if (i==MIXSRC_3POS) return (getSwitch(SW_ID0-SW_BASE+1) ? -1024 : (getSwitch(SW_ID1-SW_BASE+1) ? 0 : 1024)); // don't use switchState directly to give getSwitch possibility to hack values if needed for switch warning @@ -1293,7 +1294,7 @@ getvalue_t getValue(uint8_t i) else if (i<=MIXSRC_LAST_CH) return ex_chans[i-MIXSRC_CH1]; #if defined(GVARS) - else if (i<=MIXSRC_LAST_GVAR) return GVAR_VALUE(i-MIXSRC_GVAR1, getGVarFlightPhase(s_perout_flight_phase, i-MIXSRC_GVAR1)); + else if (i<=MIXSRC_LAST_GVAR) return GVAR_VALUE(i-MIXSRC_GVAR1, getGVarFlightPhase(s_perout_flight_mode, i-MIXSRC_GVAR1)); #endif else if (i==MIXSRC_FIRST_TELEM-1+TELEM_TX_VOLTAGE) return g_vbat100mV; @@ -1512,9 +1513,15 @@ bool getSwitch(int8_t swtch) else if (cs_idx == SWSRC_REb) { result = REB_DOWN(); } +#endif +#if defined(CPUARM) && defined(FLIGHT_MODES) + else if (cs_idx >= SWSRC_FIRST_FLIGHT_MODE) { + uint8_t idx = cs_idx - SWSRC_FIRST_FLIGHT_MODE; + result = (idx == s_perout_flight_mode); + } #endif else { - cs_idx -= SWSRC_FIRST_CSW; + cs_idx -= SWSRC_FIRST_LOGICAL_SWITCH; GETSWITCH_RECURSIVE_TYPE mask = ((GETSWITCH_RECURSIVE_TYPE)1 << cs_idx); if (s_last_switch_used & mask) { @@ -1800,7 +1807,7 @@ int8_t getMovedSource(GET_MOVED_SOURCE_PARAMS) #if defined(FLIGHT_MODES) uint8_t getFlightPhase() { - for (uint8_t i=1; iswtch && getSwitch(phase->swtch)) { return i; @@ -1824,7 +1831,7 @@ int getTrimValue(uint8_t phase, uint8_t idx) { #if defined(PCBTARANIS) int result = 0; - for (uint8_t i=0; itrim[idx]; if (v.mode == TRIM_MODE_NONE) return; @@ -1883,7 +1890,7 @@ void setTrimValue(uint8_t phase, uint8_t idx, int trim) #if !defined(PCBTARANIS) uint8_t getTrimFlightPhase(uint8_t phase, uint8_t idx) { - for (uint8_t i=0; i 2 int16_t value; @@ -1989,7 +1996,7 @@ uint8_t s_gvar_last = 0; uint8_t getGVarFlightPhase(uint8_t phase, uint8_t idx) { - for (uint8_t i=0; i throttle trim if applicable int16_t trim = getTrimValue(phase, i); @@ -3196,7 +3203,7 @@ void evalInputs(uint8_t mode) } #endif - if (mode <= e_perout_mode_inactive_phase && isFunctionActive(FUNCTION_TRAINER+ch)) { + if (mode <= e_perout_mode_inactive_phase && isFunctionActive(FUNCTION_TRAINER+ch) && ppmInValid) { // trainer mode TrainerMix* td = &g_eeGeneral.trainer.mix[ch]; if (td->mode) { @@ -3530,14 +3537,14 @@ void evalFunctions() #if defined(GVARS) case FUNC_ADJUST_GVAR: if (CFN_GVAR_MODE(sd) == 0) { - SET_GVAR(CFN_GVAR_INDEX(sd), CFN_PARAM(sd), s_perout_flight_phase); + SET_GVAR(CFN_GVAR_INDEX(sd), CFN_PARAM(sd), s_perout_flight_mode); } else if (CFN_GVAR_MODE(sd) == 2) { - SET_GVAR(CFN_GVAR_INDEX(sd), GVAR_VALUE(CFN_PARAM(sd), s_perout_flight_phase), s_perout_flight_phase); + SET_GVAR(CFN_GVAR_INDEX(sd), GVAR_VALUE(CFN_PARAM(sd), s_perout_flight_mode), s_perout_flight_mode); } else if (CFN_GVAR_MODE(sd) == 3) { if (!(activeFnSwitches & switch_mask)) { - SET_GVAR(CFN_GVAR_INDEX(sd), GVAR_VALUE(CFN_GVAR_INDEX(sd), getGVarFlightPhase(s_perout_flight_phase, CFN_GVAR_INDEX(sd))) + (CFN_PARAM(sd) ? +1 : -1), s_perout_flight_phase); + SET_GVAR(CFN_GVAR_INDEX(sd), GVAR_VALUE(CFN_GVAR_INDEX(sd), getGVarFlightPhase(s_perout_flight_mode, CFN_GVAR_INDEX(sd))) + (CFN_PARAM(sd) ? +1 : -1), s_perout_flight_mode); } } else if (CFN_PARAM(sd) >= MIXSRC_TrimRud && CFN_PARAM(sd) <= MIXSRC_TrimAil) { @@ -3547,12 +3554,12 @@ void evalFunctions() else if (CFN_PARAM(sd) >= MIXSRC_REa && CFN_PARAM(sd) < MIXSRC_TrimRud) { int8_t scroll = rePreviousValues[CFN_PARAM(sd)-MIXSRC_REa] - (g_rotenc[CFN_PARAM(sd)-MIXSRC_REa] / ROTARY_ENCODER_GRANULARITY); if (scroll) { - SET_GVAR(CFN_GVAR_INDEX(sd), GVAR_VALUE(CFN_GVAR_INDEX(sd), getGVarFlightPhase(s_perout_flight_phase, CFN_GVAR_INDEX(sd))) + scroll, s_perout_flight_phase); + SET_GVAR(CFN_GVAR_INDEX(sd), GVAR_VALUE(CFN_GVAR_INDEX(sd), getGVarFlightPhase(s_perout_flight_mode, CFN_GVAR_INDEX(sd))) + scroll, s_perout_flight_mode); } } #endif else { - SET_GVAR(CFN_GVAR_INDEX(sd), limit((getvalue_t)-LIMIT_EXT_MAX, getValue(CFN_PARAM(sd)), (getvalue_t)LIMIT_EXT_MAX) / 10, s_perout_flight_phase); + SET_GVAR(CFN_GVAR_INDEX(sd), limit((getvalue_t)-LIMIT_EXT_MAX, getValue(CFN_PARAM(sd)), (getvalue_t)LIMIT_EXT_MAX) / 10, s_perout_flight_mode); } break; #endif @@ -3635,7 +3642,7 @@ void evalFunctions() else { #if defined(GVARS) if (CFN_FUNC(sd) == FUNC_PLAY_TRACK && param > 250) - param = GVAR_VALUE(param-251, getGVarFlightPhase(s_perout_flight_phase, param-251)); + param = GVAR_VALUE(param-251, getGVarFlightPhase(s_perout_flight_mode, param-251)); #endif PUSH_CUSTOM_PROMPT(active ? param : param+1, i+1); } @@ -3716,7 +3723,7 @@ void evalFunctions() #define HELI_ANAS_ARRAY anas #endif -uint8_t s_perout_flight_phase; +uint8_t s_perout_flight_mode; void perOut(uint8_t mode, uint8_t tick10ms) { evalInputs(mode); @@ -3821,7 +3828,11 @@ void perOut(uint8_t mode, uint8_t tick10ms) //========== PHASE && SWITCH ===== bool mixCondition = (md->phases != 0 || md->swtch); - delayval_t mixEnabled = !(md->phases & (1 << s_perout_flight_phase)) && getSwitch(md->swtch); + delayval_t mixEnabled = !(md->phases & (1 << s_perout_flight_mode)) && getSwitch(md->swtch); + + if (mixEnabled && md->srcRaw >= MIXSRC_FIRST_TRAINER && md->srcRaw <= MIXSRC_LAST_TRAINER && !ppmInValid) { + mixEnabled = 0; + } //========== VALUE =============== getvalue_t v = 0; @@ -3906,14 +3917,14 @@ void perOut(uint8_t mode, uint8_t tick10ms) if (apply_offset_and_curve) { #if !defined(PCBTARANIS) // OFFSET is now applied AFTER weight on Taranis //========== OFFSET / SOURCE =============== - int16_t offset = GET_GVAR(MD_OFFSET(md), GV_RANGELARGE_NEG, GV_RANGELARGE, s_perout_flight_phase); + int16_t offset = GET_GVAR(MD_OFFSET(md), GV_RANGELARGE_NEG, GV_RANGELARGE, s_perout_flight_mode); if (offset) v += calc100toRESX_16Bits(offset); #endif //========== TRIMS ================ if (!(mode & e_perout_mode_notrims)) { #if defined(PCBTARANIS) - if (!md->carryTrim) { + if (md->carryTrim == 0) { int8_t mix_trim; if (stickIndex < NUM_STICKS) mix_trim = stickIndex; @@ -3921,7 +3932,13 @@ void perOut(uint8_t mode, uint8_t tick10ms) mix_trim = virtualInputsTrims[md->srcRaw-1]; else mix_trim = -1; - if (mix_trim >= 0) v += trims[mix_trim]; + if (mix_trim >= 0) { + int16_t trim = trims[mix_trim]; + if (mix_trim == THR_STICK && g_model.throttleReversed) + v -= trim; + else + v += trim; + } } #else int8_t mix_trim = md->carryTrim; @@ -3931,13 +3948,19 @@ void perOut(uint8_t mode, uint8_t tick10ms) mix_trim = stickIndex; else mix_trim = -1; - if (mix_trim >= 0) v += trims[mix_trim]; + if (mix_trim >= 0) { + int16_t trim = trims[mix_trim]; + if (mix_trim == THR_STICK && g_model.throttleReversed) + v -= trim; + else + v += trim; + } #endif } } // saves 12 bytes code if done here and not together with weight; unknown reason - int16_t weight = GET_GVAR(MD_WEIGHT(md), GV_RANGELARGE_NEG, GV_RANGELARGE, s_perout_flight_phase); + int16_t weight = GET_GVAR(MD_WEIGHT(md), GV_RANGELARGE_NEG, GV_RANGELARGE, s_perout_flight_mode); weight = calc100to256_16Bits(weight); //========== SPEED =============== @@ -3998,7 +4021,7 @@ void perOut(uint8_t mode, uint8_t tick10ms) //========== OFFSET / AFTER =============== #if defined(PCBTARANIS) if (apply_offset_and_curve) { - int16_t offset = GET_GVAR(MD_OFFSET(md), GV_RANGELARGE_NEG, GV_RANGELARGE, s_perout_flight_phase); + int16_t offset = GET_GVAR(MD_OFFSET(md), GV_RANGELARGE_NEG, GV_RANGELARGE, s_perout_flight_mode); if (offset) dv += calc100toRESX_16Bits(offset) << 8; } #endif @@ -4011,7 +4034,7 @@ void perOut(uint8_t mode, uint8_t tick10ms) #else if (md->curveMode == MODE_DIFFERENTIAL) { // @@@2 also recalculate curveParam to a 256 basis which ease the calculation later a lot - int16_t curveParam = calc100to256(GET_GVAR(md->curveParam, -100, 100, s_perout_flight_phase)); + int16_t curveParam = calc100to256(GET_GVAR(md->curveParam, -100, 100, s_perout_flight_mode)); if (curveParam > 0 && dv < 0) dv = (dv * (256 - curveParam)) >> 8; else if (curveParam < 0 && dv > 0) @@ -4140,7 +4163,7 @@ void doMixerCalculations() #endif #define MAX_ACT 0xffff - static uint16_t fp_act[MAX_PHASES] = {0}; + static uint16_t fp_act[MAX_FLIGHT_MODES] = {0}; static uint16_t delta = 0; static ACTIVE_PHASES_TYPE s_fade_flight_phases = 0; static uint8_t s_last_phase = 255; // TODO reinit everything here when the model changes, no??? @@ -4175,10 +4198,10 @@ void doMixerCalculations() int32_t weight = 0; if (s_fade_flight_phases) { memclear(sum_chans512, sizeof(sum_chans512)); - for (uint8_t p=0; p> 4) * fp_act[p]; @@ -4187,10 +4210,10 @@ void doMixerCalculations() s_last_switch_used = 0; } assert(weight); - s_perout_flight_phase = phase; + s_perout_flight_mode = phase; } else { - s_perout_flight_phase = phase; + s_perout_flight_mode = phase; perOut(e_perout_mode_normal, tick10ms); } @@ -4522,7 +4545,7 @@ void doMixerCalculations() if (s_fade_flight_phases) { uint16_t tick_delta = delta * tick10ms; - for (uint8_t p=0; p4000 && val < 16000) // G: Prioritize reset pulse. (Needed when less than 8 incoming pulses) + if (val>4000 && val < 16000) { // G: Prioritize reset pulse. (Needed when less than 8 incoming pulses) ppmInState = 1; // triggered - else - { - if (ppmInState && ppmInState<=8) - { - if (val>800 && val<2200) // if valid pulse-width range - { - g_ppmIns[ppmInState++ - 1] = - (int16_t)(val - 1500)*(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough. + } + else { + if (ppmInState>0 && ppmInState<=8) { + if (val>800 && val<2200) { // if valid pulse-width range + ppmInValid = 100; + g_ppmIns[ppmInState++ - 1] = (int16_t)(val - 1500) * (uint8_t)(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough. } - else + else { ppmInState = 0; // not triggered + } } } @@ -5215,7 +5238,7 @@ void instantTrim() for (uint8_t i=0; i(TRIM_EXTENDED_MIN, (calibratedStick[i] + trims[i]) / 2, TRIM_EXTENDED_MAX); #else @@ -5279,8 +5302,8 @@ void moveTrimsToOffsets() // copy state of 3 primary to subtrim // reset all trims, except throttle (if throttle trim) for (uint8_t i=0; i800 && val<2200) // if valid pulse-width range - { - g_ppmIns[ppmInState++ - 1] = - (int16_t)(val - 1500)*(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough. + if (ppmInState>0 && ppmInState<=16) { + if (val>800 && val<2200) { // if valid pulse-width range + ppmInValid = 100; + g_ppmIns[ppmInState++ - 1] = (int16_t)(val - 1500)*(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough. } - else + else { ppmInState = 0; // not triggered + } } } diff --git a/radio/src/targets/taranis/trainer_driver.cpp b/radio/src/targets/taranis/trainer_driver.cpp index 5e453d215..2a92fd74e 100644 --- a/radio/src/targets/taranis/trainer_driver.cpp +++ b/radio/src/targets/taranis/trainer_driver.cpp @@ -126,12 +126,13 @@ extern "C" void TIM3_IRQHandler() // We process g_ppmInsright here to make servo movement as smooth as possible // while under trainee control - if ((val>4000) && (val < 19000)) { // G: Prioritize reset pulse. (Needed when less than 16 incoming pulses) + if (val>4000 && val<19000) { // G: Prioritize reset pulse. (Needed when less than 16 incoming pulses) ppmInState = 1; // triggered } else { - if (ppmInState && (ppmInState<=16)) { - if ((val>800) && (val<2200)) { + if (ppmInState>0 && ppmInState<=16) { + if (val>800 && val<2200) { + ppmInValid = 100; g_ppmIns[ppmInState++ - 1] = (int16_t)(val - 1500)*(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough. } else { diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 9336b2ea8..0f7efd6c3 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -294,9 +294,13 @@ #define TR_A3_A4_MIN #endif -#define TR_ASPD_MAX "ASp+" +#define TR_ASPD_MAX TR("ASp+", "ASpd+") -#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Höjd""Varv""Tank""T1\0 ""T2\0 ""Fart""Avst""GHjd""Batt""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VFrt""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Hjd-""Hjd+""Rpm+""T1+\0""T2+\0""Frt+""Avs+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Tid\0" +#if LCD_W >= 212 + #define TR_VTELEMCHNS "---\0 ""Batt\0""Tmr1\0""Tmr2\0" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0 ""Rpm\0 ""Fuel\0""T1\0 ""T2\0 ""Spd\0 ""Dist\0""GAlt\0""Cell\0""Cells""Vfas\0""Curr\0""Cnsp\0""Powr\0""AccX\0""AccY\0""AccZ\0""Hdg\0 ""VSpd\0""ASpd\0""dTE\0 " TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0 ""A2-\0 " TR_A3_A4_MIN "Alt-\0""Alt+\0""Rpm+\0""T1+\0 ""T2+\0 ""Spd+\0""Dst+\0" TR_ASPD_MAX "Cell-""Cels-""Vfas-""Curr+""Powr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0 ""Time\0" +#else + #define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" +#endif #define LENGTH_UNIT_IMP "ft\0" #define SPEED_UNIT_IMP "mph" @@ -415,7 +419,7 @@ #define TR_CYC_VSRCRAW "[C1]""[C2]""[C3]" #endif -#define TR_VSRCRAW "---\0""Rod\0""Hjd\0""Gas\0""Ske\0" TR_POTS_VSRCRAW TR_ROTARY_ENCODER "MAX " TR_CYC_VSRCRAW "TrmR" "TrmH" "TrmG" "TrmS" TR_SW_VSRCRAW +#define TR_VSRCRAW "---\0""Rod\0""Hjd\0""Gas\0""Ske\0" TR_POTS_VSRCRAW TR_ROTARY_ENCODERS "MAX\0" TR_CYC_VSRCRAW "TrmR" "TrmH" "TrmG" "TrmS" TR_SW_VSRCRAW #define LEN_VTMRMODES "\003" #define TR_VTMRMODES "Av\0""ABS""GAs""GA%""GAt" @@ -440,7 +444,6 @@ #define LEN_INDENT 1 #define INDENT_WIDTH (FW/2) - #if defined(PCBTARANIS) #define TR_ENTER "[ENTER]" #else @@ -475,7 +478,7 @@ #define TR_TTRIM TR("Gastrim", INDENT "Gastrim") #define TR_BEEPCTR TR("Cent.pip", "Centerpip") #define TR_PROTO TR(INDENT "Proto", INDENT "Protokoll") -#define TR_PPMFRAME "PPM-paket" +#define TR_PPMFRAME TR(INDENT "PPM-paket", INDENT "PPM-paket") #define TR_MS "ms" #define TR_SWITCH "Brytare" #define TR_TRIMS "Trimmar" @@ -851,7 +854,6 @@ #define TR_ABOUT_HARDWARE_3 "" #endif - #define TR_ABOUT_PARENTS_1 "Ursprungsprojekt" #define TR_ABOUT_PARENTS_2 "ersky9x (Mike Blandford)" #define TR_ABOUT_PARENTS_3 "ER9X (Erez Raviv)" @@ -874,4 +876,4 @@ #define TR_VIEW_CHANNELS "Visa Kanaler" #define TR_VIEW_NOTES "Visa Noteringars" #define TR_MODS_FORBIDDEN "Modifikationer förbjudna!" -#define TR_UNLOCKED "Olåst" +#define TR_UNLOCKED "Olåst" \ No newline at end of file From 5316931fa1939ec46a74cda4b8c22893deccbe9a Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Mon, 5 May 2014 22:37:04 +0200 Subject: [PATCH 61/79] Merge branch 'next' --- companion/src/printdialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index e347fbd94..70c65bbe3 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -26,7 +26,7 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS { if (gvars) { gvarnum=firmware->getCapability(Gvars); - } + } ui->setupUi(this); this->setWindowIcon(CompanionIcon("print.png")); @@ -127,7 +127,7 @@ void PrintDialog::printSetup() str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].ppmPulsePol ? "NEG" : "POS")); str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled"))); str.append(fv(tr("Throttle Expo"), g_model->thrExpo ? tr("Enabled") : tr("Disabled"))); - // TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw))); + // TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw))); str.append(fv(tr("Trim Increment"), getTrimInc(g_model))); str.append(fv(tr("Center Beep"), getCenterBeep(g_model))); // specify which channels beep str.append("

" + str + "" + str + "" + str + "
"; - str.append(QString(""); - if (!gvars) { - str.append(""); - } - str.append("

").arg((firmware->getCapability(FlightModes) && !gvars) ? 2 : 1)); - str.append(g_model->name); - str.append(" ("); - str.append(firmware->getEepromInterface()->getName()); - str.append(")

"+tr("printed on: %1").arg(QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate))+"
"); - str.append(""); - str.append("

"+tr("General Model Settings")+"

"); - str.append(fv(tr("Name"), g_model->name)); - str.append(fv(tr("EEprom Size"), QString("%1").arg(firmware->getEepromInterface()->getSize(*g_model)))); - str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down - str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down - str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay, - str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].ppmPulsePol ? "NEG" : "POS")); - str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled"))); - str.append(fv(tr("Throttle Expo"), g_model->thrExpo ? tr("Enabled") : tr("Disabled"))); - // TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw))); - str.append(fv(tr("Trim Increment"), getTrimInc(g_model))); - str.append(fv(tr("Center Beep"), getCenterBeep(g_model))); // specify which channels beep - str.append("
"); - str.append(printFlightModes()); - str.append("

"); - te->append(str); -} - -QString PrintDialog::printFlightModes() -{ - QString str=""; - str.append(QString(""); - str.append(""); - if (gvars) { - str.append(QString(""); - } - if (firmware->getCapability(RotaryEncoders)) { - str.append(QString(""); - } - str.append(""); - QString labels[] = { tr("Rud"), tr("Ele"), tr("Thr"), tr("Ail") }; // TODO is elsewhere for sure - for (int i=0; i<4; i++) { - GeneralSettings generalSettings = *g_eeGeneral; - str.append(QString("").arg(labels[CONVERT_MODE(i+1)-1])); - } - if (gvars) { - for (unsigned int i=0; iGV%1
%2").arg(i+1).arg(g_model->gvars_names[i])); - } - } - for (int i=0; igetCapability(RotaryEncoders); i++) { - str.append(QString("
").arg((i==0 ? 'A': 'B'))); - } - str.append(""); - for (int i=0; igetCapability(FlightModes); i++) { - PhaseData *pd=&g_model->phaseData[i]; - str.append("").arg(i).arg(pd->name)); - str.append(QString("").arg((qreal)pd->fadeIn/firmware->getCapability(SlowScale))); - str.append(QString("").arg((qreal)pd->fadeOut/firmware->getCapability(SlowScale))); - for (int k=0; k<4; k++) { - //TODO trim values - if (pd->trimRef[k]==-1) { - str.append(QString("").arg(pd->trim[k])); - } else { - str.append("").arg(pd->trimRef[k])); - } - } - if (gvars) { - for (unsigned int k=0; kgvars[k]<=1024) { - str.append(QString(""); - } - else { - int num = pd->gvars[k] - 1025; - if (num>=i) num++; - str.append("").arg(num)); - } - } - } - for (int k=0; kgetCapability(RotaryEncoders); k++) { - if (pd->rotaryEncoders[k]<=1024) { - str.append(QString(""); - } - else { - int num = pd->rotaryEncoders[k] - 1025; - if (num>=i) num++; - str.append(QString("").arg(num)); - } - } - str.append(QString("").arg(pd->swtch.toString())); - str.append(""); - } - str.append("

").arg(!gvars ? 8+firmware->getCapability(RotaryEncoders) : 8+gvarnum+firmware->getCapability(RotaryEncoders))); - str.append(tr("Flight modes")); - str.append("

 "); - str.append(tr("Fades")+""+tr("Trims")+"").arg(gvarnum)+tr("Gvars")+"").arg(firmware->getCapability(RotaryEncoders))+tr("Rot.Enc.")+""+tr("Switch")+"
"+tr("Flight mode name")); - str.append(""+tr("IN")+""+tr("OUT")+"%1RE%1
"+tr("FM")+QString("%1 %2%1%1%1"+tr("FM")+QString("%1%1").arg(pd->gvars[k])+""+tr("FM")+QString("%1%1").arg(pd->rotaryEncoders[k])+"")+tr("FM")+QString("%1%1
"); - return(str); -} - -void PrintDialog::printInputs() -{ - QString str = "

"; - str.append(tr("Inputs")); - str.append("

"); - int ec=0; - unsigned int lastCHN = 255; - for(int i=0; iexpoData[i]; - if(ed->mode==0) - continue; - ec++; - str.append(""); - str.append(""; - } - str += "
"); - if(lastCHN!=ed->chn) { - lastCHN=ed->chn; - str.append(""+getInputStr(*g_model, ed->chn)+""); - } - str.append(""); - - switch(ed->mode) { - case (1): - str += "<-"; - break; - case (2): - str += "->"; - break; - default: - str += "  "; - break; - }; - - str += " " + tr("Weight") + QString("(%1)").arg(getGVarString(ed->weight,true)); - - if (firmware->getCapability(VirtualInputs)) { - str += " " + tr("Source") + QString("(%1)").arg(ed->srcRaw.toString()); - if (ed->carryTrim>0) str += " " + tr("NoTrim"); - else if (ed->carryTrim<0) str += " " + RawSource(SOURCE_TYPE_TRIM, (-(ed->carryTrim)-1)).toString(); - } - if (ed->curve.value) str += " " + Qt::escape(ed->curve.toString()); - - if (firmware->getCapability(FlightModes)) { - if(ed->phases) { - if (ed->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { - unsigned int mask=1; - bool first = true; - bool multiple = false; - QString strModes; - for (int j=0; jgetCapability(FlightModes);j++) { - if (!(ed->phases & mask)) { - //PhaseData *pd = &g_model->phaseData[j]; - const char * pdName = g_model->phaseData[j].name; - if (first) { - strModes += Qt::escape(QString("%1").arg(getPhaseName(j+1,pdName))); - first = false; - } else { - strModes += Qt::escape(QString(", %1").arg(getPhaseName(j+1, pdName))); - multiple = true; - } - } - mask <<= 1; - } - if (!strModes.isEmpty()) { - str += " " + tr(multiple?"Flight modes":"Flight mode") + "(" + strModes + ")"; - } - } else { - str += tr("DISABLED")+QString(" !!!"); - } - } - } - if (ed->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString()); - if (firmware->getCapability(HasExpoNames) && ed->name[0]) str += Qt::escape(QString(" [%1]").arg(ed->name)); - str += "

"; - if (ec>0) - te->append(str); -} - - -void PrintDialog::printMixes() -{ - QString str = "

"; - str.append(tr("Mixers")); - str.append("

"); - - unsigned int lastCHN = 255; - for(int i=0; igetCapability(Mixes); i++) { - MixData *md = &g_model->mixData[i]; - if(!md->destCh || md->destCh>(unsigned int)firmware->getCapability(Outputs) ) break; - str.append(""); - str.append(""); - } - str.append("
"); - if(lastCHN!=md->destCh) { - lastCHN=md->destCh; - - QString chname = QObject::tr("CH%1").arg(lastCHN); - // TODO not nice, Qt brings a function for that, I don't remember right now - (chname.length() < 4) ? chname.append(" ") : chname.append(" "); - if (firmware->getCapability(HasChNames)) { - QString name = g_model->limitData[lastCHN-1].name; - if (!name.isEmpty()) { - name = QString("(") + name + QString(")"); - } - name.append(" "); - chname += name.left(8); - } - chname = Qt::escape(chname); - str.append(chname.replace(" ", " ")); - } - else { - str.append(" "); - } - str.append(""); - switch(md->mltpx) { - case (1): str += " *"; break; - case (2): str += " R"; break; - default: str += "  "; break; - }; - //set mixer src model if it is unset (srcRaw needs this to generate proper toString() for input source type) - if (md->srcRaw.model == 0) - md->srcRaw.model = g_model; - str += " " + md->srcRaw.toString(); - - str += " " + Qt::escape(tr("Weight(%1)").arg(getGVarString(md->weight, true))); - - QString phasesStr = getPhasesStr(md->phases, *g_model); - if (!phasesStr.isEmpty()) str += " " + Qt::escape(phasesStr); - - if (md->swtch.type != SWITCH_TYPE_NONE) { - str += " " + Qt::escape(tr("Switch(%1)").arg(md->swtch.toString())); - } - - if (md->carryTrim) { - str += " " + Qt::escape(tr("NoTrim")); - } - - if (md->noExpo) str += " " + Qt::escape(tr("No DR/Expo")); - if (md->sOffset) str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(md->sOffset))); - if (md->curve.value) str += " " + Qt::escape(md->curve.toString()); - - - int scale = firmware->getCapability(SlowScale); - if (scale == 0) - scale = 1; - if (md->delayDown || md->delayUp) - str += Qt::escape(tr(" Delay(u%1:d%2)").arg((double)md->delayUp/scale).arg((double)md->delayDown/scale)); - if (md->speedDown || md->speedUp) - str += Qt::escape(tr(" Slow(u%1:d%2)").arg((double)md->speedUp/scale).arg((double)md->speedDown/scale)); - if (md->mixWarn) str += Qt::escape(tr(" Warn(%1)").arg(md->mixWarn)); - if (firmware->getCapability(HasMixerNames)) { - QString MixerName; - MixerName.append(md->name); - if (!MixerName.isEmpty()) { - str += " " + Qt::escape(QString("(%1)").arg(MixerName)); - } - } - str.append("

"); - te->append(str); -} - -void PrintDialog::printLimits() -{ - QString str = ""; - int numcol; - numcol=(firmware->getCapability(Outputs)+1)>17 ? 17:firmware->getCapability(Outputs)+1; - str.append(QString(""); - str.append(""); - if (firmware->getCapability(Outputs)<17) { - for(int i=0; igetCapability(Outputs); i++) { - str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); - } - str.append(""); - if (firmware->getCapability(HasChNames)) { - str.append(""); - for(int i=0; igetCapability(Outputs); i++) { - str.append(doTR(g_model->limitData[i].name,"green")); - } - } - str.append(""); - for(int i=0; igetCapability(Outputs); i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); - } - str.append(""); - str.append(""); - for(int i=0; igetCapability(Outputs); i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); - } - str.append(""); - str.append(""); - for(int i=0; igetCapability(Outputs); i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); - } - str.append(""); - str.append(""); - for(int i=0; igetCapability(Outputs); i++) { - str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); - } - } else { - for(int i=0; i<16; i++) { - str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); - } - str.append(""); - if (firmware->getCapability(HasChNames)) { - str.append(""); - for(int i=0; i<16; i++) { - str.append(doTR(g_model->limitData[i].name,"green")); - } - } - str.append(""); - for(int i=0; i<16; i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); - } - str.append(""); - str.append(""); - for(int i=0; i<16; i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); - } - str.append(""); - str.append(""); - for(int i=0; i<16; i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); - } - str.append(""); - str.append(""); - for(int i=0; i<16; i++) { - str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); - } - str.append(""); - str.append(QString(""); - str.append(""); - for(int i=16; igetCapability(Outputs); i++) { - str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); - } - str.append(""); - if (firmware->getCapability(HasChNames)) { - str.append(""); - for(int i=16; igetCapability(Outputs); i++) { - str.append(doTR(g_model->limitData[i].name,"green")); - } - } - str.append(""); - for(int i=16; igetCapability(Outputs); i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); - } - str.append(""); - str.append(""); - for(int i=16; igetCapability(Outputs); i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); - } - str.append(""); - str.append(""); - for(int i=16; igetCapability(Outputs); i++) { - str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); - } - str.append(""); - str.append(""); - for(int i=16; igetCapability(Outputs); i++) { - str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); - } - } - str.append(""); - str.append("

").arg(numcol)+tr("Limits")+"

 
"+tr("Name")+"
"+tr("Offset")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
"+tr("Name")+"
"+tr("Offset")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
 ").arg(numcol)+"
 
"+tr("Name")+"
"+tr("Offset")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
"); - str.append("
"); - te->append(str); -} - -void PrintDialog::printCurves() -{ - int i,r,g,b,c,count; - char buffer[16]; - QPen pen(Qt::black, 2, Qt::SolidLine); - - QString str = "

"; - str.append(tr("Curves")); - str.append("

"); - int numcurves=firmware->getCapability(NumCurves); - if (numcurves==0) { - numcurves=16; - } - { - QImage qi(ISIZEW+1,ISIZEW+1,QImage::Format_RGB32); - QPainter painter(&qi); - painter.setBrush(QBrush("#FFFFFF")); - painter.setPen(QColor(0,0,0)); - painter.drawRect(0,0,ISIZEW,ISIZEW); - str.append(""+QString("
").arg(curvefile5)); - for(i=0; i"); - str.append(QString("").arg(i+1)); - if(i%2) str.append(""); - } - str.append("
").arg(buffer)+tr("Curve")+QString(" %1
"); - str.append(""); - str.append(doTC(" ")); - str.append(doTC(" ")); - int numpoint=0; - for(i=0; icurves[i].count>numpoint) - numpoint=g_model->curves[i].count; - } - for(i=0; i"); - for(i=0; i"); - int curvepoints=g_model->curves[i].count; - if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) - str.append(QString("").arg(i+1)); - else - str.append(QString("").arg(i+1)); - count=0; - for(int j=0; jcurves[i].points[j].y!=0) - count++; - } - for(int j=0; jcurves[i].points[j].y),"green")); - if (j>0 && count!=0) { - if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) - painter.drawLine(ISIZEW/2+(ISIZEW*g_model->curves[i].points[j-1].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW/2+(ISIZEW*g_model->curves[i].points[j].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200); - else - painter.drawLine(ISIZEW*(j-1)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW*(j)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200); - } - } - for(int j=curvepoints; j"); - if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) { - str.append(""); - for(int j=0; jcurves[i].points[j].x),"green")); - } - for(int j=curvepoints; j"); - } - } - str.append("
").arg(buffer)+tr("Curve")+QString(" %1Y").arg(buffer)+tr("Curve")+QString(" %1Y
X
"); - str.append("
"); - painter.setPen(QColor(0,0,0)); - painter.drawLine(0,ISIZEW/2,ISIZEW,ISIZEW/2); - painter.drawLine(ISIZEW/2,0,ISIZEW/2,ISIZEW); - for(i=0; i<21; i++) { - painter.drawLine(ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5,(ISIZEW*i)/(20)); - painter.drawLine((ISIZEW*i)/(20),ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5); - } - - qi.save(curvefile5, "png",100); - - } - te->append(str); -} - -void PrintDialog::printSwitches() -{ - int sc=0; - QString str = ""; - str.append(""); - str.append("

"+tr("Logical Switches")+"

"); - - for (int i=0; igetCapability(LogicalSwitches); i++) { - if (g_model->customSw[i].func) { - str.append(""); - str.append("").arg(i+1)); - QString tstr = g_model->customSw[i].toString(*g_model); - str.append(doTL(tstr,"green")); - str.append(""); - sc++; - } - } - str.append("
"+tr("L")+QString("%1
"); - str.append("
"); - if (sc!=0) - te->append(str); -} - -void PrintDialog::printGvars() -{ - if (!firmware->getCapability(GvarsFlightModes) && (gvars && firmware->getCapability(Gvars))) { - QString str = ""; - str.append(""); - str.append("

"+tr("Global Variables")+"

"); - PhaseData *pd=&g_model->phaseData[0]; - int width=100/gvarnum; - str.append(""); - for(unsigned int i=0; i").arg(width)+tr("GV")+QString("%1").arg(i+1)); - } - str.append(""); - str.append(""); - for(unsigned int i=0; i").arg(width)+QString("%1").arg(pd->gvars[i])); - } - str.append(""); - str.append("
"); - str.append("
"); - te->append(str); - } -} - -void PrintDialog::printFSwitches() -{ - int sc=0; - QString str = ""; - str.append(""); - str.append("

"+tr("Special Functions")+"

"); - str.append(""); - str.append(doTL(tr("Switch"), "", true)); - str.append(doTL(tr("Function"), "", true)); - str.append(doTL(tr("Parameter"), "", true)); - str.append(doTL(tr("Repeat"), "", true)); - str.append(doTL(tr("Enabled"), "", true)); - str.append(""); - for(int i=0; igetCapability(CustomFunctions); i++) { - if (g_model->funcSw[i].swtch.type!=SWITCH_TYPE_NONE) { - str.append(""); - str.append(doTL(tr("SF%1").arg(i+1),"", true)); - str.append(doTL(g_model->funcSw[i].swtch.toString(),"green")); - str.append(doTL(g_model->funcSw[i].funcToString(),"green")); - str.append(doTL(g_model->funcSw[i].paramToString(),"green")); - int index=g_model->funcSw[i].func; - if ((g_model->funcSw[i].repeatParam>0) && - (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic)) { - str.append(doTL(QString("%1").arg(g_model->funcSw[i].repeatParam),"green")); - } else { - str.append(doTL( " ","green")); - } - if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) { - str.append(doTL((g_model->funcSw[i].enabled ? "ON" : "OFF"),"green")); - } else { - str.append(doTL( "---","green")); - } - str.append(""); - sc++; - } - } - str.append("
#
"); - str.append("
"); - if (sc!=0) - te->append(str); -} - -void PrintDialog::printFrSky() -{ - int tc=0; - QString str = ""; - - if (IS_TARANIS(GetEepromInterface()->getBoard())) { - str.append(""); - str.append(""); - str.append(doTC(tr("Analog"),"", true)); - str.append(doTC(tr("Range"),"", true)); - str.append(doTC(tr("Offset"),"", true)); - str.append(""); - - FrSkyData *fd=&g_model->frsky; - for (int i=0; i<2; i++) { - if (fd->channels[i].ratio!=0) { - tc++; - float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); - QString unit = " " + getFrSkyUnits(fd->channels[i].type); - str.append(""); - str.append(doTL(tr("A%1").arg(i+1), "", true)); - str.append(doTC(QString::number(ratio,10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); - str.append(doTC(QString::number((fd->channels[i].offset*ratio)/255,10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); - str.append(""); - } - } - - str.append(""); - str.append(""); - str.append(doTC(tr("Alarms"),"", true)); - str.append(doTC(tr("Low Alarm"),"", true)); - str.append(doTC(tr("Critical Alarm"),"", true)); - str.append(""); - str.append(""); - str.append(doTL(tr("RSSI"),"", true)); - str.append(doTC(QString::number(fd->rssiAlarms[0].value,10),"green")); - str.append(doTC(QString::number(fd->rssiAlarms[1].value,10),"green")); - str.append(""); - for (int i=0; i<2; i++) { - if (fd->channels[i].ratio!=0) { - float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); - QString unit = " " + getFrSkyUnits(fd->channels[i].type); - str.append(""); - str.append(doTL(tr("A%1").arg(i+1), "", true)); - str.append(doTC(QString::number(ratio*(fd->channels[i].alarms[0].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); - str.append(doTC(QString::number(ratio*(fd->channels[i].alarms[1].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); - str.append(""); - } - } - - //TODO preferrably in new tables - str.append(""); - //str.append(""); - //str.append(""); - str.append(""); - str.append("

"+tr("Telemetry Settings")+"

"+tr("Frsky serial protocol")+""+getFrSkyProtocol(fd->usrProto)+"
"+tr("Units system")+""+getFrSkyMeasure(fd->imperial)+"
"+tr("Blades")+""+QString("%1").arg(fd->blades)+"
"); - } - else { //other boards - str.append("

"+tr("Telemetry Settings")+"

 "+tr("Alarm 1")+""+tr("Alarm 2")+"
"+tr("Analog")+""+tr("Unit")+""+tr("Scale")+""+tr("Offset")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+"
"+tr("A%1").arg(i+1)+""+getFrSkyUnits(fd->channels[i].type)+""+QString::number(ratio,10,(fd->channels[i].type==0 ? 1:0))+""+QString::number((fd->channels[i].offset*ratio)/255,10,(fd->channels[i].type==0 ? 1:0))+""+getFrSkyAlarmType(fd->channels[i].alarms[0].level)+""); - str.append((fd->channels[i].alarms[0].greater==1) ? ">" : "<"); - str.append(""+QString::number(ratio*(fd->channels[i].alarms[0].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+""+getFrSkyAlarmType(fd->channels[i].alarms[1].level)+""); - str.append((fd->channels[i].alarms[1].greater==1) ? ">" : "<"); - str.append(""+QString::number(ratio*(fd->channels[i].alarms[1].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+"
 "+tr("Alarm 1")+""+tr("Alarm 2")+"
"+tr("Type")+""+tr("Condition")+""+tr("Value")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+"
"+tr("RSSI Alarm")+""+getFrSkyAlarmType(fd->rssiAlarms[0].level)+"<"+QString::number(fd->rssiAlarms[0].value,10)+""+getFrSkyAlarmType(fd->rssiAlarms[1].level)+"<"+QString::number(fd->rssiAlarms[1].value,10)+"
"+tr("Frsky serial protocol")+""+getFrSkyProtocol(fd->usrProto)+"
"+tr("Units system")+""+getFrSkyMeasure(fd->imperial)+"
"+tr("Blades")+""+fd->blades+"
"); - } -#if 0 - if (firmware->getCapability(TelemetryBars) || (firmware->getCapability(TelemetryCSFields))) { - int cols=firmware->getCapability(TelemetryColsCSFields); - if (cols==0) cols=2; - for (int j=0; jgetCapability(TelemetryCSFields)/(4*cols); j++ ) { - if (fd->screens[j].type==0) { - if (cols==2) { - str.append(""); - } else { - str.append("
"+tr("Custom Telemetry View")+"
"); - } - for (int r=0; r<4; r++) { - str.append(""); - for (int c=0; cscreens[j].body.lines[r].source[c]!=0) - tc++; - if (cols==2) { - str.append(""); - } else { - str.append(""); - } - if (c<(cols-1)) { - if (cols==2) { - str.append(""); - } else { - str.append(""); - } - } - } - str.append(""); - } - str.append("
"+tr("Custom Telemetry View")+"
"+getFrSkySrc(fd->screens[j].body.lines[r].source[c])+""+getFrSkySrc(fd->screens[j].body.lines[r].source[c])+"  
"); - } else { - str.append(""); - str.append(""); - for (int i=0; i<4; i++) { - if (fd->screens[j].body.bars[i].source!=0) - tc++; - // TODO str.append(""); - } - str.append("
"+tr("Telemetry Bars")+"
"+tr("Bar Number")+""+tr("Source")+""+tr("Min")+""+tr("Max")+"
"+QString::number(i+1,10)+""+getFrSkySrc(fd->screens[j].body.bars[i].source)+""+(fd->screens[j].body.bars[i].source>0 ? QString::number(getBarValue(fd->screens[j].body.bars[i].source, fd->screens[j].body.bars[i].barMin,fd)):"----")+""+(fd->screens[j].body.bars[i].source>0 ? QString::number(getBarValue(fd->screens[j].body.bars[i].source,(255-fd->screens[j].body.bars[i].barMax),fd)) :"----")+"
"); - } - } - } -#endif - if (tc>0) - te->append(str); -} - -void PrintDialog::on_printButton_clicked() -{ - QPrinter printer; - printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); - QPrintDialog *dialog = new QPrintDialog(&printer, this); - dialog->setWindowTitle(tr("Print Document")); - if (dialog->exec() != QDialog::Accepted) - return; - te->print(&printer); -} - -void PrintDialog::on_printFileButton_clicked() -{ - QString fn = QFileDialog::getSaveFileName(this,tr("Select PDF output file"),QString(),tr("ODF files (*.odt);;PDF Files(*.pdf);;HTML-Files (*.htm *.html);;All Files (*)")); - if (fn.isEmpty()) - return; - if (! (fn.endsWith(".odt", Qt::CaseInsensitive) || fn.endsWith(".pdf", Qt::CaseInsensitive) || fn.endsWith(".htm", Qt::CaseInsensitive) || fn.endsWith(".html", Qt::CaseInsensitive)) ) - fn += ".pdf"; // default - if (fn.endsWith(".pdf", Qt::CaseInsensitive)) { - QPrinter printer; - printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); - printer.setOutputFormat(QPrinter::PdfFormat); - printer.setColorMode(QPrinter::Color); - printer.setOutputFileName(fn); - te->print(&printer); - } else { - QTextDocumentWriter writer(fn); - writer.write(te->document()); - } -} - -void PrintDialog::printToFile() -{ - if (printfilename.isEmpty()) - return; - if (! (printfilename.endsWith(".odt", Qt::CaseInsensitive) || printfilename.endsWith(".pdf", Qt::CaseInsensitive) || printfilename.endsWith(".htm", Qt::CaseInsensitive) || printfilename.endsWith(".html", Qt::CaseInsensitive)) ) - printfilename += ".pdf"; // default - if (printfilename.endsWith(".pdf", Qt::CaseInsensitive)) { - QPrinter printer; - printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); - printer.setOutputFormat(QPrinter::PdfFormat); - printer.setColorMode(QPrinter::Color); - printer.setOutputFileName(printfilename); - te->print(&printer); - } else { - QTextDocumentWriter writer(printfilename); - writer.write(te->document()); - } -} - -void PrintDialog::autoClose() -{ - this->close(); -} +#include "printdialog.h" +#include "ui_printdialog.h" +#include "helpers.h" +#include "eeprominterface.h" +#include +#include +#include +#include + +#if !defined WIN32 && defined __GNUC__ +#include +#endif + +#define ISIZE 200 // curve image size +#define ISIZEW 400 // curve image size + +PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralSettings *gg, ModelData *gm, QString filename) : + QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint), + firmware(firmware), + g_eeGeneral(gg), + g_model(gm), + printfilename(filename), + ui(new Ui::PrintDialog), + gvars(gvarsEnabled()), + gvarnum (0) +{ + if (gvars) { + gvarnum=firmware->getCapability(Gvars); + } + + ui->setupUi(this); + this->setWindowIcon(CompanionIcon("print.png")); + te = ui->textEdit; + + setWindowTitle(tr("Setup for: ") + g_model->name); + te->clear(); + QString modelname=g_model->name; + if (modelname.isEmpty()) { + curvefile5=QString("%1/curve5.png").arg(qd->tempPath()); + curvefile9=QString("%1/curve9.png").arg(qd->tempPath()); + } + else { + curvefile5=QString("%1/%2-curve5.png").arg(qd->tempPath()).arg(modelname); + curvefile9=QString("%1/%2-curve9.png").arg(qd->tempPath()).arg(modelname); + } + printSetup(); + if (gvars) { + te->append(printFlightModes()+"
"); + } + printInputs(); + printMixes(); + printLimits(); + printCurves(); + printGvars(); + printSwitches(); + printFSwitches(); + printFrSky(); + + te->scrollToAnchor("1"); + if (!printfilename.isEmpty()) { + printToFile(); + QTimer::singleShot(0, this, SLOT(autoClose())); + } +} + +void PrintDialog::closeEvent(QCloseEvent *event) +{ + if (printfilename.isEmpty()) { + QByteArray ba = curvefile5.toLatin1(); + char *name = ba.data(); + unlink(name); + ba = curvefile9.toLatin1(); + name = ba.data(); + unlink(name); + } +} + +PrintDialog::~PrintDialog() +{ + delete ui; +} + +QString doTC(const QString s, const QString color="", bool bold=false) +{ + QString str = s; + if(bold) str = "" + str + ""; + if(!color.isEmpty()) str = "" + str + ""; + return "
" + str + "" + str + "" + str + "
"; + str.append(QString(""); + if (!gvars) { + str.append(""); + } + str.append("

").arg((firmware->getCapability(FlightModes) && !gvars) ? 2 : 1)); + str.append(g_model->name); + str.append(" ("); + str.append(firmware->getEepromInterface()->getName()); + str.append(")

"+tr("printed on: %1").arg(QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate))+"
"); + str.append(""); + str.append("

"+tr("General Model Settings")+"

"); + str.append(fv(tr("Name"), g_model->name)); + str.append(fv(tr("EEprom Size"), QString("%1").arg(firmware->getEepromInterface()->getSize(*g_model)))); + str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down + str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down + str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay, + str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].ppmPulsePol ? "NEG" : "POS")); + str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled"))); + str.append(fv(tr("Throttle Expo"), g_model->thrExpo ? tr("Enabled") : tr("Disabled"))); + // TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw))); + str.append(fv(tr("Trim Increment"), getTrimInc(g_model))); + str.append(fv(tr("Center Beep"), getCenterBeep(g_model))); // specify which channels beep + str.append("
"); + str.append(printFlightModes()); + str.append("

"); + te->append(str); +} + +QString PrintDialog::printFlightModes() +{ + QString str=""; + str.append(QString(""); + str.append(""); + if (gvars) { + str.append(QString(""); + } + if (firmware->getCapability(RotaryEncoders)) { + str.append(QString(""); + } + str.append(""); + QString labels[] = { tr("Rud"), tr("Ele"), tr("Thr"), tr("Ail") }; // TODO is elsewhere for sure + for (int i=0; i<4; i++) { + GeneralSettings generalSettings = *g_eeGeneral; + str.append(QString("").arg(labels[CONVERT_MODE(i+1)-1])); + } + if (gvars) { + for (unsigned int i=0; iGV%1
%2").arg(i+1).arg(g_model->gvars_names[i])); + } + } + for (int i=0; igetCapability(RotaryEncoders); i++) { + str.append(QString("
").arg((i==0 ? 'A': 'B'))); + } + str.append(""); + for (int i=0; igetCapability(FlightModes); i++) { + PhaseData *pd=&g_model->phaseData[i]; + str.append("").arg(i).arg(pd->name)); + str.append(QString("").arg((qreal)pd->fadeIn/firmware->getCapability(SlowScale))); + str.append(QString("").arg((qreal)pd->fadeOut/firmware->getCapability(SlowScale))); + for (int k=0; k<4; k++) { + //TODO trim values + if (pd->trimRef[k]==-1) { + str.append(QString("").arg(pd->trim[k])); + } else { + str.append("").arg(pd->trimRef[k])); + } + } + if (gvars) { + for (unsigned int k=0; kgvars[k]<=1024) { + str.append(QString(""); + } + else { + int num = pd->gvars[k] - 1025; + if (num>=i) num++; + str.append("").arg(num)); + } + } + } + for (int k=0; kgetCapability(RotaryEncoders); k++) { + if (pd->rotaryEncoders[k]<=1024) { + str.append(QString(""); + } + else { + int num = pd->rotaryEncoders[k] - 1025; + if (num>=i) num++; + str.append(QString("").arg(num)); + } + } + str.append(QString("").arg(pd->swtch.toString())); + str.append(""); + } + str.append("

").arg(!gvars ? 8+firmware->getCapability(RotaryEncoders) : 8+gvarnum+firmware->getCapability(RotaryEncoders))); + str.append(tr("Flight modes")); + str.append("

 "); + str.append(tr("Fades")+""+tr("Trims")+"").arg(gvarnum)+tr("Gvars")+"").arg(firmware->getCapability(RotaryEncoders))+tr("Rot.Enc.")+""+tr("Switch")+"
"+tr("Flight mode name")); + str.append(""+tr("IN")+""+tr("OUT")+"%1RE%1
"+tr("FM")+QString("%1 %2%1%1%1"+tr("FM")+QString("%1%1").arg(pd->gvars[k])+""+tr("FM")+QString("%1%1").arg(pd->rotaryEncoders[k])+"")+tr("FM")+QString("%1%1
"); + return(str); +} + +void PrintDialog::printInputs() +{ + QString str = "

"; + str.append(tr("Inputs")); + str.append("

"); + int ec=0; + unsigned int lastCHN = 255; + for(int i=0; iexpoData[i]; + if(ed->mode==0) + continue; + ec++; + str.append(""); + str.append(""; + } + str += "
"); + if(lastCHN!=ed->chn) { + lastCHN=ed->chn; + str.append(""+getInputStr(*g_model, ed->chn)+""); + } + str.append(""); + + switch(ed->mode) { + case (1): + str += "<-"; + break; + case (2): + str += "->"; + break; + default: + str += "  "; + break; + }; + + str += " " + tr("Weight") + QString("(%1)").arg(getGVarString(ed->weight,true)); + + if (firmware->getCapability(VirtualInputs)) { + str += " " + tr("Source") + QString("(%1)").arg(ed->srcRaw.toString()); + if (ed->carryTrim>0) str += " " + tr("NoTrim"); + else if (ed->carryTrim<0) str += " " + RawSource(SOURCE_TYPE_TRIM, (-(ed->carryTrim)-1)).toString(); + } + if (ed->curve.value) str += " " + Qt::escape(ed->curve.toString()); + + if (firmware->getCapability(FlightModes)) { + if(ed->phases) { + if (ed->phases!=(unsigned int)(1<getCapability(FlightModes))-1) { + unsigned int mask=1; + bool first = true; + bool multiple = false; + QString strModes; + for (int j=0; jgetCapability(FlightModes);j++) { + if (!(ed->phases & mask)) { + //PhaseData *pd = &g_model->phaseData[j]; + const char * pdName = g_model->phaseData[j].name; + if (first) { + strModes += Qt::escape(QString("%1").arg(getPhaseName(j+1,pdName))); + first = false; + } else { + strModes += Qt::escape(QString(", %1").arg(getPhaseName(j+1, pdName))); + multiple = true; + } + } + mask <<= 1; + } + if (!strModes.isEmpty()) { + str += " " + tr(multiple?"Flight modes":"Flight mode") + "(" + strModes + ")"; + } + } else { + str += tr("DISABLED")+QString(" !!!"); + } + } + } + if (ed->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString()); + if (firmware->getCapability(HasExpoNames) && ed->name[0]) str += Qt::escape(QString(" [%1]").arg(ed->name)); + str += "

"; + if (ec>0) + te->append(str); +} + + +void PrintDialog::printMixes() +{ + QString str = "

"; + str.append(tr("Mixers")); + str.append("

"); + + unsigned int lastCHN = 255; + for(int i=0; igetCapability(Mixes); i++) { + MixData *md = &g_model->mixData[i]; + if(!md->destCh || md->destCh>(unsigned int)firmware->getCapability(Outputs) ) break; + str.append(""); + str.append(""); + } + str.append("
"); + if(lastCHN!=md->destCh) { + lastCHN=md->destCh; + + QString chname = QObject::tr("CH%1").arg(lastCHN); + // TODO not nice, Qt brings a function for that, I don't remember right now + (chname.length() < 4) ? chname.append(" ") : chname.append(" "); + if (firmware->getCapability(HasChNames)) { + QString name = g_model->limitData[lastCHN-1].name; + if (!name.isEmpty()) { + name = QString("(") + name + QString(")"); + } + name.append(" "); + chname += name.left(8); + } + chname = Qt::escape(chname); + str.append(chname.replace(" ", " ")); + } + else { + str.append(" "); + } + str.append(""); + switch(md->mltpx) { + case (1): str += " *"; break; + case (2): str += " R"; break; + default: str += "  "; break; + }; + //set mixer src model if it is unset (srcRaw needs this to generate proper toString() for input source type) + if (md->srcRaw.model == 0) + md->srcRaw.model = g_model; + str += " " + md->srcRaw.toString(); + + str += " " + Qt::escape(tr("Weight(%1)").arg(getGVarString(md->weight, true))); + + QString phasesStr = getPhasesStr(md->phases, *g_model); + if (!phasesStr.isEmpty()) str += " " + Qt::escape(phasesStr); + + if (md->swtch.type != SWITCH_TYPE_NONE) { + str += " " + Qt::escape(tr("Switch(%1)").arg(md->swtch.toString())); + } + + if (md->carryTrim) { + str += " " + Qt::escape(tr("NoTrim")); + } + + if (md->noExpo) str += " " + Qt::escape(tr("No DR/Expo")); + if (md->sOffset) str += " " + Qt::escape(tr("Offset(%1)").arg(getGVarString(md->sOffset))); + if (md->curve.value) str += " " + Qt::escape(md->curve.toString()); + + + int scale = firmware->getCapability(SlowScale); + if (scale == 0) + scale = 1; + if (md->delayDown || md->delayUp) + str += Qt::escape(tr(" Delay(u%1:d%2)").arg((double)md->delayUp/scale).arg((double)md->delayDown/scale)); + if (md->speedDown || md->speedUp) + str += Qt::escape(tr(" Slow(u%1:d%2)").arg((double)md->speedUp/scale).arg((double)md->speedDown/scale)); + if (md->mixWarn) str += Qt::escape(tr(" Warn(%1)").arg(md->mixWarn)); + if (firmware->getCapability(HasMixerNames)) { + QString MixerName; + MixerName.append(md->name); + if (!MixerName.isEmpty()) { + str += " " + Qt::escape(QString("(%1)").arg(MixerName)); + } + } + str.append("

"); + te->append(str); +} + +void PrintDialog::printLimits() +{ + QString str = ""; + int numcol; + numcol=(firmware->getCapability(Outputs)+1)>17 ? 17:firmware->getCapability(Outputs)+1; + str.append(QString(""); + str.append(""); + if (firmware->getCapability(Outputs)<17) { + for(int i=0; igetCapability(Outputs); i++) { + str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); + } + str.append(""); + if (firmware->getCapability(HasChNames)) { + str.append(""); + for(int i=0; igetCapability(Outputs); i++) { + str.append(doTR(g_model->limitData[i].name,"green")); + } + } + str.append(""); + for(int i=0; igetCapability(Outputs); i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); + } + str.append(""); + str.append(""); + for(int i=0; igetCapability(Outputs); i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); + } + str.append(""); + str.append(""); + for(int i=0; igetCapability(Outputs); i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); + } + str.append(""); + str.append(""); + for(int i=0; igetCapability(Outputs); i++) { + str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); + } + } else { + for(int i=0; i<16; i++) { + str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); + } + str.append(""); + if (firmware->getCapability(HasChNames)) { + str.append(""); + for(int i=0; i<16; i++) { + str.append(doTR(g_model->limitData[i].name,"green")); + } + } + str.append(""); + for(int i=0; i<16; i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); + } + str.append(""); + str.append(""); + for(int i=0; i<16; i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); + } + str.append(""); + str.append(""); + for(int i=0; i<16; i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); + } + str.append(""); + str.append(""); + for(int i=0; i<16; i++) { + str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); + } + str.append(""); + str.append(QString(""); + str.append(""); + for(int i=16; igetCapability(Outputs); i++) { + str.append(doTC(tr("CH")+QString(" %1").arg(i+1,2,10,QChar('0')),"",true)); + } + str.append(""); + if (firmware->getCapability(HasChNames)) { + str.append(""); + for(int i=16; igetCapability(Outputs); i++) { + str.append(doTR(g_model->limitData[i].name,"green")); + } + } + str.append(""); + for(int i=16; igetCapability(Outputs); i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].offset/10, 'f', 1),"green")); + } + str.append(""); + str.append(""); + for(int i=16; igetCapability(Outputs); i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].min/10),"green")); + } + str.append(""); + str.append(""); + for(int i=16; igetCapability(Outputs); i++) { + str.append(doTR(QString::number((qreal)g_model->limitData[i].max/10),"green")); + } + str.append(""); + str.append(""); + for(int i=16; igetCapability(Outputs); i++) { + str.append(doTR(QString(g_model->limitData[i].revert ? tr("INV") : tr("NOR")),"green")); + } + } + str.append(""); + str.append("

").arg(numcol)+tr("Limits")+"

 
"+tr("Name")+"
"+tr("Offset")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
"+tr("Name")+"
"+tr("Offset")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
 ").arg(numcol)+"
 
"+tr("Name")+"
"+tr("Offset")+"
"+tr("Min")+"
"+tr("Max")+"
"+tr("Invert")+"
"); + str.append("
"); + te->append(str); +} + +void PrintDialog::printCurves() +{ + int i,r,g,b,c,count; + char buffer[16]; + QPen pen(Qt::black, 2, Qt::SolidLine); + + QString str = "

"; + str.append(tr("Curves")); + str.append("

"); + int numcurves=firmware->getCapability(NumCurves); + if (numcurves==0) { + numcurves=16; + } + { + QImage qi(ISIZEW+1,ISIZEW+1,QImage::Format_RGB32); + QPainter painter(&qi); + painter.setBrush(QBrush("#FFFFFF")); + painter.setPen(QColor(0,0,0)); + painter.drawRect(0,0,ISIZEW,ISIZEW); + str.append(""+QString("
").arg(curvefile5)); + for(i=0; i"); + str.append(QString("").arg(i+1)); + if(i%2) str.append(""); + } + str.append("
").arg(buffer)+tr("Curve")+QString(" %1
"); + str.append(""); + str.append(doTC(" ")); + str.append(doTC(" ")); + int numpoint=0; + for(i=0; icurves[i].count>numpoint) + numpoint=g_model->curves[i].count; + } + for(i=0; i"); + for(i=0; i"); + int curvepoints=g_model->curves[i].count; + if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) + str.append(QString("").arg(i+1)); + else + str.append(QString("").arg(i+1)); + count=0; + for(int j=0; jcurves[i].points[j].y!=0) + count++; + } + for(int j=0; jcurves[i].points[j].y),"green")); + if (j>0 && count!=0) { + if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) + painter.drawLine(ISIZEW/2+(ISIZEW*g_model->curves[i].points[j-1].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW/2+(ISIZEW*g_model->curves[i].points[j].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200); + else + painter.drawLine(ISIZEW*(j-1)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW*(j)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200); + } + } + for(int j=curvepoints; j"); + if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) { + str.append(""); + for(int j=0; jcurves[i].points[j].x),"green")); + } + for(int j=curvepoints; j"); + } + } + str.append("
").arg(buffer)+tr("Curve")+QString(" %1Y").arg(buffer)+tr("Curve")+QString(" %1Y
X
"); + str.append("
"); + painter.setPen(QColor(0,0,0)); + painter.drawLine(0,ISIZEW/2,ISIZEW,ISIZEW/2); + painter.drawLine(ISIZEW/2,0,ISIZEW/2,ISIZEW); + for(i=0; i<21; i++) { + painter.drawLine(ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5,(ISIZEW*i)/(20)); + painter.drawLine((ISIZEW*i)/(20),ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5); + } + + qi.save(curvefile5, "png",100); + + } + te->append(str); +} + +void PrintDialog::printSwitches() +{ + int sc=0; + QString str = ""; + str.append(""); + str.append("

"+tr("Logical Switches")+"

"); + + for (int i=0; igetCapability(LogicalSwitches); i++) { + if (g_model->customSw[i].func) { + str.append(""); + str.append("").arg(i+1)); + QString tstr = g_model->customSw[i].toString(*g_model); + str.append(doTL(tstr,"green")); + str.append(""); + sc++; + } + } + str.append("
"+tr("L")+QString("%1
"); + str.append("
"); + if (sc!=0) + te->append(str); +} + +void PrintDialog::printGvars() +{ + if (!firmware->getCapability(GvarsFlightModes) && (gvars && firmware->getCapability(Gvars))) { + QString str = ""; + str.append(""); + str.append("

"+tr("Global Variables")+"

"); + PhaseData *pd=&g_model->phaseData[0]; + int width=100/gvarnum; + str.append(""); + for(unsigned int i=0; i").arg(width)+tr("GV")+QString("%1").arg(i+1)); + } + str.append(""); + str.append(""); + for(unsigned int i=0; i").arg(width)+QString("%1").arg(pd->gvars[i])); + } + str.append(""); + str.append("
"); + str.append("
"); + te->append(str); + } +} + +void PrintDialog::printFSwitches() +{ + int sc=0; + QString str = ""; + str.append(""); + str.append("

"+tr("Special Functions")+"

"); + str.append(""); + str.append(doTL(tr("Switch"), "", true)); + str.append(doTL(tr("Function"), "", true)); + str.append(doTL(tr("Parameter"), "", true)); + str.append(doTL(tr("Repeat"), "", true)); + str.append(doTL(tr("Enabled"), "", true)); + str.append(""); + for(int i=0; igetCapability(CustomFunctions); i++) { + if (g_model->funcSw[i].swtch.type!=SWITCH_TYPE_NONE) { + str.append(""); + str.append(doTL(tr("SF%1").arg(i+1),"", true)); + str.append(doTL(g_model->funcSw[i].swtch.toString(),"green")); + str.append(doTL(g_model->funcSw[i].funcToString(),"green")); + str.append(doTL(g_model->funcSw[i].paramToString(),"green")); + int index=g_model->funcSw[i].func; + if ((g_model->funcSw[i].repeatParam>0) && + (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic)) { + str.append(doTL(QString("%1").arg(g_model->funcSw[i].repeatParam),"green")); + } else { + str.append(doTL( " ","green")); + } + if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) { + str.append(doTL((g_model->funcSw[i].enabled ? "ON" : "OFF"),"green")); + } else { + str.append(doTL( "---","green")); + } + str.append(""); + sc++; + } + } + str.append("
#
"); + str.append("
"); + if (sc!=0) + te->append(str); +} + +void PrintDialog::printFrSky() +{ + int tc=0; + QString str = ""; + + if (IS_TARANIS(GetEepromInterface()->getBoard())) { + str.append(""); + str.append(""); + str.append(doTC(tr("Analog"),"", true)); + str.append(doTC(tr("Range"),"", true)); + str.append(doTC(tr("Offset"),"", true)); + str.append(""); + + FrSkyData *fd=&g_model->frsky; + for (int i=0; i<2; i++) { + if (fd->channels[i].ratio!=0) { + tc++; + float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); + QString unit = " " + getFrSkyUnits(fd->channels[i].type); + str.append(""); + str.append(doTL(tr("A%1").arg(i+1), "", true)); + str.append(doTC(QString::number(ratio,10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); + str.append(doTC(QString::number((fd->channels[i].offset*ratio)/255,10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); + str.append(""); + } + } + + str.append(""); + str.append(""); + str.append(doTC(tr("Alarms"),"", true)); + str.append(doTC(tr("Low Alarm"),"", true)); + str.append(doTC(tr("Critical Alarm"),"", true)); + str.append(""); + str.append(""); + str.append(doTL(tr("RSSI"),"", true)); + str.append(doTC(QString::number(fd->rssiAlarms[0].value,10),"green")); + str.append(doTC(QString::number(fd->rssiAlarms[1].value,10),"green")); + str.append(""); + for (int i=0; i<2; i++) { + if (fd->channels[i].ratio!=0) { + float ratio=(fd->channels[i].ratio/(fd->channels[i].type==0 ?10.0:1)); + QString unit = " " + getFrSkyUnits(fd->channels[i].type); + str.append(""); + str.append(doTL(tr("A%1").arg(i+1), "", true)); + str.append(doTC(QString::number(ratio*(fd->channels[i].alarms[0].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); + str.append(doTC(QString::number(ratio*(fd->channels[i].alarms[1].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+unit, "green")); + str.append(""); + } + } + + //TODO preferrably in new tables + str.append(""); + //str.append(""); + //str.append(""); + str.append(""); + str.append("

"+tr("Telemetry Settings")+"

"+tr("Frsky serial protocol")+""+getFrSkyProtocol(fd->usrProto)+"
"+tr("Units system")+""+getFrSkyMeasure(fd->imperial)+"
"+tr("Blades")+""+QString("%1").arg(fd->blades)+"
"); + } + else { //other boards + str.append("

"+tr("Telemetry Settings")+"

 "+tr("Alarm 1")+""+tr("Alarm 2")+"
"+tr("Analog")+""+tr("Unit")+""+tr("Scale")+""+tr("Offset")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+"
"+tr("A%1").arg(i+1)+""+getFrSkyUnits(fd->channels[i].type)+""+QString::number(ratio,10,(fd->channels[i].type==0 ? 1:0))+""+QString::number((fd->channels[i].offset*ratio)/255,10,(fd->channels[i].type==0 ? 1:0))+""+getFrSkyAlarmType(fd->channels[i].alarms[0].level)+""); + str.append((fd->channels[i].alarms[0].greater==1) ? ">" : "<"); + str.append(""+QString::number(ratio*(fd->channels[i].alarms[0].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+""+getFrSkyAlarmType(fd->channels[i].alarms[1].level)+""); + str.append((fd->channels[i].alarms[1].greater==1) ? ">" : "<"); + str.append(""+QString::number(ratio*(fd->channels[i].alarms[1].value/255.0+fd->channels[i].offset/255.0),10,(fd->channels[i].type==0 ? 1:0))+"
 "+tr("Alarm 1")+""+tr("Alarm 2")+"
"+tr("Type")+""+tr("Condition")+""+tr("Value")+""+tr("Type")+""+tr("Condition")+""+tr("Value")+"
"+tr("RSSI Alarm")+""+getFrSkyAlarmType(fd->rssiAlarms[0].level)+"<"+QString::number(fd->rssiAlarms[0].value,10)+""+getFrSkyAlarmType(fd->rssiAlarms[1].level)+"<"+QString::number(fd->rssiAlarms[1].value,10)+"
"+tr("Frsky serial protocol")+""+getFrSkyProtocol(fd->usrProto)+"
"+tr("Units system")+""+getFrSkyMeasure(fd->imperial)+"
"+tr("Blades")+""+fd->blades+"
"); + } +#if 0 + if (firmware->getCapability(TelemetryBars) || (firmware->getCapability(TelemetryCSFields))) { + int cols=firmware->getCapability(TelemetryColsCSFields); + if (cols==0) cols=2; + for (int j=0; jgetCapability(TelemetryCSFields)/(4*cols); j++ ) { + if (fd->screens[j].type==0) { + if (cols==2) { + str.append(""); + } else { + str.append("
"+tr("Custom Telemetry View")+"
"); + } + for (int r=0; r<4; r++) { + str.append(""); + for (int c=0; cscreens[j].body.lines[r].source[c]!=0) + tc++; + if (cols==2) { + str.append(""); + } else { + str.append(""); + } + if (c<(cols-1)) { + if (cols==2) { + str.append(""); + } else { + str.append(""); + } + } + } + str.append(""); + } + str.append("
"+tr("Custom Telemetry View")+"
"+getFrSkySrc(fd->screens[j].body.lines[r].source[c])+""+getFrSkySrc(fd->screens[j].body.lines[r].source[c])+"  
"); + } else { + str.append(""); + str.append(""); + for (int i=0; i<4; i++) { + if (fd->screens[j].body.bars[i].source!=0) + tc++; + // TODO str.append(""); + } + str.append("
"+tr("Telemetry Bars")+"
"+tr("Bar Number")+""+tr("Source")+""+tr("Min")+""+tr("Max")+"
"+QString::number(i+1,10)+""+getFrSkySrc(fd->screens[j].body.bars[i].source)+""+(fd->screens[j].body.bars[i].source>0 ? QString::number(getBarValue(fd->screens[j].body.bars[i].source, fd->screens[j].body.bars[i].barMin,fd)):"----")+""+(fd->screens[j].body.bars[i].source>0 ? QString::number(getBarValue(fd->screens[j].body.bars[i].source,(255-fd->screens[j].body.bars[i].barMax),fd)) :"----")+"
"); + } + } + } +#endif + if (tc>0) + te->append(str); +} + +void PrintDialog::on_printButton_clicked() +{ + QPrinter printer; + printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); + QPrintDialog *dialog = new QPrintDialog(&printer, this); + dialog->setWindowTitle(tr("Print Document")); + if (dialog->exec() != QDialog::Accepted) + return; + te->print(&printer); +} + +void PrintDialog::on_printFileButton_clicked() +{ + QString fn = QFileDialog::getSaveFileName(this,tr("Select PDF output file"),QString(),tr("ODF files (*.odt);;PDF Files(*.pdf);;HTML-Files (*.htm *.html);;All Files (*)")); + if (fn.isEmpty()) + return; + if (! (fn.endsWith(".odt", Qt::CaseInsensitive) || fn.endsWith(".pdf", Qt::CaseInsensitive) || fn.endsWith(".htm", Qt::CaseInsensitive) || fn.endsWith(".html", Qt::CaseInsensitive)) ) + fn += ".pdf"; // default + if (fn.endsWith(".pdf", Qt::CaseInsensitive)) { + QPrinter printer; + printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); + printer.setOutputFormat(QPrinter::PdfFormat); + printer.setColorMode(QPrinter::Color); + printer.setOutputFileName(fn); + te->print(&printer); + } else { + QTextDocumentWriter writer(fn); + writer.write(te->document()); + } +} + +void PrintDialog::printToFile() +{ + if (printfilename.isEmpty()) + return; + if (! (printfilename.endsWith(".odt", Qt::CaseInsensitive) || printfilename.endsWith(".pdf", Qt::CaseInsensitive) || printfilename.endsWith(".htm", Qt::CaseInsensitive) || printfilename.endsWith(".html", Qt::CaseInsensitive)) ) + printfilename += ".pdf"; // default + if (printfilename.endsWith(".pdf", Qt::CaseInsensitive)) { + QPrinter printer; + printer.setPageMargins(10.0,10.0,10.0,10.0,printer.Millimeter); + printer.setOutputFormat(QPrinter::PdfFormat); + printer.setColorMode(QPrinter::Color); + printer.setOutputFileName(printfilename); + te->print(&printer); + } else { + QTextDocumentWriter writer(printfilename); + writer.write(te->document()); + } +} + +void PrintDialog::autoClose() +{ + this->close(); +} From 216184e6f9e82c22d859842ee07fd6e7429e8593 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 6 May 2014 09:51:27 +0200 Subject: [PATCH 63/79] Update DONATIONS.txt --- DONATIONS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/DONATIONS.txt b/DONATIONS.txt index 233693225..e77d6d816 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -389,3 +389,4 @@ Daryl Dacko Beat Zurflueh Piotr Kundu Kevin Berkefeld +Tomasz Klys From 48b183e6c2c1e743d03b3ecad90bc7797c34f853 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Wed, 7 May 2014 07:10:06 +0200 Subject: [PATCH 64/79] Update DONATIONS.txt --- DONATIONS.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DONATIONS.txt b/DONATIONS.txt index e77d6d816..fc09a53a3 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -390,3 +390,6 @@ Beat Zurflueh Piotr Kundu Kevin Berkefeld Tomasz Klys +Mirco Didone' +Christoph Schroeter + From fdb9871a251fdf55334641863daad01cfc30a692 Mon Sep 17 00:00:00 2001 From: Andre Bernet Date: Wed, 7 May 2014 13:01:43 +0200 Subject: [PATCH 65/79] Add more targets to simu with default options that allow for checking most menus --- companion/src/simulator.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/companion/src/simulator.cpp b/companion/src/simulator.cpp index 32758de7c..6ec5be839 100644 --- a/companion/src/simulator.cpp +++ b/companion/src/simulator.cpp @@ -113,7 +113,9 @@ int main(int argc, char *argv[]) msgBox.setText("Which radio type do you want to simulate?"); msgBox.setIcon(QMessageBox::Question); QAbstractButton *taranisButton = msgBox.addButton("Taranis", QMessageBox::ActionRole); - msgBox.addButton("9X", QMessageBox::ActionRole); + QAbstractButton *sky9xButton = msgBox.addButton("9X-Sky9X", QMessageBox::ActionRole); + QAbstractButton *gruvinButton = msgBox.addButton("9X-Gruvin9X", QMessageBox::ActionRole); + msgBox.addButton("9X-M128", QMessageBox::ActionRole); QPushButton *exitButton = msgBox.addButton(QMessageBox::Close); eedir = QDir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)); @@ -127,14 +129,29 @@ int main(int argc, char *argv[]) if (msgBox.clickedButton() == exitButton) return 0; else if (msgBox.clickedButton() == taranisButton) { - current_firmware_variant = GetFirmwareVariant("opentx-taranis-en"); + current_firmware_variant = GetFirmwareVariant("opentx-taranis-haptic-en"); fileName = eedir.filePath("eeprom-taranis.bin"); path = fileName.toAscii(); eepromFileName = path.data(); dialog = new SimulatorDialogTaranis(); } + else if (msgBox.clickedButton() == sky9xButton) { + current_firmware_variant = GetFirmwareVariant("opentx-sky9x-heli-templates-ppmca-gvars-symlimits-autosource-autoswitch-battgraph-bluetooth-en"); + fileName = eedir.filePath("eeprom-sky9x.bin"); + path = fileName.toAscii(); + eepromFileName = path.data(); + dialog = new SimulatorDialog9X(); + } + else if (msgBox.clickedButton() == gruvinButton) { + current_firmware_variant = GetFirmwareVariant("opentx-gruvin9x-heli-templates-sdcard-voice-DSM2PPM-ppmca-gvars-symlimits-autosource-autoswitch-battgraph-ttsen-en"); + fileName = eedir.filePath("eeprom-gruvin9x.bin"); + path = fileName.toAscii(); + eepromFileName = path.data(); + dialog = new SimulatorDialog9X(); + } else { - fileName = eedir.filePath("eeprom-9x.bin"); + current_firmware_variant = GetFirmwareVariant("opentx-9x128-frsky-heli-templates-audio-voice-haptic-DSM2-ppmca-gvars-symlimits-autosource-autoswitch-battgraph-thrtrace-en"); + fileName = eedir.filePath("eeprom-9x128.bin"); path = fileName.toAscii(); eepromFileName = path.data(); dialog = new SimulatorDialog9X(); From 7e6b2acc579cf56c6dc213a1a8e40145494d654b Mon Sep 17 00:00:00 2001 From: Andre Bernet Date: Wed, 7 May 2014 13:12:05 +0200 Subject: [PATCH 66/79] Naming consistency --- radio/src/translations/cz.h.txt | 2 +- radio/src/translations/de.h.txt | 2 +- radio/src/translations/en.h.txt | 2 +- radio/src/translations/es.h.txt | 2 +- radio/src/translations/fi.h.txt | 2 +- radio/src/translations/fr.h.txt | 2 +- radio/src/translations/it.h.txt | 2 +- radio/src/translations/pl.h.txt | 2 +- radio/src/translations/pt.h.txt | 2 +- radio/src/translations/se.h.txt | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 6eb812f29..0e1fab4eb 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -401,7 +401,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" + #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" #define TR_VSWITCHES "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\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index 932a8817f..f5fb0d533 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -405,7 +405,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" + #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" #define TR_VSWITCHES "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\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index 6e4db7312..7aebfceb5 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -405,7 +405,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" + #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" #define TR_VSWITCHES "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\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index 1e7e327b5..2a7d40e1e 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -401,7 +401,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" + #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" #define TR_VSWITCHES "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\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 88081eb76..e79743fb0 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -401,7 +401,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" + #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" #define TR_VSWITCHES "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\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index 8eb4cdefa..fc414f78b 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -401,7 +401,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" + #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" #define TR_VSWITCHES "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\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index ba1c47de6..52851102a 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -401,7 +401,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" + #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" #define TR_VSWITCHES "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\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 38cdb197e..d6187ef9e 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -401,7 +401,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" + #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" #define TR_VSWITCHES "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\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "GAZ""SK""SW""LOL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index 8ad94d345..ed7e02950 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -401,7 +401,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" + #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" #define TR_VSWITCHES "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\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 0f7efd6c3..bfa971b40 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -405,7 +405,7 @@ #endif #if defined(PCBTARANIS) - #define TR_6POS_POTS "P11""P12""P13""P14""P15""P16""P21""P22""P23""P24""P25""P26""P31""P32""P33""P34""P35""P36" + #define TR_6POS_POTS "S11""S12""S13""S14""S15""S16""S21""S22""S23""S24""S25""S26""S31""S32""S33""S34""S35""S36" #define TR_VSWITCHES "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\301""SG\300""SG-""SG\301""SH\300""SH\301" TR_6POS_POTS TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW #elif defined(CPUARM) #define TR_VSWITCHES TR_9X_3POS_SWITCHES "THR""RUD""ELE""AIL""GEA""TRN" TR_TRIMS_SWITCHES TR_ROTENC_SWITCHES TR_LOGICALSW From 0714138fcd17c3adc82b7f93997fa9597e23e616 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 8 May 2014 08:28:03 +0200 Subject: [PATCH 67/79] Update DONATIONS.txt --- DONATIONS.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DONATIONS.txt b/DONATIONS.txt index fc09a53a3..addc0f5a3 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -392,4 +392,4 @@ Kevin Berkefeld Tomasz Klys Mirco Didone' Christoph Schroeter - +Zdenek Trojanek From 4e285ed502d1096573b0b4b7f9e8620bfde4767d Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 8 May 2014 19:57:32 +0200 Subject: [PATCH 68/79] Update DONATIONS.txt --- DONATIONS.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DONATIONS.txt b/DONATIONS.txt index addc0f5a3..3817d115c 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -393,3 +393,5 @@ Tomasz Klys Mirco Didone' Christoph Schroeter Zdenek Trojanek +Bryan Anderson + From 57193fddfef37a40416d766e9d6955062ced9e37 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Fri, 9 May 2014 08:31:54 +0200 Subject: [PATCH 69/79] Update DONATIONS.txt --- DONATIONS.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DONATIONS.txt b/DONATIONS.txt index 3817d115c..827c8627e 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -394,4 +394,4 @@ Mirco Didone' Christoph Schroeter Zdenek Trojanek Bryan Anderson - +Kamco Enterprises From 3c07e0a227010b58e9a90408a2a8fa0aa72dbac3 Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 9 May 2014 14:37:23 +0200 Subject: [PATCH 70/79] Issue #1065 - New function putsTime --- radio/src/gui/menu_model.cpp | 4 ++-- radio/src/gui/view_main.cpp | 14 +++++--------- radio/src/gui/view_statistics.cpp | 14 +++++++------- radio/src/lcd.cpp | 23 +++++++++++++++++------ radio/src/lcd.h | 3 ++- radio/src/telemetry/nmea.cpp | 8 ++++---- 6 files changed, 37 insertions(+), 29 deletions(-) diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index 7d2691a31..3f12a67bf 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -1059,7 +1059,7 @@ void menuModelSetup(uint8_t event) else { putsStrIdx(0*FW, y, STR_TIMER, k>=ITEM_MODEL_TIMER2 ? 2 : 1); putsTimerMode(MODEL_SETUP_2ND_COLUMN, y, timer->mode, m_posHorz==0 ? attr : 0); - putsTime(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, m_posHorz==1 ? attr : 0, m_posHorz==2 ? attr : 0); + putsTimer(MODEL_SETUP_2ND_COLUMN+5*FW-2+5*FWNUM+1, y, timer->start, m_posHorz==1 ? attr : 0, m_posHorz==2 ? attr : 0); #if defined(PCBTARANIS) if (attr && m_posHorz < 0) lcd_filled_rect(MODEL_SETUP_2ND_COLUMN, y, LCD_W-MODEL_SETUP_2ND_COLUMN-MENUS_SCROLLBAR_WIDTH, 8); #endif @@ -4982,7 +4982,7 @@ void menuModelCustomFunctions(uint8_t event) #if defined(CPUARM) else if (func == FUNC_SET_TIMER) { val_max = 59*60+59; - putsTime(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT, attr); + putsTimer(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, val_displayed, attr|LEFT, attr); } #endif #if defined(AUDIO) diff --git a/radio/src/gui/view_main.cpp b/radio/src/gui/view_main.cpp index 480ec89b7..e089b14c2 100644 --- a/radio/src/gui/view_main.cpp +++ b/radio/src/gui/view_main.cpp @@ -318,11 +318,7 @@ void displayTopBar() /* RTC time */ struct gtm t; gettime(&t); - if (t.tm_sec % 2) { - lcd_putcAtt(BAR_TIME_X+1, BAR_Y+1, ':', 0); - } - lcd_outdezNAtt(BAR_TIME_X+1, BAR_Y+1, t.tm_hour, LEADING0, 2); - lcd_outdezNAtt(BAR_TIME_X+3*FWNUM-1, BAR_Y+1, t.tm_min, LEADING0, 2); + putsTime(BAR_TIME_X+1, BAR_Y+1, t, true); /* The background */ lcd_filled_rect(BAR_X, BAR_Y, BAR_W, BAR_H, SOLID, FILL_WHITE|GREY_DEFAULT|ROUND); @@ -344,7 +340,7 @@ void displayTimers() // Main timer if (g_model.timers[0].mode) { TimerState & timerState = timersStates[0]; - putsTime(TIMERS_X, TIMER1_Y, timerState.val, MIDSIZE|LEFT, MIDSIZE|LEFT); + putsTimer(TIMERS_X, TIMER1_Y, timerState.val, MIDSIZE|LEFT, MIDSIZE|LEFT); putsTimerMode(TIMERS_X, TIMER1_Y-6, g_model.timers[0].mode, SMLSIZE); if (g_model.timers[0].persistent) lcd_putcAtt(TIMERS_R, TIMER1_Y+1, 'P', SMLSIZE); if (timerState.val < 0) { @@ -357,7 +353,7 @@ void displayTimers() // Second timer if (g_model.timers[1].mode) { TimerState & timerState = timersStates[1]; - putsTime(TIMERS_X, TIMER2_Y, timerState.val, MIDSIZE|LEFT, MIDSIZE|LEFT); + putsTimer(TIMERS_X, TIMER2_Y, timerState.val, MIDSIZE|LEFT, MIDSIZE|LEFT); putsTimerMode(TIMERS_X, TIMER2_Y-6, g_model.timers[1].mode, SMLSIZE); if (g_model.timers[1].persistent) lcd_putcAtt(TIMERS_R, TIMER2_Y+1, 'P', SMLSIZE); if (timerState.val < 0) { @@ -374,7 +370,7 @@ void displayTimers() if (g_model.timers[0].mode) { TimerState & timerState = timersStates[0]; uint8_t att = DBLSIZE | (timerState.val<0 ? BLINK|INVERS : 0); - putsTime(12*FW+2+10*FWNUM-4, FH*2, timerState.val, att, att); + putsTimer(12*FW+2+10*FWNUM-4, FH*2, timerState.val, att, att); putsTimerMode(timerState.val >= 0 ? 9*FW-FW/2+3 : 9*FW-FW/2-4, FH*3, g_model.timers[0].mode); } } @@ -840,7 +836,7 @@ void menuMainView(uint8_t event) } } else { // timer2 - putsTime(33+FW+2+10*FWNUM-4, FH*5, timersStates[1].val, DBLSIZE, DBLSIZE); + putsTimer(33+FW+2+10*FWNUM-4, FH*5, timersStates[1].val, DBLSIZE, DBLSIZE); putsTimerMode(timersStates[1].val >= 0 ? 20-FW/2+5 : 20-FW/2-2, FH*6, g_model.timers[1].mode); // lcd_outdezNAtt(33+11*FW, FH*6, s_timerVal_10ms[1], LEADING0, 2); // 1/100s } diff --git a/radio/src/gui/view_statistics.cpp b/radio/src/gui/view_statistics.cpp index 9d92a849d..dc7608410 100644 --- a/radio/src/gui/view_statistics.cpp +++ b/radio/src/gui/view_statistics.cpp @@ -58,16 +58,16 @@ void menuStatisticsView(uint8_t event) } lcd_puts( 1*FW, FH*0, STR_TOTTM1TM2THRTHP); - putsTime( 5*FW+5*FWNUM+1, FH*1, timersStates[0].val, 0, 0); - putsTime( 12*FW+5*FWNUM+1, FH*1, timersStates[1].val, 0, 0); + putsTimer( 5*FW+5*FWNUM+1, FH*1, timersStates[0].val, 0, 0); + putsTimer( 12*FW+5*FWNUM+1, FH*1, timersStates[1].val, 0, 0); - putsTime( 5*FW+5*FWNUM+1, FH*2, s_timeCumThr, 0, 0); - putsTime( 12*FW+5*FWNUM+1, FH*2, s_timeCum16ThrP/16, 0, 0); + putsTimer( 5*FW+5*FWNUM+1, FH*2, s_timeCumThr, 0, 0); + putsTimer( 12*FW+5*FWNUM+1, FH*2, s_timeCum16ThrP/16, 0, 0); - putsTime( 12*FW+5*FWNUM+1, FH*0, s_timeCumTot, 0, 0); + putsTimer( 12*FW+5*FWNUM+1, FH*0, s_timeCumTot, 0, 0); #if defined(PCBTARANIS) - putsTime(21*FW+5*FWNUM+1, 0*FH, g_eeGeneral.globalTimer + sessionTimer, 0, 0); + putsTimer(21*FW+5*FWNUM+1, 0*FH, g_eeGeneral.globalTimer + sessionTimer, 0, 0); #endif #if defined(THRTRACE) @@ -147,7 +147,7 @@ void menuStatisticsDebug(uint8_t event) lcd_putsLeft(2*FH, STR_CPU_MAH); putsTelemetryValue(MENU_DEBUG_COL_OFS, 2*FH, g_eeGeneral.mAhUsed + Current_used*current_scale/8192/36, UNIT_MAH, PREC1); - putsTime(17*FW+5*FWNUM+1, 2*FH, g_eeGeneral.globalTimer + sessionTimer, 0, 0); + putsTimer(17*FW+5*FWNUM+1, 2*FH, g_eeGeneral.globalTimer + sessionTimer, 0, 0); #endif #if defined(PCBSKY9X) diff --git a/radio/src/lcd.cpp b/radio/src/lcd.cpp index e5926f877..020d17842 100644 --- a/radio/src/lcd.cpp +++ b/radio/src/lcd.cpp @@ -842,12 +842,12 @@ void lcdDrawTelemetryTopBar() putsVBat(16*FW+1,0,att); if (g_model.timers[0].mode) { att = (timersStates[0].val<0 ? BLINK : 0); - putsTime(22*FW+5*FWNUM+3, 0, timersStates[0].val, att, att); + putsTimer(22*FW+5*FWNUM+3, 0, timersStates[0].val, att, att); lcd_putsiAtt(18*FW+2, 1, STR_VTELEMCHNS, TELEM_TM1, SMLSIZE); } if (g_model.timers[1].mode) { att = (timersStates[1].val<0 ? BLINK : 0); - putsTime(31*FW+5*FWNUM+3, 0, timersStates[1].val, att, att); + putsTimer(31*FW+5*FWNUM+3, 0, timersStates[1].val, att, att); lcd_putsiAtt(27*FW+2, 1, STR_VTELEMCHNS, TELEM_TM2, SMLSIZE); } lcd_invert_line(0); @@ -860,13 +860,24 @@ void lcdDrawTelemetryTopBar() putsVBat(14*FW,0,att); if (g_model.timers[0].mode) { att = (timersStates[0].val<0 ? BLINK : 0); - putsTime(17*FW+5*FWNUM+1, 0, timersStates[0].val, att, att); + putsTimer(17*FW+5*FWNUM+1, 0, timersStates[0].val, att, att); } lcd_invert_line(0); } #endif -void putsTime(xcoord_t x, uint8_t y, putstime_t tme, LcdFlags att, LcdFlags att2) +#if defined(PCBTARANIS) +void putsTime(xcoord_t x, uint8_t y, struct gtm t, bool blink) +{ + if (blink && (t.tm_sec%2)) { + lcd_putcAtt(x, y, ':', 0); + } + lcd_outdezNAtt(x, y, t.tm_hour, LEADING0, 2); + lcd_outdezNAtt(x+3*FWNUM-2, y, t.tm_min, LEADING0, 2); +} +#endif + +void putsTimer(xcoord_t x, uint8_t y, putstime_t tme, LcdFlags att, LcdFlags att2) { div_t qr; @@ -1189,7 +1200,7 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val, case TELEM_TM1-1: case TELEM_TM2-1: att &= ~NO_UNIT; - putsTime(x, y, val, att, att); + putsTimer(x, y, val, att, att); break; #if defined(FRSKY) case TELEM_MIN_A1-1: @@ -1311,7 +1322,7 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val, case TELEM_TM1-1: case TELEM_TM2-1: att &= ~NO_UNIT; - putsTime(x, y, val, att, att); + putsTimer(x, y, val, att, att); break; case TELEM_TX_VOLTAGE-1: diff --git a/radio/src/lcd.h b/radio/src/lcd.h index 185f5079f..21552bfb6 100644 --- a/radio/src/lcd.h +++ b/radio/src/lcd.h @@ -202,7 +202,8 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val, #define putstime_t int16_t #endif -void putsTime(xcoord_t x, uint8_t y, putstime_t tme, LcdFlags att, LcdFlags att2); +void putsTime(xcoord_t x, uint8_t y, struct gtm t, bool blink=false); +void putsTimer(xcoord_t x, uint8_t y, putstime_t tme, LcdFlags att, LcdFlags att2); #define SOLID 0xff #define DOTTED 0x55 diff --git a/radio/src/telemetry/nmea.cpp b/radio/src/telemetry/nmea.cpp index e803a6b74..0d1165054 100644 --- a/radio/src/telemetry/nmea.cpp +++ b/radio/src/telemetry/nmea.cpp @@ -554,12 +554,12 @@ void menuTelemetryNMEA2(uint8_t event) ignore_break=0; break;} - if (!home_alt) // umschalten zwischen absoluter und relativer Höhe + if (!home_alt) // umschalten zwischen absoluter und relativer H�he home_alt = save_alt; else home_alt=0; - if (save_alt==0) // wenn noch keine Home Höhe gesetzt war, wird sie es jetzt, weil sonst + if (save_alt==0) // wenn noch keine Home H�he gesetzt war, wird sie es jetzt, weil sonst // das Umschalten keine Wirkung zeigt save_alt = home_alt = abs_alt; // absolute altitude AUDIO_MENUS(); // short blip for non negative lift @@ -567,11 +567,11 @@ void menuTelemetryNMEA2(uint8_t event) case EVT_KEY_LONG(KEY_MENU): ignore_break = 1; - save_alt = home_alt = abs_alt; // Home altitude auf aktuelle absolute Höhe setzen + save_alt = home_alt = abs_alt; // Home altitude auf aktuelle absolute H�he setzen AUDIO_MENUS(); // short blip for non negative lift break; - case EVT_KEY_LONG(KEY_EXIT): // Max Altitude auf 0 zurücksetzen + case EVT_KEY_LONG(KEY_EXIT): // Max Altitude auf 0 zur�cksetzen max_alt=0; AUDIO_MENUS(); // short blip for non negative lift break; From 6b4dba947a3940224e880ad4e0d76118cc769731 Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 9 May 2014 16:38:22 +0200 Subject: [PATCH 71/79] Issue #1065 - FW part done --- radio/src/audio_arm.h | 7 +++++-- radio/src/eeprom_conversions.cpp | 3 +++ radio/src/gui/menu_model.cpp | 5 +++-- radio/src/gui/menus.cpp | 10 ++++++---- radio/src/gui/view_main.cpp | 2 +- radio/src/lcd.cpp | 21 ++++++++++++++++----- radio/src/lcd.h | 3 ++- radio/src/myeeprom.h | 28 ++++++++++++++++++---------- radio/src/opentx.cpp | 19 ++++++++++++++++++- radio/src/targets/gruvin9x/somo14d.h | 5 ++++- radio/src/targets/stock/voice.h | 5 ++++- radio/src/translations.h | 8 ++++---- radio/src/translations/cz.h.txt | 4 +++- radio/src/translations/de.h.txt | 6 ++++-- radio/src/translations/en.h.txt | 8 +++++--- radio/src/translations/es.h.txt | 4 +++- radio/src/translations/fi.h.txt | 4 +++- radio/src/translations/fr.h.txt | 20 +++++++++++++------- radio/src/translations/it.h.txt | 4 +++- radio/src/translations/pl.h.txt | 4 +++- radio/src/translations/pt.h.txt | 4 +++- radio/src/translations/se.h.txt | 6 ++++-- radio/src/translations/tts_cz.cpp | 4 ++-- radio/src/translations/tts_de.cpp | 4 ++-- radio/src/translations/tts_en.cpp | 4 ++-- radio/src/translations/tts_es.cpp | 9 +++++---- radio/src/translations/tts_fr.cpp | 25 +++++++++++++++++++------ radio/src/translations/tts_it.cpp | 4 ++-- radio/src/translations/tts_pl.cpp | 4 ++-- radio/src/translations/tts_pt.cpp | 4 ++-- radio/src/translations/tts_se.cpp | 4 ++-- radio/src/translations/tts_sk.cpp | 4 ++-- radio/util/tts.py | 2 +- 33 files changed, 169 insertions(+), 79 deletions(-) diff --git a/radio/src/audio_arm.h b/radio/src/audio_arm.h index 825f82fd7..70a63825e 100644 --- a/radio/src/audio_arm.h +++ b/radio/src/audio_arm.h @@ -251,7 +251,7 @@ void audioStart(); #if defined(VOICE) #define AUDIO_ERROR_MESSAGE(e) audioEvent(e) - #define AUDIO_TIMER_MINUTE(t) playDuration(t, 0) + #define AUDIO_TIMER_MINUTE(t) playDuration(t, 0, 0) #else #define AUDIO_ERROR_MESSAGE(e) audioEvent(AU_ERROR) #define AUDIO_TIMER_MINUTE(t) audioDefevent(AU_WARNING1) @@ -317,7 +317,10 @@ void pushPrompt(uint16_t prompt, uint8_t id=0); #define PLAY_FUNCTION(x, ...) void x(__VA_ARGS__, uint8_t id) #define PUSH_NUMBER_PROMPT(p) pushPrompt((p), id) #define PLAY_NUMBER(n, u, a) playNumber((n), (u), (a), id) -#define PLAY_DURATION(d) playDuration((d), id) +#define PLAY_DURATION(d, att) playDuration((d), (att), id) +#define PLAY_DURATION_ATT , uint8_t flags +#define PLAY_TIME 1 +#define IS_PLAY_TIME() (flags&PLAY_TIME) #define IS_PLAYING(id) audioQueue.isPlaying((id)) #define PLAY_VALUE(v, id) playValue((v), (id)) #define PLAY_FILE(f, flags, id) audioQueue.playFile((f), (flags), (id)) diff --git a/radio/src/eeprom_conversions.cpp b/radio/src/eeprom_conversions.cpp index 6d7c8dbd7..4da6e0fe1 100644 --- a/radio/src/eeprom_conversions.cpp +++ b/radio/src/eeprom_conversions.cpp @@ -332,6 +332,9 @@ void ConvertGeneralSettings_215_to_216(EEGeneral &settings) int ConvertTelemetrySource_215_to_216(int source) { + // TELEM_TX_TIME and 5 spare added + if (source >= TELEM_TX_TIME) + source += 6; // TELEM_RSSI_TX added if (source >= TELEM_RSSI_TX) source += 1; diff --git a/radio/src/gui/menu_model.cpp b/radio/src/gui/menu_model.cpp index 3f12a67bf..d72d4c1e7 100644 --- a/radio/src/gui/menu_model.cpp +++ b/radio/src/gui/menu_model.cpp @@ -4348,7 +4348,7 @@ void menuModelLogicalSwitchOne(uint8_t event) CHECK_INCDEC_MODELVAR(event, cs->v3, 0, 222 - cs->v2); break; } - v2_min=-129; v2_max = 122; + v2_min = -129; v2_max = 122; } else if (cstate == LS_FAMILY_COMP) { putsMixerSource(CSWONE_2ND_COLUMN, y, cs->v2, attr); @@ -4646,7 +4646,8 @@ void menuModelLogicalSwitches(uint8_t event) v2_max = maxTelemValue(v1_val - MIXSRC_FIRST_TELEM + 1); #if defined(CPUARM) v2_min = minTelemValue(v1_val - MIXSRC_FIRST_TELEM + 1); - INCDEC_SET_FLAG(INCDEC_REP10 | NO_INCDEC_MARKS); + if (horz == 2 && v2_max-v2_min > 1000) + INCDEC_SET_FLAG(INCDEC_REP10 | NO_INCDEC_MARKS); if (cs->v2 < v2_min || cs->v2 > v2_max) { cs->v2 = 0; eeDirty(EE_MODEL); diff --git a/radio/src/gui/menus.cpp b/radio/src/gui/menus.cpp index b9453d73a..bd505626f 100644 --- a/radio/src/gui/menus.cpp +++ b/radio/src/gui/menus.cpp @@ -123,13 +123,13 @@ int16_t checkIncDec(uint8_t event, int16_t val, int16_t i_min, int16_t i_max, ui else if (DBLKEYS_PRESSED_RGT_UP(in)) { newval = (i_max > 100 ? 100 : i_max); #if defined(CPUARM) - if(i_flags & DBLKEYS_1000) newval *= 10; + if (i_flags & DBLKEYS_1000) newval *= 10; #endif } else if (DBLKEYS_PRESSED_LFT_DWN(in)) { newval = (i_min < -100 ? -100 : i_min); #if defined(CPUARM) - if(i_flags & DBLKEYS_1000) newval *= 10; + if (i_flags & DBLKEYS_1000) newval *= 10; #endif } else if (DBLKEYS_PRESSED_UP_DWN(in)) @@ -141,7 +141,6 @@ int16_t checkIncDec(uint8_t event, int16_t val, int16_t i_min, int16_t i_max, ui #endif - if (dblkey) { killEvents(KEY_UP); killEvents(KEY_DOWN); @@ -1434,7 +1433,10 @@ bool isTelemetrySourceAvailable(int source) if (source >= TELEM_RESERVE6 && source <= TELEM_RESERVE10) return false; - + + if (source >= TELEM_RESERVE11 && source <= TELEM_RESERVE15) + return false; + if (source == TELEM_DTE) return false; diff --git a/radio/src/gui/view_main.cpp b/radio/src/gui/view_main.cpp index e089b14c2..04001a5ce 100644 --- a/radio/src/gui/view_main.cpp +++ b/radio/src/gui/view_main.cpp @@ -318,7 +318,7 @@ void displayTopBar() /* RTC time */ struct gtm t; gettime(&t); - putsTime(BAR_TIME_X+1, BAR_Y+1, t, true); + putsTime(BAR_TIME_X+1, BAR_Y+1, t, TIMEBLINK); /* The background */ lcd_filled_rect(BAR_X, BAR_Y, BAR_W, BAR_H, SOLID, FILL_WHITE|GREY_DEFAULT|ROUND); diff --git a/radio/src/lcd.cpp b/radio/src/lcd.cpp index 020d17842..cf0d760f7 100644 --- a/radio/src/lcd.cpp +++ b/radio/src/lcd.cpp @@ -867,13 +867,14 @@ void lcdDrawTelemetryTopBar() #endif #if defined(PCBTARANIS) -void putsTime(xcoord_t x, uint8_t y, struct gtm t, bool blink) +void putsTime(xcoord_t x, uint8_t y, struct gtm t, LcdFlags att) { - if (blink && (t.tm_sec%2)) { - lcd_putcAtt(x, y, ':', 0); + LcdFlags att2 = (att & (INVERS|BLINK)) | LEADING0; + lcd_outdezNAtt(x, y, t.tm_hour, att2, 2); + if (!(att&TIMEBLINK) || (t.tm_sec%2)) { + lcd_putcAtt(x, y, ':', att); } - lcd_outdezNAtt(x, y, t.tm_hour, LEADING0, 2); - lcd_outdezNAtt(x+3*FWNUM-2, y, t.tm_min, LEADING0, 2); + lcd_outdezNAtt(x+3*FWNUM-2, y, t.tm_min, att2, 2); } #endif @@ -1197,6 +1198,16 @@ const pm_uint8_t bchunit_ar[] PROGMEM = { void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val, uint8_t att) { switch (channel) { +#if defined(CPUARM) + case TELEM_TX_TIME-1: + { + gtm t; + t.tm_hour = val / 60; + t.tm_min = val % 60; + putsTime(x+2*FWNUM, y, t, att); + break; + } +#endif case TELEM_TM1-1: case TELEM_TM2-1: att &= ~NO_UNIT; diff --git a/radio/src/lcd.h b/radio/src/lcd.h index 21552bfb6..6a930e82e 100644 --- a/radio/src/lcd.h +++ b/radio/src/lcd.h @@ -113,6 +113,7 @@ #define SMLSIZE 0x0200 #define TINSIZE 0x0400 #define STREXPANDED 0x0800 + #define TIMEBLINK 0x1000 #else #define MIDSIZE DBLSIZE #define SMLSIZE 0x00 @@ -202,7 +203,7 @@ void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val, #define putstime_t int16_t #endif -void putsTime(xcoord_t x, uint8_t y, struct gtm t, bool blink=false); +void putsTime(xcoord_t x, uint8_t y, struct gtm t, LcdFlags att); void putsTimer(xcoord_t x, uint8_t y, putstime_t tme, LcdFlags att, LcdFlags att2); #define SOLID 0xff diff --git a/radio/src/myeeprom.h b/radio/src/myeeprom.h index 223591cdd..15686e836 100644 --- a/radio/src/myeeprom.h +++ b/radio/src/myeeprom.h @@ -1002,6 +1002,14 @@ PACK(typedef struct t_FrSkyChannelData { enum TelemetrySource { TELEM_NONE, TELEM_TX_VOLTAGE, +#if defined(CPUARM) + TELEM_TX_TIME, + TELEM_RESERVE1, + TELEM_RESERVE2, + TELEM_RESERVE3, + TELEM_RESERVE4, + TELEM_RESERVE5, +#endif TELEM_TM1, TELEM_TM2, #if defined(CPUARM) @@ -1040,11 +1048,11 @@ enum TelemetrySource { TELEM_ASPEED, TELEM_DTE, #if defined(CPUARM) - TELEM_RESERVE1, - TELEM_RESERVE2, - TELEM_RESERVE3, - TELEM_RESERVE4, - TELEM_RESERVE5, + TELEM_RESERVE6, + TELEM_RESERVE7, + TELEM_RESERVE8, + TELEM_RESERVE9, + TELEM_RESERVE10, #endif TELEM_MIN_A1, TELEM_MIN_A2, @@ -1066,11 +1074,11 @@ enum TelemetrySource { TELEM_MAX_CURRENT, TELEM_MAX_POWER, #if defined(CPUARM) - TELEM_RESERVE6, - TELEM_RESERVE7, - TELEM_RESERVE8, - TELEM_RESERVE9, - TELEM_RESERVE10, + TELEM_RESERVE11, + TELEM_RESERVE12, + TELEM_RESERVE13, + TELEM_RESERVE14, + TELEM_RESERVE15, #endif TELEM_ACC, TELEM_GPS_TIME, diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 520853308..10af7719f 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1298,6 +1298,13 @@ getvalue_t getValue(uint8_t i) #endif else if (i==MIXSRC_FIRST_TELEM-1+TELEM_TX_VOLTAGE) return g_vbat100mV; +#if defined(CPUARM) + else if (i==MIXSRC_FIRST_TELEM-1+TELEM_TX_TIME) { + struct gtm t; + gettime(&t); + return t.tm_hour*60 + t.tm_min; + } +#endif else if (i<=MIXSRC_FIRST_TELEM-1+TELEM_TM2) return timersStates[i-MIXSRC_FIRST_TELEM+1-TELEM_TM1].val; #if defined(FRSKY) #if defined(CPUARM) @@ -2040,6 +2047,7 @@ ls_telemetry_value_t minTelemValue(uint8_t channel) switch (channel) { case TELEM_FUEL: #if defined(CPUARM) + case TELEM_TX_TIME: case TELEM_SWR: #endif case TELEM_RSSI_TX: @@ -2060,6 +2068,10 @@ ls_telemetry_value_t minTelemValue(uint8_t channel) ls_telemetry_value_t maxTelemValue(uint8_t channel) { switch (channel) { +#if defined(CPUARM) + case TELEM_TX_TIME: + return 24*60-1; +#endif case TELEM_FUEL: #if defined(CPUARM) case TELEM_SWR: @@ -3277,12 +3289,17 @@ PLAY_FUNCTION(playValue, uint8_t idx) getvalue_t val = getValue(idx); switch (idx) { +#if defined(CPUARM) + case MIXSRC_FIRST_TELEM+TELEM_TX_TIME-1: + PLAY_DURATION(val*60, PLAY_TIME); + break; +#endif case MIXSRC_FIRST_TELEM+TELEM_TX_VOLTAGE-1: PLAY_NUMBER(val, 1+UNIT_VOLTS, PREC1); break; case MIXSRC_FIRST_TELEM+TELEM_TM1-1: case MIXSRC_FIRST_TELEM+TELEM_TM2-1: - PLAY_DURATION(val); + PLAY_DURATION(val, 0); break; #if defined(CPUARM) case MIXSRC_FIRST_TELEM+TELEM_SWR-1: diff --git a/radio/src/targets/gruvin9x/somo14d.h b/radio/src/targets/gruvin9x/somo14d.h index 4195042cb..1e0f9c579 100644 --- a/radio/src/targets/gruvin9x/somo14d.h +++ b/radio/src/targets/gruvin9x/somo14d.h @@ -47,7 +47,10 @@ extern bool isPlaying(); #define PUSH_NUMBER_PROMPT(p) pushPrompt(PROMPT_I18N_BASE+(p)) #define PUSH_SYSTEM_PROMPT(p) pushPrompt(PROMPT_SYSTEM_BASE+(p)) #define PLAY_NUMBER(n, u, a) playNumber((n), (u), (a)) -#define PLAY_DURATION(d) playDuration((d)) +#define PLAY_DURATION(d, att) playDuration((d)) +#define PLAY_DURATION_ATT +#define PLAY_TIME +#define IS_PLAY_TIME() (0) #define IS_PLAYING(id) isPlaying() #define PLAY_VALUE(v, id) playValue((v)) diff --git a/radio/src/targets/stock/voice.h b/radio/src/targets/stock/voice.h index 8a092bb3f..fecf240c1 100644 --- a/radio/src/targets/stock/voice.h +++ b/radio/src/targets/stock/voice.h @@ -134,6 +134,9 @@ inline bool isPlaying() #define PUSH_NUMBER_PROMPT(p) pushNumberPrompt((p)) #define PUSH_SYSTEM_PROMPT(p) pushNumberPrompt(PROMPT_SYSTEM_BASE-PROMPT_I18N_BASE+(p)) #define PLAY_NUMBER(n, u, a) playNumber((n), (u), (a)) -#define PLAY_DURATION(d) playDuration((d)) +#define PLAY_DURATION(d, att) playDuration((d)) +#define PLAY_DURATION_ATT +#define PLAY_TIME +#define IS_PLAY_TIME() (0) #define IS_PLAYING(id) (0) /* isPlaying() */ #define PLAY_VALUE(v, id) playValue((v)) diff --git a/radio/src/translations.h b/radio/src/translations.h index 2fff18ae0..952c6aad5 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -625,16 +625,16 @@ extern const pm_char STR_EEBACKUP[]; struct LanguagePack { const char *id; const char *name; - void (*playNumber)(getvalue_t number, uint8_t unit, uint8_t att, uint8_t id); - void (*playDuration)(int16_t seconds, uint8_t id); + void (*playNumber)(getvalue_t number, uint8_t unit, uint8_t flags, uint8_t id); + void (*playDuration)(int16_t seconds, uint8_t flags, uint8_t id); }; extern LanguagePack * languagePacks[]; extern LanguagePack * currentLanguagePack; extern uint8_t currentLanguagePackIdx; #define LANGUAGE_PACK_DECLARE(lng, name) LanguagePack lng ## LanguagePack = { #lng, name, lng ## _ ## playNumber, lng ## _ ## playDuration } #define LANGUAGE_PACK_DECLARE_DEFAULT(lng, name) LANGUAGE_PACK_DECLARE(lng, name); LanguagePack * currentLanguagePack = & lng ## LanguagePack; uint8_t currentLanguagePackIdx - inline PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att) { currentLanguagePack->playNumber(number, unit, att, id); } - inline PLAY_FUNCTION(playDuration, int16_t seconds) { currentLanguagePack->playDuration(seconds, id); } + inline PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t flags) { currentLanguagePack->playNumber(number, unit, flags, id); } + inline PLAY_FUNCTION(playDuration, int16_t seconds, uint8_t flags) { currentLanguagePack->playDuration(seconds, flags, id); } #elif defined(VOICE) PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att); PLAY_FUNCTION(playDuration, int16_t seconds); diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 0e1fab4eb..75b93cf6a 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -282,12 +282,14 @@ #if defined(CPUARM) #define TR_TELEM_RESERVE "[--]" + #define TR_TELEM_TIME "Time" #define TR_SWR "SWR\0" #define TR_RX_BATT "RxBt" #define TR_A3_A4 "A3\0 ""A4\0 " #define TR_A3_A4_MIN "A3-\0""A4-\0" #else #define TR_TELEM_RESERVE + #define TR_TELEM_TIME #define TR_SWR #define TR_RX_BATT #define TR_A3_A4 @@ -296,7 +298,7 @@ #define TR_ASPD_MAX "ASp+" -#define TR_VTELEMCHNS "---\0""Bat\0""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" +#define TR_VTELEMCHNS "---\0""Bat\0" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" #define LENGTH_UNIT_IMP "ft\0" #define SPEED_UNIT_IMP "mph" diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index f5fb0d533..c42ff513d 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -282,12 +282,14 @@ #if defined(CPUARM) #define TR_TELEM_RESERVE TR("[--]", "[---]") + #define TR_TELEM_TIME TR("Time", "Time\0") #define TR_SWR TR("SWR\0", "SWR\0 ") #define TR_RX_BATT TR("RxBt", "RxBat") #define TR_A3_A4 TR("A3\0 ""A4\0 ", "A3\0 ""A4\0 ") #define TR_A3_A4_MIN TR("A3-\0""A4-\0", "A3-\0 ""A4-\0 ") #else #define TR_TELEM_RESERVE + #define TR_TELEM_TIME #define TR_SWR #define TR_RX_BATT #define TR_A3_A4 @@ -297,9 +299,9 @@ #define TR_ASPD_MAX TR("ASp+", "ASpd+") #if LCD_W >= 212 - #define TR_VTELEMCHNS "---\0 ""Batt\0""Tmr1\0""Tmr2\0" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0 ""Rpm\0 ""Fuel\0""T1\0 ""T2\0 ""Spd\0 ""Dist\0""GAlt\0""Cell\0""Cells""Vfas\0""Curr\0""Cnsp\0""Powr\0""AccX\0""AccY\0""AccZ\0""Hdg\0 ""VSpd\0""ASpd\0""dTE\0 " TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0 ""A2-\0 " TR_A3_A4_MIN "Alt-\0""Alt+\0""Rpm+\0""T1+\0 ""T2+\0 ""Spd+\0""Dst+\0" TR_ASPD_MAX "Cell-""Cels-""Vfas-""Curr+""Powr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0 ""Time\0" + #define TR_VTELEMCHNS "---\0 ""Batt\0" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Tmr1\0""Tmr2\0" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0 ""Rpm\0 ""Fuel\0""T1\0 ""T2\0 ""Spd\0 ""Dist\0""GAlt\0""Cell\0""Cells""Vfas\0""Curr\0""Cnsp\0""Powr\0""AccX\0""AccY\0""AccZ\0""Hdg\0 ""VSpd\0""ASpd\0""dTE\0 " TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0 ""A2-\0 " TR_A3_A4_MIN "Alt-\0""Alt+\0""Rpm+\0""T1+\0 ""T2+\0 ""Spd+\0""Dst+\0" TR_ASPD_MAX "Cell-""Cels-""Vfas-""Curr+""Powr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0 ""Time\0" #else - #define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" + #define TR_VTELEMCHNS "---\0""Batt" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" #endif #define LENGTH_UNIT_IMP "ft\0" diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index 7aebfceb5..407aaa5d0 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -281,13 +281,15 @@ #define LEN_VTELEMCHNS TR("\004", "\005") #if defined(CPUARM) - #define TR_TELEM_RESERVE TR("[--]", "[---]") + #define TR_TELEM_RESERVE TR("[--]", "[---]") + #define TR_TELEM_TIME TR("Time", "Time\0") #define TR_SWR TR("SWR\0", "SWR\0 ") #define TR_RX_BATT TR("RxBt", "RxBat") #define TR_A3_A4 TR("A3\0 ""A4\0 ", "A3\0 ""A4\0 ") #define TR_A3_A4_MIN TR("A3-\0""A4-\0", "A3-\0 ""A4-\0 ") #else #define TR_TELEM_RESERVE + #define TR_TELEM_TIME #define TR_SWR #define TR_RX_BATT #define TR_A3_A4 @@ -297,9 +299,9 @@ #define TR_ASPD_MAX TR("ASp+", "ASpd+") #if LCD_W >= 212 - #define TR_VTELEMCHNS "---\0 ""Batt\0""Tmr1\0""Tmr2\0" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0 ""Rpm\0 ""Fuel\0""T1\0 ""T2\0 ""Spd\0 ""Dist\0""GAlt\0""Cell\0""Cells""Vfas\0""Curr\0""Cnsp\0""Powr\0""AccX\0""AccY\0""AccZ\0""Hdg\0 ""VSpd\0""ASpd\0""dTE\0 " TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0 ""A2-\0 " TR_A3_A4_MIN "Alt-\0""Alt+\0""Rpm+\0""T1+\0 ""T2+\0 ""Spd+\0""Dst+\0" TR_ASPD_MAX "Cell-""Cels-""Vfas-""Curr+""Powr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0 ""Time\0" + #define TR_VTELEMCHNS "---\0 ""Batt\0" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Tmr1\0""Tmr2\0" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0 ""Rpm\0 ""Fuel\0""T1\0 ""T2\0 ""Spd\0 ""Dist\0""GAlt\0""Cell\0""Cells""Vfas\0""Curr\0""Cnsp\0""Powr\0""AccX\0""AccY\0""AccZ\0""Hdg\0 ""VSpd\0""ASpd\0""dTE\0 " TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0 ""A2-\0 " TR_A3_A4_MIN "Alt-\0""Alt+\0""Rpm+\0""T1+\0 ""T2+\0 ""Spd+\0""Dst+\0" TR_ASPD_MAX "Cell-""Cels-""Vfas-""Curr+""Powr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0 ""Time\0" #else - #define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" + #define TR_VTELEMCHNS "---\0""Batt" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" #endif #define LENGTH_UNIT_IMP "ft\0" diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index 2a7d40e1e..ccef208d5 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -282,12 +282,14 @@ #if defined(CPUARM) #define TR_TELEM_RESERVE "[--]" + #define TR_TELEM_TIME "Time" #define TR_SWR "SWR\0" #define TR_RX_BATT "RxBt" #define TR_A3_A4 "A3\0 ""A4\0 " #define TR_A3_A4_MIN "A3-\0""A4-\0" #else #define TR_TELEM_RESERVE + #define TR_TELEM_TIME #define TR_SWR #define TR_RX_BATT #define TR_A3_A4 @@ -296,7 +298,7 @@ #define TR_ASPD_MAX "ASp+" -#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Hora" +#define TR_VTELEMCHNS "---\0""Batt" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Hora" #define LENGTH_UNIT_IMP "ft\0" #define SPEED_UNIT_IMP "mph" diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index e79743fb0..8760491c0 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -282,12 +282,14 @@ #if defined(CPUARM) #define TR_TELEM_RESERVE "[--]" + #define TR_TELEM_TIME "Time" #define TR_SWR "SWR\0" #define TR_RX_BATT "RxBt" #define TR_A3_A4 "A3\0 ""A4\0 " #define TR_A3_A4_MIN "A3-\0""A4-\0" #else #define TR_TELEM_RESERVE + #define TR_TELEM_TIME #define TR_SWR #define TR_RX_BATT #define TR_A3_A4 @@ -296,7 +298,7 @@ #define TR_ASPD_MAX "ASp+" -#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" +#define TR_VTELEMCHNS "---\0""Batt" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" #define LENGTH_UNIT_IMP "ft\0" #define SPEED_UNIT_IMP "mph" diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index fc414f78b..f35f472eb 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -278,16 +278,18 @@ #define LEN_FUNCSOUNDS TR("\004", "\006") #define TR_FUNCSOUNDS TR("Bp1\0""Bp2\0""Bp3\0""Wrn1""Wrn2""Chee""Rata""Tick""Sirn""Ring""SciF""Robt""Chrp""Tada""Crck""Alrm", "Beep1 ""Beep2 ""Beep3 ""Warn1 ""Warn2 ""Cheep ""Ratata""Tick ""Siren ""Ring ""SciFi ""Robot ""Chirp ""Tada ""Crickt""AlmClk") -#define LEN_VTELEMCHNS "\004" +#define LEN_VTELEMCHNS TR("\004", "\005") #if defined(CPUARM) - #define TR_TELEM_RESERVE "[--]" - #define TR_SWR "SWR\0" - #define TR_RX_BATT "RxBt" - #define TR_A3_A4 "A3\0 ""A4\0 " - #define TR_A3_A4_MIN "A3-\0""A4-\0" + #define TR_TELEM_RESERVE TR("[--]", "[---]") + #define TR_TELEM_TIME TR("Heur", "Heure") + #define TR_SWR TR("SWR\0", "SWR\0 ") + #define TR_RX_BATT TR("RxBt", "RxBat") + #define TR_A3_A4 TR("A3\0 ""A4\0 ", "A3\0 ""A4\0 ") + #define TR_A3_A4_MIN TR("A3-\0""A4-\0", "A3-\0 ""A4-\0 ") #else #define TR_TELEM_RESERVE + #define TR_TELEM_TIME #define TR_SWR #define TR_RX_BATT #define TR_A3_A4 @@ -296,7 +298,11 @@ #define TR_ASPD_MAX "ViA+" -#define TR_VTELEMCHNS "---\0""Batt""Chr1""Chr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Carb""T1\0 ""T2\0 ""Vit\0""Dist""AltG""Elem""Velm""Vfas""Cour""Cnsm""Puis""AccX""AccY""AccZ""Cap\0""VitV""VitA""dET\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vit+""Dst+" TR_ASPD_MAX "Elm-""Els-""Vfs-""Cur+""Pui+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Tmps" +#if LCD_W >= 212 + #define TR_VTELEMCHNS "---\0 ""Batt\0" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Chr1\0""Chr2\0" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0 ""Rpm\0 ""Carbu""T1\0 ""T2\0 ""Vit\0 ""Dist\0""AltG""Elem\0""Velm\0""Vfas\0""Cour\0""Consm""Puiss""AccX\0""AccY\0""AccZ\0""Cap\0 ""VitV\0""VitA\0""dET\0 " TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0 ""A2-\0 " TR_A3_A4_MIN "Alt-\0""Alt+\0""Rpm+\0""T1+\0 ""T2+\0 ""Vit+\0""Dst+\0" TR_ASPD_MAX "Elem-""Els-\0""Vfas-""Curr+""Puis+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Accel""Temps" +#else + #define TR_VTELEMCHNS "---\0""Batt" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Chr1""Chr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Carb""T1\0 ""T2\0 ""Vit\0""Dist""AltG""Elem""Velm""Vfas""Cour""Cnsm""Puis""AccX""AccY""AccZ""Cap\0""VitV""VitA""dET\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vit+""Dst+" TR_ASPD_MAX "Elm-""Els-""Vfs-""Cur+""Pui+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Tmps" +#endif #define LENGTH_UNIT_IMP "ft\0" #define SPEED_UNIT_IMP "mph" diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index 52851102a..3c6aa3606 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -282,12 +282,14 @@ #if defined(CPUARM) #define TR_TELEM_RESERVE "[--]" + #define TR_TELEM_TIME "Time" #define TR_SWR "SWR\0" #define TR_RX_BATT "RxBt" #define TR_A3_A4 "A3\0 ""A4\0 " #define TR_A3_A4_MIN "A3-\0""A4-\0" #else #define TR_TELEM_RESERVE + #define TR_TELEM_TIME #define TR_SWR #define TR_RX_BATT #define TR_A3_A4 @@ -296,7 +298,7 @@ #define TR_ASPD_MAX "ASp+" -#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Carb""T1\0 ""T2\0 ""Vel\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsm""Powr""AccX""AccY""AccZ""Dir\0""VelV""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vel+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" +#define TR_VTELEMCHNS "---\0""Batt" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Carb""T1\0 ""T2\0 ""Vel\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsm""Powr""AccX""AccY""AccZ""Dir\0""VelV""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vel+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" #define LENGTH_UNIT_IMP "ft\0" #define SPEED_UNIT_IMP "mph" diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index d6187ef9e..0f2d7d4f9 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -282,12 +282,14 @@ #if defined(CPUARM) #define TR_TELEM_RESERVE "[--]" + #define TR_TELEM_TIME "Time" #define TR_SWR "SWR\0" #define TR_RX_BATT "RxBt" #define TR_A3_A4 "A3\0 ""A4\0 " #define TR_A3_A4_MIN "A3-\0""A4-\0" #else #define TR_TELEM_RESERVE + #define TR_TELEM_TIME #define TR_SWR #define TR_RX_BATT #define TR_A3_A4 @@ -296,7 +298,7 @@ #define TR_ASPD_MAX "ASp+" -#define TR_VTELEMCHNS "---\0""Bat\0""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Wys\0""Rpm\0""Pali""T1\0 ""T2\0 ""Spd\0""Dyst""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Moc\0""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Wys-""Wys+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Moc+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" +#define TR_VTELEMCHNS "---\0""Bat\0" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Wys\0""Rpm\0""Pali""T1\0 ""T2\0 ""Spd\0""Dyst""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Moc\0""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Wys-""Wys+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Moc+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" #define LENGTH_UNIT_IMP "ft\0" #define SPEED_UNIT_IMP "mph" diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index ed7e02950..c0e14452c 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -282,12 +282,14 @@ #if defined(CPUARM) #define TR_TELEM_RESERVE "[--]" + #define TR_TELEM_TIME "Time" #define TR_SWR "SWR\0" #define TR_RX_BATT "RxBt" #define TR_A3_A4 "A3\0 ""A4\0 " #define TR_A3_A4_MIN "A3-\0""A4-\0" #else #define TR_TELEM_RESERVE + #define TR_TELEM_TIME #define TR_SWR #define TR_RX_BATT #define TR_A3_A4 @@ -296,7 +298,7 @@ #define TR_ASPD_MAX "ASp+" -#define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VVel""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vel+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Hora" +#define TR_VTELEMCHNS "---\0""Batt" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VVel""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Vel+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Hora" #define LENGTH_UNIT_IMP "ft\0" #define SPEED_UNIT_IMP "mph" diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index bfa971b40..1f68577ce 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -282,12 +282,14 @@ #if defined(CPUARM) #define TR_TELEM_RESERVE "[--]" + #define TR_TELEM_TIME "Time" #define TR_SWR "SWR\0" #define TR_RX_BATT "RxBt" #define TR_A3_A4 "A3\0 ""A4\0 " #define TR_A3_A4_MIN "A3-\0""A4-\0" #else #define TR_TELEM_RESERVE + #define TR_TELEM_TIME #define TR_SWR #define TR_RX_BATT #define TR_A3_A4 @@ -297,9 +299,9 @@ #define TR_ASPD_MAX TR("ASp+", "ASpd+") #if LCD_W >= 212 - #define TR_VTELEMCHNS "---\0 ""Batt\0""Tmr1\0""Tmr2\0" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0 ""Rpm\0 ""Fuel\0""T1\0 ""T2\0 ""Spd\0 ""Dist\0""GAlt\0""Cell\0""Cells""Vfas\0""Curr\0""Cnsp\0""Powr\0""AccX\0""AccY\0""AccZ\0""Hdg\0 ""VSpd\0""ASpd\0""dTE\0 " TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0 ""A2-\0 " TR_A3_A4_MIN "Alt-\0""Alt+\0""Rpm+\0""T1+\0 ""T2+\0 ""Spd+\0""Dst+\0" TR_ASPD_MAX "Cell-""Cels-""Vfas-""Curr+""Powr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0 ""Time\0" + #define TR_VTELEMCHNS "---\0 ""Batt\0" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Tmr1\0""Tmr2\0" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0 ""Rpm\0 ""Fuel\0""T1\0 ""T2\0 ""Spd\0 ""Dist\0""GAlt\0""Cell\0""Cells""Vfas\0""Curr\0""Cnsp\0""Powr\0""AccX\0""AccY\0""AccZ\0""Hdg\0 ""VSpd\0""ASpd\0""dTE\0 " TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0 ""A2-\0 " TR_A3_A4_MIN "Alt-\0""Alt+\0""Rpm+\0""T1+\0 ""T2+\0 ""Spd+\0""Dst+\0" TR_ASPD_MAX "Cell-""Cels-""Vfas-""Curr+""Powr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0 ""Time\0" #else - #define TR_VTELEMCHNS "---\0""Batt""Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" + #define TR_VTELEMCHNS "---\0""Batt" TR_TELEM_TIME TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Tmr1""Tmr2" TR_SWR "Tx\0 ""Rx\0 " TR_RX_BATT "A1\0 ""A2\0 " TR_A3_A4 "Alt\0""Rpm\0""Fuel""T1\0 ""T2\0 ""Spd\0""Dist""GAlt""Cell""Cels""Vfas""Curr""Cnsp""Powr""AccX""AccY""AccZ""Hdg\0""VSpd""ASpd""dTE\0" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "A1-\0""A2-\0" TR_A3_A4_MIN "Alt-""Alt+""Rpm+""T1+\0""T2+\0""Spd+""Dst+" TR_ASPD_MAX "Cel-""Cls-""Vfs-""Cur+""Pwr+" TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE TR_TELEM_RESERVE "Acc\0""Time" #endif #define LENGTH_UNIT_IMP "ft\0" diff --git a/radio/src/translations/tts_cz.cpp b/radio/src/translations/tts_cz.cpp index 1fcfd0e82..9440c725b 100644 --- a/radio/src/translations/tts_cz.cpp +++ b/radio/src/translations/tts_cz.cpp @@ -219,7 +219,7 @@ I18N_PLAY_FUNCTION(cz, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(cz, playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(cz, playDuration, int16_t seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS); @@ -228,7 +228,7 @@ I18N_PLAY_FUNCTION(cz, playDuration, int16_t seconds) uint8_t tmp = seconds / 3600; seconds %= 3600; - if (tmp > 0) { + if (tmp > 0 || IS_PLAY_TIME()) { PLAY_NUMBER(tmp, UNIT_HOURS+1, ZENSKY); } diff --git a/radio/src/translations/tts_de.cpp b/radio/src/translations/tts_de.cpp index 067de6cca..bb7e88f08 100644 --- a/radio/src/translations/tts_de.cpp +++ b/radio/src/translations/tts_de.cpp @@ -168,7 +168,7 @@ I18N_PLAY_FUNCTION(de, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(de, playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(de, playDuration, int16_t seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(DE_PROMPT_MINUS); @@ -178,7 +178,7 @@ I18N_PLAY_FUNCTION(de, playDuration, int16_t seconds) uint8_t ore = 0; uint8_t tmp = seconds / 3600; seconds %= 3600; - if (tmp > 0) { + if (tmp > 0 || IS_PLAY_TIME()) { PLAY_NUMBER(tmp, 0, 0); PUSH_NUMBER_PROMPT(DE_PROMPT_UHR); } diff --git a/radio/src/translations/tts_en.cpp b/radio/src/translations/tts_en.cpp index 5810b4b3e..8d30536d7 100644 --- a/radio/src/translations/tts_en.cpp +++ b/radio/src/translations/tts_en.cpp @@ -151,7 +151,7 @@ I18N_PLAY_FUNCTION(en, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(en, playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(en, playDuration, int16_t seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(EN_PROMPT_MINUS); @@ -160,7 +160,7 @@ I18N_PLAY_FUNCTION(en, playDuration, int16_t seconds) uint8_t tmp = seconds / 3600; seconds %= 3600; - if (tmp > 0) { + if (tmp > 0 || IS_PLAY_TIME()) { PLAY_NUMBER(tmp, UNIT_HOURS+1 , 0); } diff --git a/radio/src/translations/tts_es.cpp b/radio/src/translations/tts_es.cpp index bc949c377..c0993e16d 100644 --- a/radio/src/translations/tts_es.cpp +++ b/radio/src/translations/tts_es.cpp @@ -190,7 +190,7 @@ I18N_PLAY_FUNCTION(es, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(es, playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(es, playDuration, int16_t seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(ES_PROMPT_MENO); @@ -200,12 +200,13 @@ I18N_PLAY_FUNCTION(es, playDuration, int16_t seconds) uint8_t ore = 0; uint8_t tmp = seconds / 3600; seconds %= 3600; - if (tmp > 0) { - ore=tmp; + if (tmp > 0 || IS_PLAY_TIME()) { + ore = tmp; if (tmp > 1) { PLAY_NUMBER(tmp, 0, 0); PUSH_NUMBER_PROMPT(ES_PROMPT_HORAS); - } else { + } + else { PUSH_NUMBER_PROMPT(ES_PROMPT_UNA); PUSH_NUMBER_PROMPT(ES_PROMPT_HORA); } diff --git a/radio/src/translations/tts_fr.cpp b/radio/src/translations/tts_fr.cpp index 4bcaa0723..31ede7b62 100644 --- a/radio/src/translations/tts_fr.cpp +++ b/radio/src/translations/tts_fr.cpp @@ -42,6 +42,8 @@ enum FrenchPrompts { FR_PROMPT_VIRGULE = 119, FR_PROMPT_ET = 120, FR_PROMPT_MOINS = 121, + FR_PROMPT_MINUIT = 122, + FR_PROMPT_MIDI = 123, FR_PROMPT_UNITS_BASE = 125, FR_PROMPT_VOLTS = FR_PROMPT_UNITS_BASE+UNIT_VOLTS, @@ -174,7 +176,7 @@ I18N_PLAY_FUNCTION(fr, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(fr, playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(fr, playDuration, int16_t seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(FR_PROMPT_MOINS); @@ -183,7 +185,13 @@ I18N_PLAY_FUNCTION(fr, playDuration, int16_t seconds) uint8_t tmp = seconds / 3600; seconds %= 3600; - if (tmp > 0) { + if (IS_PLAY_TIME() && tmp==0) { + PUSH_NUMBER_PROMPT(FR_PROMPT_MINUIT); + } + else if (IS_PLAY_TIME() && tmp==12) { + PUSH_NUMBER_PROMPT(FR_PROMPT_MIDI); + } + else if (tmp > 0) { PLAY_NUMBER(tmp, 0, FEMININ); PUSH_NUMBER_PROMPT(FR_PROMPT_HEURE); } @@ -191,10 +199,15 @@ I18N_PLAY_FUNCTION(fr, playDuration, int16_t seconds) tmp = seconds / 60; seconds %= 60; if (tmp > 0) { - PLAY_NUMBER(tmp, 0, FEMININ); - PUSH_NUMBER_PROMPT(FR_PROMPT_MINUTE); - if (seconds > 0) - PUSH_NUMBER_PROMPT(FR_PROMPT_ET); + if (IS_PLAY_TIME()) { + PLAY_NUMBER(tmp, 0, tmp==1 ? FEMININ : 0); + } + else { + PLAY_NUMBER(tmp, 0, FEMININ); + PUSH_NUMBER_PROMPT(FR_PROMPT_MINUTE); + if (seconds > 0) + PUSH_NUMBER_PROMPT(FR_PROMPT_ET); + } } if (seconds > 0) { diff --git a/radio/src/translations/tts_it.cpp b/radio/src/translations/tts_it.cpp index e729f4452..45630cdda 100644 --- a/radio/src/translations/tts_it.cpp +++ b/radio/src/translations/tts_it.cpp @@ -164,7 +164,7 @@ I18N_PLAY_FUNCTION(it, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(it, playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(it, playDuration, int16_t seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(IT_PROMPT_MENO); @@ -176,7 +176,7 @@ I18N_PLAY_FUNCTION(it, playDuration, int16_t seconds) seconds %= 3600; if (tmp > 0) { ore=tmp; - if (tmp > 1) { + if (tmp > 1 || IS_PLAY_TIME()) { PLAY_NUMBER(tmp, 0, 0); PUSH_NUMBER_PROMPT(IT_PROMPT_ORE); } else { diff --git a/radio/src/translations/tts_pl.cpp b/radio/src/translations/tts_pl.cpp index 9b0bef745..096e81e30 100644 --- a/radio/src/translations/tts_pl.cpp +++ b/radio/src/translations/tts_pl.cpp @@ -239,7 +239,7 @@ I18N_PLAY_FUNCTION(pl, playNumber, getvalue_t number, uint8_t unit, uint8_t att) // The whole funtion has to be changed -I18N_PLAY_FUNCTION(pl, playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(pl, playDuration, int16_t seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(PL_PROMPT_MINUS); @@ -248,7 +248,7 @@ I18N_PLAY_FUNCTION(pl, playDuration, int16_t seconds) uint8_t tmp = seconds / 3600; seconds %= 3600; - if (tmp > 0) { + if (tmp > 0 || IS_PLAY_TIME()) { PLAY_NUMBER(tmp, UNIT_HOURS+1, ZENSKI); } diff --git a/radio/src/translations/tts_pt.cpp b/radio/src/translations/tts_pt.cpp index cee09ac7b..b3c4ce0bd 100644 --- a/radio/src/translations/tts_pt.cpp +++ b/radio/src/translations/tts_pt.cpp @@ -175,7 +175,7 @@ I18N_PLAY_FUNCTION(pt, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(pt, playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(pt, playDuration, int16_t seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(PT_PROMPT_MENOS); @@ -185,7 +185,7 @@ I18N_PLAY_FUNCTION(pt, playDuration, int16_t seconds) uint8_t ore = 0; uint8_t tmp = seconds / 3600; seconds %= 3600; - if (tmp > 0) { + if (tmp > 0 || IS_PLAY_TIME()) { ore=tmp; if (tmp > 2) { PLAY_NUMBER(tmp, 0, 0); diff --git a/radio/src/translations/tts_se.cpp b/radio/src/translations/tts_se.cpp index d8b029d62..df1f6e9f0 100644 --- a/radio/src/translations/tts_se.cpp +++ b/radio/src/translations/tts_se.cpp @@ -141,7 +141,7 @@ I18N_PLAY_FUNCTION(se, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(se, playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(se, playDuration, int16_t seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(SE_PROMPT_MINUS); @@ -150,7 +150,7 @@ I18N_PLAY_FUNCTION(se, playDuration, int16_t seconds) uint8_t tmp = seconds / 3600; seconds %= 3600; - if (tmp > 0) { + if (tmp > 0 || IS_PLAY_TIME()) { PLAY_NUMBER(tmp, UNIT_HOURS+1 , 0); } diff --git a/radio/src/translations/tts_sk.cpp b/radio/src/translations/tts_sk.cpp index 9dc3191c1..2b6951e3f 100644 --- a/radio/src/translations/tts_sk.cpp +++ b/radio/src/translations/tts_sk.cpp @@ -235,7 +235,7 @@ I18N_PLAY_FUNCTION(sk, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(sk, playDuration, int16_t seconds) +I18N_PLAY_FUNCTION(sk, playDuration, int16_t seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(SK_PROMPT_MINUS); @@ -244,7 +244,7 @@ I18N_PLAY_FUNCTION(sk, playDuration, int16_t seconds) uint8_t tmp = seconds / 3600; seconds %= 3600; - if (tmp > 0) { + if (tmp > 0 || IS_PLAY_TIME()) { PLAY_NUMBER(tmp, UNIT_HOURS+1, ZENSKY); } diff --git a/radio/util/tts.py b/radio/util/tts.py index fa44b0b93..74daffc05 100644 --- a/radio/util/tts.py +++ b/radio/util/tts.py @@ -242,7 +242,7 @@ def ttsFr(): systemSounds.append((str(100*(i+1)), filename(PROMPT_SYSTEM_BASE+100+i))) for i, s in enumerate(["une", "onze", "vingt et une", "trente et une", "quarante et une", "cinquante et une", "soixante et une", "soixante et onze", "quatre vingt une"]): systemSounds.append((s, filename(PROMPT_SYSTEM_BASE+110+i))) - for i, s in enumerate(["virgule", "et", "moins"]): + for i, s in enumerate(["virgule", "et", "moins", "minuit", "midi"]): systemSounds.append((s, filename(PROMPT_SYSTEM_BASE+119+i))) for i, s in enumerate(["volts", u"ampères", u"mètres seconde", "", "kilomètre heure", u"mètres", u"degrés", "pourcents", u"milli ampères", u"milli ampères / heure", "watt", "db", "pieds", "miles par heure", "heure", "minute", "seconde", "tours par minute", "g"]): systemSounds.append((s, filename(PROMPT_SYSTEM_BASE+125+i))) From 41571d4a7424c676ee9b577aaef08bd0191698e0 Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 9 May 2014 16:49:43 +0200 Subject: [PATCH 72/79] Fixes #1065 - Companion part --- companion/src/eeprominterface.cpp | 8 ++++++-- companion/src/eeprominterface.h | 1 + companion/src/firmwares/opentx/opentxeeprom.cpp | 6 ++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index b00b7c32c..b6fa058e0 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -109,6 +109,10 @@ RawSourceRange RawSource::getRange(bool singleprec) result.decimals = 1; result.max = 25.5; break; + case TELEMETRY_SOURCE_TX_TIME: + result.step = 1; + result.max = 24*60 - 1; + break; case TELEMETRY_SOURCE_TIMER1: case TELEMETRY_SOURCE_TIMER2: result.step = singleprec ? 5 : 1; @@ -258,7 +262,7 @@ QString RawSource::toString() }; static const QString telemetry[] = { - QObject::tr("Batt"), QObject::tr("Timer1"), QObject::tr("Timer2"), + QObject::tr("Batt"), QObject::tr("Time"), QObject::tr("Timer1"), QObject::tr("Timer2"), QObject::tr("SWR"), QObject::tr("RSSI Tx"), QObject::tr("RSSI Rx"), QObject::tr("Rx Batt"), QObject::tr("A1"), QObject::tr("A2"), QObject::tr("A3"), QObject::tr("A4"), QObject::tr("Alt"), QObject::tr("Rpm"), QObject::tr("Fuel"), QObject::tr("T1"), QObject::tr("T2"), @@ -269,7 +273,7 @@ QString RawSource::toString() QObject::tr("A1-"), QObject::tr("A2-"), QObject::tr("A3-"), QObject::tr("A4-"), QObject::tr("Alt-"), QObject::tr("Alt+"), QObject::tr("Rpm+"), QObject::tr("T1+"), QObject::tr("T2+"), QObject::tr("Speed+"), QObject::tr("Dist+"), QObject::tr("AirSpeed+"), QObject::tr("Cell-"), QObject::tr("Cells-"), QObject::tr("Vfas-"), QObject::tr("Curr+"), QObject::tr("Powr+"), - QObject::tr("ACC"), QObject::tr("Time"), + QObject::tr("ACC"), QObject::tr("GPS Time"), }; static const QString logicalSwitches[] = { diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index 9eb748ffa..4a150066b 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -208,6 +208,7 @@ enum ThrottleSource { enum TelemetrySource { TELEMETRY_SOURCE_TX_BATT, + TELEMETRY_SOURCE_TX_TIME, TELEMETRY_SOURCE_TIMER1, TELEMETRY_SOURCE_TIMER2, TELEMETRY_SOURCE_SWR, diff --git a/companion/src/firmwares/opentx/opentxeeprom.cpp b/companion/src/firmwares/opentx/opentxeeprom.cpp index 5b0ba85b7..1bc8f2dd4 100644 --- a/companion/src/firmwares/opentx/opentxeeprom.cpp +++ b/companion/src/firmwares/opentx/opentxeeprom.cpp @@ -257,15 +257,17 @@ class SourcesConversionTable: public ConversionTable { for (int i=0; i= 216 && IS_ARM(board)) { + if (i==TELEMETRY_SOURCE_TX_TIME) + val += 5; if (i==TELEMETRY_SOURCE_DTE) val += 5; if (i==TELEMETRY_SOURCE_POWER_MAX) From 9a086312c7207a16cf561b27244fd2516ea7946e Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 9 May 2014 17:11:02 +0200 Subject: [PATCH 73/79] Disable TX_TIME when no RTCLOCK on board --- radio/src/gui/menus.cpp | 5 +++++ radio/src/lcd.cpp | 2 +- radio/src/opentx.cpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/menus.cpp b/radio/src/gui/menus.cpp index bd505626f..3defbf524 100644 --- a/radio/src/gui/menus.cpp +++ b/radio/src/gui/menus.cpp @@ -1428,6 +1428,11 @@ bool isTelemetrySourceAvailable(int source) return false; #endif +#if !defined(RTCLOCK) + if (source == TELEM_TX_TIME) + return false; +#endif + if (source >= TELEM_RESERVE1 && source <= TELEM_RESERVE5) return false; diff --git a/radio/src/lcd.cpp b/radio/src/lcd.cpp index cf0d760f7..e205bc300 100644 --- a/radio/src/lcd.cpp +++ b/radio/src/lcd.cpp @@ -1198,7 +1198,7 @@ const pm_uint8_t bchunit_ar[] PROGMEM = { void putsTelemetryChannel(xcoord_t x, uint8_t y, uint8_t channel, lcdint_t val, uint8_t att) { switch (channel) { -#if defined(CPUARM) +#if defined(CPUARM) && defined(RTCLOCK) case TELEM_TX_TIME-1: { gtm t; diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 10af7719f..2ff9554aa 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1298,7 +1298,7 @@ getvalue_t getValue(uint8_t i) #endif else if (i==MIXSRC_FIRST_TELEM-1+TELEM_TX_VOLTAGE) return g_vbat100mV; -#if defined(CPUARM) +#if defined(CPUARM) && defined(RTCLOCK) else if (i==MIXSRC_FIRST_TELEM-1+TELEM_TX_TIME) { struct gtm t; gettime(&t); From c3859dc308a895930ca820cfee47210a0b4cb48c Mon Sep 17 00:00:00 2001 From: bsongis Date: Fri, 9 May 2014 17:26:16 +0200 Subject: [PATCH 74/79] Compilation failure on Sky9x --- radio/src/lcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radio/src/lcd.cpp b/radio/src/lcd.cpp index e205bc300..d03df332a 100644 --- a/radio/src/lcd.cpp +++ b/radio/src/lcd.cpp @@ -866,7 +866,7 @@ void lcdDrawTelemetryTopBar() } #endif -#if defined(PCBTARANIS) +#if defined(CPUARM) && defined(RTCLOCK) void putsTime(xcoord_t x, uint8_t y, struct gtm t, LcdFlags att) { LcdFlags att2 = (att & (INVERS|BLINK)) | LEADING0; From 7de60763e59bd77530eb572bb9cd7ea23cffeeec Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sat, 10 May 2014 20:08:03 +0200 Subject: [PATCH 75/79] Update DONATIONS.txt --- DONATIONS.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DONATIONS.txt b/DONATIONS.txt index 827c8627e..dd2baaefd 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -395,3 +395,5 @@ Christoph Schroeter Zdenek Trojanek Bryan Anderson Kamco Enterprises +Robert Bates + From 071890d90014ce461c92f3fa08adc39de2b39547 Mon Sep 17 00:00:00 2001 From: bsongis Date: Sat, 10 May 2014 20:19:27 +0200 Subject: [PATCH 76/79] PlayFunction Time was playing negative values (int16_t overflow) --- radio/src/translations.h | 6 +++--- radio/src/translations/tts_cz.cpp | 2 +- radio/src/translations/tts_de.cpp | 2 +- radio/src/translations/tts_en.cpp | 2 +- radio/src/translations/tts_es.cpp | 2 +- radio/src/translations/tts_fr.cpp | 4 ++-- radio/src/translations/tts_it.cpp | 2 +- radio/src/translations/tts_pl.cpp | 2 +- radio/src/translations/tts_pt.cpp | 2 +- radio/src/translations/tts_se.cpp | 2 +- radio/src/translations/tts_sk.cpp | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/radio/src/translations.h b/radio/src/translations.h index 952c6aad5..69207f82d 100644 --- a/radio/src/translations.h +++ b/radio/src/translations.h @@ -626,7 +626,7 @@ extern const pm_char STR_EEBACKUP[]; const char *id; const char *name; void (*playNumber)(getvalue_t number, uint8_t unit, uint8_t flags, uint8_t id); - void (*playDuration)(int16_t seconds, uint8_t flags, uint8_t id); + void (*playDuration)(int seconds, uint8_t flags, uint8_t id); }; extern LanguagePack * languagePacks[]; extern LanguagePack * currentLanguagePack; @@ -634,10 +634,10 @@ extern const pm_char STR_EEBACKUP[]; #define LANGUAGE_PACK_DECLARE(lng, name) LanguagePack lng ## LanguagePack = { #lng, name, lng ## _ ## playNumber, lng ## _ ## playDuration } #define LANGUAGE_PACK_DECLARE_DEFAULT(lng, name) LANGUAGE_PACK_DECLARE(lng, name); LanguagePack * currentLanguagePack = & lng ## LanguagePack; uint8_t currentLanguagePackIdx inline PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t flags) { currentLanguagePack->playNumber(number, unit, flags, id); } - inline PLAY_FUNCTION(playDuration, int16_t seconds, uint8_t flags) { currentLanguagePack->playDuration(seconds, flags, id); } + inline PLAY_FUNCTION(playDuration, int seconds, uint8_t flags) { currentLanguagePack->playDuration(seconds, flags, id); } #elif defined(VOICE) PLAY_FUNCTION(playNumber, getvalue_t number, uint8_t unit, uint8_t att); - PLAY_FUNCTION(playDuration, int16_t seconds); + PLAY_FUNCTION(playDuration, int seconds); #define LANGUAGE_PACK_DECLARE(lng, name) #define LANGUAGE_PACK_DECLARE_DEFAULT(lng, name) #else diff --git a/radio/src/translations/tts_cz.cpp b/radio/src/translations/tts_cz.cpp index 9440c725b..34198b0d4 100644 --- a/radio/src/translations/tts_cz.cpp +++ b/radio/src/translations/tts_cz.cpp @@ -219,7 +219,7 @@ I18N_PLAY_FUNCTION(cz, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(cz, playDuration, int16_t seconds PLAY_DURATION_ATT) +I18N_PLAY_FUNCTION(cz, playDuration, int seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(CZ_PROMPT_MINUS); diff --git a/radio/src/translations/tts_de.cpp b/radio/src/translations/tts_de.cpp index bb7e88f08..c32a1e937 100644 --- a/radio/src/translations/tts_de.cpp +++ b/radio/src/translations/tts_de.cpp @@ -168,7 +168,7 @@ I18N_PLAY_FUNCTION(de, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(de, playDuration, int16_t seconds PLAY_DURATION_ATT) +I18N_PLAY_FUNCTION(de, playDuration, int seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(DE_PROMPT_MINUS); diff --git a/radio/src/translations/tts_en.cpp b/radio/src/translations/tts_en.cpp index 8d30536d7..5bf788b04 100644 --- a/radio/src/translations/tts_en.cpp +++ b/radio/src/translations/tts_en.cpp @@ -151,7 +151,7 @@ I18N_PLAY_FUNCTION(en, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(en, playDuration, int16_t seconds PLAY_DURATION_ATT) +I18N_PLAY_FUNCTION(en, playDuration, int seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(EN_PROMPT_MINUS); diff --git a/radio/src/translations/tts_es.cpp b/radio/src/translations/tts_es.cpp index c0993e16d..b77972c35 100644 --- a/radio/src/translations/tts_es.cpp +++ b/radio/src/translations/tts_es.cpp @@ -190,7 +190,7 @@ I18N_PLAY_FUNCTION(es, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(es, playDuration, int16_t seconds PLAY_DURATION_ATT) +I18N_PLAY_FUNCTION(es, playDuration, int seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(ES_PROMPT_MENO); diff --git a/radio/src/translations/tts_fr.cpp b/radio/src/translations/tts_fr.cpp index 31ede7b62..78d7beb28 100644 --- a/radio/src/translations/tts_fr.cpp +++ b/radio/src/translations/tts_fr.cpp @@ -176,7 +176,7 @@ I18N_PLAY_FUNCTION(fr, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(fr, playDuration, int16_t seconds PLAY_DURATION_ATT) +I18N_PLAY_FUNCTION(fr, playDuration, int seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(FR_PROMPT_MOINS); @@ -210,7 +210,7 @@ I18N_PLAY_FUNCTION(fr, playDuration, int16_t seconds PLAY_DURATION_ATT) } } - if (seconds > 0) { + if (!IS_PLAY_TIME() && seconds > 0) { PLAY_NUMBER(seconds, 0, FEMININ); PUSH_NUMBER_PROMPT(FR_PROMPT_SECONDE); } diff --git a/radio/src/translations/tts_it.cpp b/radio/src/translations/tts_it.cpp index 45630cdda..a6a0dfedd 100644 --- a/radio/src/translations/tts_it.cpp +++ b/radio/src/translations/tts_it.cpp @@ -164,7 +164,7 @@ I18N_PLAY_FUNCTION(it, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(it, playDuration, int16_t seconds PLAY_DURATION_ATT) +I18N_PLAY_FUNCTION(it, playDuration, int seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(IT_PROMPT_MENO); diff --git a/radio/src/translations/tts_pl.cpp b/radio/src/translations/tts_pl.cpp index 096e81e30..949ff6ba2 100644 --- a/radio/src/translations/tts_pl.cpp +++ b/radio/src/translations/tts_pl.cpp @@ -239,7 +239,7 @@ I18N_PLAY_FUNCTION(pl, playNumber, getvalue_t number, uint8_t unit, uint8_t att) // The whole funtion has to be changed -I18N_PLAY_FUNCTION(pl, playDuration, int16_t seconds PLAY_DURATION_ATT) +I18N_PLAY_FUNCTION(pl, playDuration, int seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(PL_PROMPT_MINUS); diff --git a/radio/src/translations/tts_pt.cpp b/radio/src/translations/tts_pt.cpp index b3c4ce0bd..c00553bef 100644 --- a/radio/src/translations/tts_pt.cpp +++ b/radio/src/translations/tts_pt.cpp @@ -175,7 +175,7 @@ I18N_PLAY_FUNCTION(pt, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(pt, playDuration, int16_t seconds PLAY_DURATION_ATT) +I18N_PLAY_FUNCTION(pt, playDuration, int seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(PT_PROMPT_MENOS); diff --git a/radio/src/translations/tts_se.cpp b/radio/src/translations/tts_se.cpp index df1f6e9f0..82b362908 100644 --- a/radio/src/translations/tts_se.cpp +++ b/radio/src/translations/tts_se.cpp @@ -141,7 +141,7 @@ I18N_PLAY_FUNCTION(se, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(se, playDuration, int16_t seconds PLAY_DURATION_ATT) +I18N_PLAY_FUNCTION(se, playDuration, int seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(SE_PROMPT_MINUS); diff --git a/radio/src/translations/tts_sk.cpp b/radio/src/translations/tts_sk.cpp index 2b6951e3f..2fd673b32 100644 --- a/radio/src/translations/tts_sk.cpp +++ b/radio/src/translations/tts_sk.cpp @@ -235,7 +235,7 @@ I18N_PLAY_FUNCTION(sk, playNumber, getvalue_t number, uint8_t unit, uint8_t att) } } -I18N_PLAY_FUNCTION(sk, playDuration, int16_t seconds PLAY_DURATION_ATT) +I18N_PLAY_FUNCTION(sk, playDuration, int seconds PLAY_DURATION_ATT) { if (seconds < 0) { PUSH_NUMBER_PROMPT(SK_PROMPT_MINUS); From 3a2e9e7c2e94ad6774da38702a596f4a9530c194 Mon Sep 17 00:00:00 2001 From: bsongis Date: Sat, 10 May 2014 23:30:28 +0200 Subject: [PATCH 77/79] Fixes #1074 --- companion/src/modeledit/customfunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/companion/src/modeledit/customfunctions.cpp b/companion/src/modeledit/customfunctions.cpp index c95d34d6e..f334b899a 100644 --- a/companion/src/modeledit/customfunctions.cpp +++ b/companion/src/modeledit/customfunctions.cpp @@ -666,7 +666,7 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, const ModelData & m else if (function>=FuncAdjustGV1 && function<=FuncAdjustGVLast) { switch (adjustmode) { case 1: - populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_TRIMS|POPULATE_SWITCHES); + populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_TRIMS|POPULATE_SWITCHES); break; case 2: populateSourceCB(b, RawSource(value), model, POPULATE_GVARS); From ba1116b00069b511610377c27c715daca35038b6 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sun, 11 May 2014 09:10:06 +0200 Subject: [PATCH 78/79] Update DONATIONS.txt --- DONATIONS.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DONATIONS.txt b/DONATIONS.txt index dd2baaefd..5764c0341 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -396,4 +396,4 @@ Zdenek Trojanek Bryan Anderson Kamco Enterprises Robert Bates - +Robert Brown From cfd4aa73a085551034249536d66307be9ba7a2b9 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sun, 11 May 2014 09:21:23 +0200 Subject: [PATCH 79/79] Update DONATIONS.txt --- DONATIONS.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DONATIONS.txt b/DONATIONS.txt index 5764c0341..f52677c10 100644 --- a/DONATIONS.txt +++ b/DONATIONS.txt @@ -332,7 +332,7 @@ Steve Coley Sean Cull Roberto Orsello David Finger -FrSky - www.frsky-rc.com +FrSky - www.frsky-rc.com (monthly) Jean-Marie Oddo Mike Matheny Glen Roe (Showmaster)