diff --git a/companion/src/comparedialog.cpp b/companion/src/comparedialog.cpp index e93ded239..5ec3a277b 100644 --- a/companion/src/comparedialog.cpp +++ b/companion/src/comparedialog.cpp @@ -256,13 +256,10 @@ void CompareDialog::printSetup() str.append(fv(tr("Pulse Polarity"), g_model1->moduleData[0].polarityToString(), color)); color=getColor1(g_model1->thrTrim,g_model2->thrTrim); str.append(fv(tr("Throttle Trim"), g_model1->thrTrim ? tr("Enabled") : tr("Disabled"), color)); - color=getColor1(g_model1->thrExpo,g_model2->thrExpo); - str.append(fv(tr("Throttle Expo"), g_model1->thrExpo ? tr("Enabled") : tr("Disabled"),color)); - // TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw))); color=getColor1(getTrimInc(g_model1),getTrimInc(g_model2)); str.append(fv(tr("Trim Increment"), getTrimInc(g_model1),color)); - color=getColor1(getCenterBeep(g_model1),getCenterBeep(g_model2)); - str.append(fv(tr("Center Beep"), getCenterBeep(g_model1),color)); // specify which channels beep + color = getColor1(getCenterBeepStr(g_model1), getCenterBeepStr(g_model2)); + str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model1), color)); // specify which channels beep str.append(""); str.append(""); color=getColor2(g_model1->name,g_model2->name); @@ -279,13 +276,10 @@ void CompareDialog::printSetup() str.append(fv(tr("Pulse Polarity"), g_model2->moduleData[0].polarityToString(), color)); color=getColor2(g_model1->thrTrim,g_model2->thrTrim); str.append(fv(tr("Throttle Trim"), g_model2->thrTrim ? tr("Enabled") : tr("Disabled"), color)); - color=getColor2(g_model1->thrExpo,g_model2->thrExpo); - str.append(fv(tr("Throttle Expo"), g_model2->thrExpo ? tr("Enabled") : tr("Disabled"),color)); - // TODO str.append(fv(tr("Trim Switch"), getSWName(g_model->trimSw))); color=getColor2(getTrimInc(g_model1),getTrimInc(g_model2)); str.append(fv(tr("Trim Increment"), getTrimInc(g_model2),color)); - color=getColor2(getCenterBeep(g_model1),getCenterBeep(g_model2)); - str.append(fv(tr("Center Beep"), getCenterBeep(g_model2),color)); // specify which channels beep + color = getColor2(getCenterBeepStr(g_model1),getCenterBeepStr(g_model2)); + str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model2), color)); // specify which channels beep str.append("
"); te->append(str); } diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index 3e8005b0f..639f7d8df 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -919,7 +919,6 @@ class TimerData { RawSwitch mode; bool minuteBeep; unsigned int countdownBeep; - bool dir; // 0=>Count Down, 1=>Count Up unsigned int val; unsigned int persistent; int pvalue; @@ -986,7 +985,6 @@ class ModelData { char name[12+1]; TimerData timers[2]; bool thrTrim; // Enable Throttle Trim - bool thrExpo; // Enable Throttle Expo int trimInc; // Trim Increments bool disableThrottleWarning; diff --git a/companion/src/firmwares/er9x/er9xeeprom.cpp b/companion/src/firmwares/er9x/er9xeeprom.cpp index 1175c986b..53aaf19c2 100644 --- a/companion/src/firmwares/er9x/er9xeeprom.cpp +++ b/companion/src/firmwares/er9x/er9xeeprom.cpp @@ -358,7 +358,6 @@ t_Er9xModelData::operator ModelData () c9x.used = true; getEEPROMString(c9x.name, name, sizeof(name)); c9x.timers[0].mode = getEr9xTimerMode(tmrMode); - c9x.timers[0].dir = tmrDir; c9x.timers[0].val = tmrVal; switch(protocol) { case 1: @@ -377,7 +376,6 @@ t_Er9xModelData::operator ModelData () c9x.moduleData[0].ppmFrameLength=ppmFrameLength; c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH; c9x.thrTrim = thrTrim; - c9x.thrExpo = thrExpo; c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.funcSw[0].func = FuncInstantTrim; diff --git a/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp b/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp index a86e3f244..3c557d2f5 100644 --- a/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp +++ b/companion/src/firmwares/ersky9x/ersky9xeeprom.cpp @@ -489,7 +489,6 @@ t_Ersky9xModelData_v10::operator ModelData () getEEPROMString(c9x.name, name, sizeof(name)); for (int i=0; i<2; i++) { c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA); - c9x.timers[i].dir = timer[i].tmrDir; c9x.timers[i].val = timer[i].tmrVal; } switch(protocol) { @@ -509,7 +508,6 @@ t_Ersky9xModelData_v10::operator ModelData () c9x.moduleData[0].ppmFrameLength=ppmFrameLength; c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH; c9x.thrTrim = thrTrim; - c9x.thrExpo = thrExpo; c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.funcSw[0].func = FuncInstantTrim; @@ -607,7 +605,6 @@ t_Ersky9xModelData_v11::operator ModelData () getEEPROMString(c9x.name, name, sizeof(name)); for (int i=0; i<2; i++) { c9x.timers[i].mode = getErSky9xTimerMode(timer[i].tmrModeA); - c9x.timers[i].dir = timer[i].tmrDir; c9x.timers[i].val = timer[i].tmrVal; } switch(protocol) { @@ -627,7 +624,6 @@ t_Ersky9xModelData_v11::operator ModelData () c9x.moduleData[0].ppmFrameLength=ppmFrameLength; c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH; c9x.thrTrim = thrTrim; - c9x.thrExpo = thrExpo; c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.funcSw[0].func = FuncInstantTrim; diff --git a/companion/src/firmwares/gruvin9x/gruvin9xeeprom.cpp b/companion/src/firmwares/gruvin9x/gruvin9xeeprom.cpp index 617cc3566..52f276989 100644 --- a/companion/src/firmwares/gruvin9x/gruvin9xeeprom.cpp +++ b/companion/src/firmwares/gruvin9x/gruvin9xeeprom.cpp @@ -378,7 +378,6 @@ t_Gruvin9xTimerData::operator TimerData () TimerData c9x; c9x.mode = getEr9xTimerMode(mode); c9x.val = val; - c9x.dir = dir; return c9x; } @@ -447,7 +446,6 @@ t_Gruvin9xModelData_v102::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.thrExpo = thrExpo; c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; @@ -518,7 +516,6 @@ t_Gruvin9xModelData_v103::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.thrExpo = thrExpo; c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; @@ -589,7 +586,6 @@ t_Gruvin9xModelData_v105::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.thrExpo = thrExpo; c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; @@ -680,7 +676,6 @@ t_Gruvin9xModelData_v106::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.thrExpo = thrExpo; c9x.trimInc = trimInc-2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; diff --git a/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp b/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp index 249c2b6ce..6824d2c36 100644 --- a/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp +++ b/companion/src/firmwares/opentx/open9xSky9xeeprom.cpp @@ -138,7 +138,6 @@ t_Open9xArmTimerData_v202::operator TimerData () */ c9x.val = val; c9x.persistent = false; - c9x.dir = (val == 0); return c9x; } diff --git a/companion/src/firmwares/opentx/open9xStockeeprom.cpp b/companion/src/firmwares/opentx/open9xStockeeprom.cpp index a6a06e7cc..eb60a88cb 100644 --- a/companion/src/firmwares/opentx/open9xStockeeprom.cpp +++ b/companion/src/firmwares/opentx/open9xStockeeprom.cpp @@ -704,7 +704,6 @@ t_Open9xTimerData_v201::operator TimerData () // c9x.mode = TMRMODE_OFF; c9x.val = val; c9x.persistent = persistent; - c9x.dir = dir; return c9x; } @@ -725,7 +724,6 @@ t_Open9xTimerData_v202::operator TimerData () */ c9x.val = val; c9x.persistent = false; - c9x.dir = (val == 0); return c9x; } @@ -939,7 +937,6 @@ t_Open9xModelData_v201::operator ModelData () } c9x.moduleData[0].channelsCount = 8 + (2 * ppmNCH); c9x.thrTrim = thrTrim; - c9x.thrExpo = thrExpo; c9x.trimInc = trimInc - 2; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.beepANACenter = beepANACenter; diff --git a/companion/src/firmwares/th9x/th9xeeprom.cpp b/companion/src/firmwares/th9x/th9xeeprom.cpp index b6bd0c02b..af804001f 100644 --- a/companion/src/firmwares/th9x/th9xeeprom.cpp +++ b/companion/src/firmwares/th9x/th9xeeprom.cpp @@ -272,7 +272,6 @@ t_Th9xModelData::operator ModelData () /*c9x.protocol = (Protocol)protocol; c9x.moduleData[0].channelsCount = 8 + 2 * ppmNCH; c9x.thrTrim = thrTrim; - c9x.thrExpo = thrExpo; c9x.trimInc = trimInc; c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay; c9x.funcSw[0].func = FuncTrims2Offsets; diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp index 1949aca83..4111fb14f 100644 --- a/companion/src/helpers.cpp +++ b/companion/src/helpers.cpp @@ -789,19 +789,35 @@ QString getFrSkySrc(int index) QString getTrimInc(ModelData * g_model) { - switch (g_model->trimInc) { - case (1): return QObject::tr("Extra Fine"); - case (2): return QObject::tr("Fine"); - case (3): return QObject::tr("Medium"); - case (4): return QObject::tr("Coarse"); - default: return QObject::tr("Exponential"); - } + switch (g_model->trimInc) { + case -2: + return QObject::tr("Exponential"); + case -1: + return QObject::tr("Extra Fine"); + case 0: + return QObject::tr("Fine"); + case 1: + return QObject::tr("Medium"); + case 2: + return QObject::tr("Coarse"); + default: + return QObject::tr("Unknown"); + } } QString getTimerStr(TimerData & timer) { - QString str = ", " + (timer.dir ? QObject::tr("Count Up") : QObject::tr("Count Down")); - return QObject::tr("%1:%2, ").arg(timer.val/60, 2, 10, QChar('0')).arg(timer.val%60, 2, 10, QChar('0')) + timer.mode.toString() + str; + QString result = QObject::tr("%1:%2").arg(timer.val/60, 2, 10, QChar('0')).arg(timer.val%60, 2, 10, QChar('0')); + result += QString(", ") + timer.mode.toString(); + if (timer.persistent) + result += QObject::tr(", Persistent"); + if (timer.minuteBeep) + result += QObject::tr(", MinuteBeep"); + if (timer.countdownBeep == 1) + result += QObject::tr(", CountDown(Beeps)"); + else if (timer.countdownBeep == 2) + result += QObject::tr(", CountDown(Voice)"); + return result; } QString getProtocol(ModelData * g_model) @@ -842,18 +858,37 @@ QString getPhasesStr(unsigned int phases, ModelData & model) } } -QString getCenterBeep(ModelData * g_model) +QString getCenterBeepStr(ModelData * g_model) { - //RETA123 QStringList strl; - if(g_model->beepANACenter & 0x01) strl << QObject::tr("Rudder"); - if(g_model->beepANACenter & 0x02) strl << QObject::tr("Elevator"); - if(g_model->beepANACenter & 0x04) strl << QObject::tr("Throttle"); - if(g_model->beepANACenter & 0x08) strl << QObject::tr("Aileron"); - if(g_model->beepANACenter & 0x10) strl << "P1"; - if(g_model->beepANACenter & 0x20) strl << "P2"; - if(g_model->beepANACenter & 0x40) strl << "P3"; - if(g_model->beepANACenter & 0x80) strl << "LS"; + if (g_model->beepANACenter & 0x01) + strl << QObject::tr("Rudder"); + if (g_model->beepANACenter & 0x02) + strl << QObject::tr("Elevator"); + if (g_model->beepANACenter & 0x04) + strl << QObject::tr("Throttle"); + if (g_model->beepANACenter & 0x08) + strl << QObject::tr("Aileron"); + if (IS_TARANIS(GetCurrentFirmware()->getBoard())) { + if (g_model->beepANACenter & 0x10) + strl << "S1"; + if (g_model->beepANACenter & 0x20) + strl << "S2"; + if (g_model->beepANACenter & 0x40) + strl << "S3"; + if (g_model->beepANACenter & 0x80) + strl << "LS"; + if (g_model->beepANACenter & 0x100) + strl << "RS"; + } + else { + if (g_model->beepANACenter & 0x10) + strl << "P1"; + if (g_model->beepANACenter & 0x20) + strl << "P2"; + if (g_model->beepANACenter & 0x40) + strl << "P3"; + } return strl.join(", "); } diff --git a/companion/src/helpers.h b/companion/src/helpers.h index a135dc2d8..888735db9 100644 --- a/companion/src/helpers.h +++ b/companion/src/helpers.h @@ -114,7 +114,7 @@ int findmult(float value, float base); QString getTrimInc(ModelData * g_model); QString getTimerStr(TimerData & timer); QString getProtocol(ModelData * g_model); -QString getCenterBeep(ModelData * g_model); +QString getCenterBeepStr(ModelData * g_model); /* FrSky helpers */ QString getFrSkyAlarmType(int alarm); diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index 75593882d..15b208b88 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -116,10 +116,8 @@ void PrintDialog::printSetup() str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay, str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].polarityToString())); 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(fv(tr("Center Beep"), getCenterBeepStr(g_model))); // specify which channels beep str.append(""); if (!gvars) { str.append(""); diff --git a/companion/src/xmlinterface.cpp b/companion/src/xmlinterface.cpp index 33865d2d0..14f90d863 100644 --- a/companion/src/xmlinterface.cpp +++ b/companion/src/xmlinterface.cpp @@ -136,7 +136,6 @@ void saveModel(ModelData & m, model & xm) trims xtrims; xtrims.extended(m.extendedTrims); xtrims.throttleTrim(m.thrTrim); - xtrims.throttleTrimExpo(m.thrExpo); xm.trims(xtrims); } if (m.beepANACenter) {