diff --git a/companion/releasenotes.txt b/companion/releasenotes.txt index f25dd8e56..f561519f2 100644 --- a/companion/releasenotes.txt +++ b/companion/releasenotes.txt @@ -13,6 +13,7 @@ Notice: version 2.1.4 was sipped by the OpenTX team to avoid confusion with the
  • Fixed wrong import of Logical switches from OpenTX 2.0.x version (#2942)
  • Fixed a problem with updates path on Windows (#2876)
  • Edge representation unified (changed from "no release" to "instant") (#2837)
  • +
  • Added channel names on failsafe sliders (#3021)
  • Corrected failsafe mapping when using Custom failsafe mode, D16 protocol and channel range different from from 1-8. Users with such setups are advised to re-check their failsafe settings (#2975)
  • Various texts and translations corrections
  • diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index e5666ac46..92f942e51 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -1300,7 +1300,6 @@ enum Capability { HasExpoNames, HasNoExpo, HasMixerNames, - HasChNames, HasCvNames, HasPxxCountry, HasPPMStart, diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index 3009b37a6..af13ef8be 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -578,8 +578,6 @@ int OpenTxFirmware::getCapability(const Capability capability) return (IS_TARANIS(board) ? 10 : 6); case GvarsName: return (IS_9X(board) ? 0 : 6); - case HasChNames: - return (IS_TARANIS(board) ? 1 : 0); case GvarsInCS: case HasFAIMode: return 1; diff --git a/companion/src/modeledit/setup.cpp b/companion/src/modeledit/setup.cpp index 335e8bec3..f15827ddb 100644 --- a/companion/src/modeledit/setup.cpp +++ b/companion/src/modeledit/setup.cpp @@ -193,12 +193,12 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module spinbox->setDecimals(1); label->setProperty("index", i); spinbox->setProperty("index", i); - failsafeSpins << spinbox; ui->failsafesLayout->addWidget(label, 3*(i/8), i%8, Qt::AlignHCenter); ui->failsafesLayout->addWidget(combo, 1+3*(i/8), i%8, Qt::AlignHCenter); ui->failsafesLayout->addWidget(spinbox, 2+3*(i/8), i%8, Qt::AlignHCenter); failsafeGroups[i].combo = combo; failsafeGroups[i].spinbox = spinbox; + failsafeGroups[i].label = label; updateFailsafe(i); connect(combo, SIGNAL(currentIndexChanged(int)), this, SLOT(onFailsafeComboIndexChanged(int))); connect(spinbox, SIGNAL(valueChanged(double)), this, SLOT(onFailsafeSpinChanged(double))); @@ -302,6 +302,14 @@ void ModulePanel::update() ui->failsafeMode->setVisible(mask & MASK_FAILSAFES); ui->failsafeMode->setCurrentIndex(module.failsafeMode); ui->failsafesFrame->setEnabled(module.failsafeMode == FAILSAFE_CUSTOM); + if (firmware->getCapability(ChannelsName) > 0) { + for(int i=0; ilimitData[i+module.channelsStart].name).trimmed(); + if (!name.isEmpty()) { + failsafeGroups[i].label->setText(name); + } + } + } } else { mask = 0; diff --git a/companion/src/modeledit/setup.h b/companion/src/modeledit/setup.h index 2f732be1a..0e4c9d7f8 100644 --- a/companion/src/modeledit/setup.h +++ b/companion/src/modeledit/setup.h @@ -45,6 +45,7 @@ class ModulePanel : public ModelPanel struct ChannelFailsafeWidgetsGroup { QComboBox * combo; QDoubleSpinBox * spinbox; + QLabel * label; }; Q_OBJECT @@ -75,7 +76,6 @@ class ModulePanel : public ModelPanel ModuleData & module; int moduleIdx; Ui::Module *ui; - QVector failsafeSpins; ChannelFailsafeWidgetsGroup failsafeGroups[maxChannels]; }; diff --git a/companion/src/modelprinter.cpp b/companion/src/modelprinter.cpp index fd4c851ab..31d73dbdb 100644 --- a/companion/src/modelprinter.cpp +++ b/companion/src/modelprinter.cpp @@ -57,7 +57,7 @@ QString ModelPrinter::printChannelName(int idx) QString ModelPrinter::printOutputName(int idx) { QString name = QString(model.limitData[idx].name).trimmed(); - if (firmware->getCapability(HasChNames) && !name.isEmpty()) { + if (firmware->getCapability(ChannelsName) > 0 && !name.isEmpty()) { return name; } else { @@ -313,7 +313,7 @@ QString ModelPrinter::printInputLine(const ExpoData & input) QString ModelPrinter::printMixerName(int curDest) { QString str = printChannelName(curDest-1) + " "; - if (firmware->getCapability(HasChNames)) { + if (firmware->getCapability(ChannelsName) > 0) { QString name = model.limitData[curDest-1].name; if (!name.isEmpty()) { name = QString("(") + name + QString(")"); diff --git a/companion/src/multimodelprinter.cpp b/companion/src/multimodelprinter.cpp index c559967f7..2b126282e 100644 --- a/companion/src/multimodelprinter.cpp +++ b/companion/src/multimodelprinter.cpp @@ -270,7 +270,7 @@ QString MultiModelPrinter::printLimits() columns.append("" \ "" \ " " \ - " " \ + " " \ " " \ " " \ " " \
    " + tr("Channel") + "" + (firmware->getCapability(HasChNames) ? tr("Name") : "") + "" + (firmware->getCapability(ChannelsName) > 0 ? tr("Name") : "") + "" + tr("Offset") + "" + tr("Min") + "" + tr("Max") + "