Add channel names on companion failsafe sliders (fix #3021), remove redundant stuff
This commit is contained in:
@@ -13,6 +13,7 @@ Notice: version 2.1.4 was sipped by the OpenTX team to avoid confusion with the
|
|||||||
<li>Fixed wrong import of Logical switches from OpenTX 2.0.x version (<a href=https://github.com/opentx/opentx/issues/2942>#2942</a>)</li>
|
<li>Fixed wrong import of Logical switches from OpenTX 2.0.x version (<a href=https://github.com/opentx/opentx/issues/2942>#2942</a>)</li>
|
||||||
<li>Fixed a problem with updates path on Windows (<a href=https://github.com/opentx/opentx/issues/2876>#2876</a>)</li>
|
<li>Fixed a problem with updates path on Windows (<a href=https://github.com/opentx/opentx/issues/2876>#2876</a>)</li>
|
||||||
<li>Edge representation unified (changed from "no release" to "instant") (<a href=https://github.com/opentx/opentx/issues/2837>#2837</a>)</li>
|
<li>Edge representation unified (changed from "no release" to "instant") (<a href=https://github.com/opentx/opentx/issues/2837>#2837</a>)</li>
|
||||||
|
<li>Added channel names on failsafe sliders (<a href=https://github.com/opentx/opentx/issues/3021>#3021</a>)</li>
|
||||||
<li>Corrected failsafe mapping when using Custom failsafe mode, D16 protocol and channel range different from from 1-8.
|
<li>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 (<a href=https://github.com/opentx/opentx/issues/2975>#2975</a>)</li>
|
Users with such setups are advised to re-check their failsafe settings (<a href=https://github.com/opentx/opentx/issues/2975>#2975</a>)</li>
|
||||||
<li>Various texts and translations corrections</li>
|
<li>Various texts and translations corrections</li>
|
||||||
|
|||||||
@@ -1300,7 +1300,6 @@ enum Capability {
|
|||||||
HasExpoNames,
|
HasExpoNames,
|
||||||
HasNoExpo,
|
HasNoExpo,
|
||||||
HasMixerNames,
|
HasMixerNames,
|
||||||
HasChNames,
|
|
||||||
HasCvNames,
|
HasCvNames,
|
||||||
HasPxxCountry,
|
HasPxxCountry,
|
||||||
HasPPMStart,
|
HasPPMStart,
|
||||||
|
|||||||
@@ -578,8 +578,6 @@ int OpenTxFirmware::getCapability(const Capability capability)
|
|||||||
return (IS_TARANIS(board) ? 10 : 6);
|
return (IS_TARANIS(board) ? 10 : 6);
|
||||||
case GvarsName:
|
case GvarsName:
|
||||||
return (IS_9X(board) ? 0 : 6);
|
return (IS_9X(board) ? 0 : 6);
|
||||||
case HasChNames:
|
|
||||||
return (IS_TARANIS(board) ? 1 : 0);
|
|
||||||
case GvarsInCS:
|
case GvarsInCS:
|
||||||
case HasFAIMode:
|
case HasFAIMode:
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -193,12 +193,12 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
|
|||||||
spinbox->setDecimals(1);
|
spinbox->setDecimals(1);
|
||||||
label->setProperty("index", i);
|
label->setProperty("index", i);
|
||||||
spinbox->setProperty("index", i);
|
spinbox->setProperty("index", i);
|
||||||
failsafeSpins << spinbox;
|
|
||||||
ui->failsafesLayout->addWidget(label, 3*(i/8), i%8, Qt::AlignHCenter);
|
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(combo, 1+3*(i/8), i%8, Qt::AlignHCenter);
|
||||||
ui->failsafesLayout->addWidget(spinbox, 2+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].combo = combo;
|
||||||
failsafeGroups[i].spinbox = spinbox;
|
failsafeGroups[i].spinbox = spinbox;
|
||||||
|
failsafeGroups[i].label = label;
|
||||||
updateFailsafe(i);
|
updateFailsafe(i);
|
||||||
connect(combo, SIGNAL(currentIndexChanged(int)), this, SLOT(onFailsafeComboIndexChanged(int)));
|
connect(combo, SIGNAL(currentIndexChanged(int)), this, SLOT(onFailsafeComboIndexChanged(int)));
|
||||||
connect(spinbox, SIGNAL(valueChanged(double)), this, SLOT(onFailsafeSpinChanged(double)));
|
connect(spinbox, SIGNAL(valueChanged(double)), this, SLOT(onFailsafeSpinChanged(double)));
|
||||||
@@ -302,6 +302,14 @@ void ModulePanel::update()
|
|||||||
ui->failsafeMode->setVisible(mask & MASK_FAILSAFES);
|
ui->failsafeMode->setVisible(mask & MASK_FAILSAFES);
|
||||||
ui->failsafeMode->setCurrentIndex(module.failsafeMode);
|
ui->failsafeMode->setCurrentIndex(module.failsafeMode);
|
||||||
ui->failsafesFrame->setEnabled(module.failsafeMode == FAILSAFE_CUSTOM);
|
ui->failsafesFrame->setEnabled(module.failsafeMode == FAILSAFE_CUSTOM);
|
||||||
|
if (firmware->getCapability(ChannelsName) > 0) {
|
||||||
|
for(int i=0; i<maxChannels;i++) {
|
||||||
|
QString name = QString(model->limitData[i+module.channelsStart].name).trimmed();
|
||||||
|
if (!name.isEmpty()) {
|
||||||
|
failsafeGroups[i].label->setText(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mask = 0;
|
mask = 0;
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ class ModulePanel : public ModelPanel
|
|||||||
struct ChannelFailsafeWidgetsGroup {
|
struct ChannelFailsafeWidgetsGroup {
|
||||||
QComboBox * combo;
|
QComboBox * combo;
|
||||||
QDoubleSpinBox * spinbox;
|
QDoubleSpinBox * spinbox;
|
||||||
|
QLabel * label;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -75,7 +76,6 @@ class ModulePanel : public ModelPanel
|
|||||||
ModuleData & module;
|
ModuleData & module;
|
||||||
int moduleIdx;
|
int moduleIdx;
|
||||||
Ui::Module *ui;
|
Ui::Module *ui;
|
||||||
QVector<QDoubleSpinBox *> failsafeSpins;
|
|
||||||
ChannelFailsafeWidgetsGroup failsafeGroups[maxChannels];
|
ChannelFailsafeWidgetsGroup failsafeGroups[maxChannels];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ QString ModelPrinter::printChannelName(int idx)
|
|||||||
QString ModelPrinter::printOutputName(int idx)
|
QString ModelPrinter::printOutputName(int idx)
|
||||||
{
|
{
|
||||||
QString name = QString(model.limitData[idx].name).trimmed();
|
QString name = QString(model.limitData[idx].name).trimmed();
|
||||||
if (firmware->getCapability(HasChNames) && !name.isEmpty()) {
|
if (firmware->getCapability(ChannelsName) > 0 && !name.isEmpty()) {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -313,7 +313,7 @@ QString ModelPrinter::printInputLine(const ExpoData & input)
|
|||||||
QString ModelPrinter::printMixerName(int curDest)
|
QString ModelPrinter::printMixerName(int curDest)
|
||||||
{
|
{
|
||||||
QString str = printChannelName(curDest-1) + " ";
|
QString str = printChannelName(curDest-1) + " ";
|
||||||
if (firmware->getCapability(HasChNames)) {
|
if (firmware->getCapability(ChannelsName) > 0) {
|
||||||
QString name = model.limitData[curDest-1].name;
|
QString name = model.limitData[curDest-1].name;
|
||||||
if (!name.isEmpty()) {
|
if (!name.isEmpty()) {
|
||||||
name = QString("(") + name + QString(")");
|
name = QString("(") + name + QString(")");
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ QString MultiModelPrinter::printLimits()
|
|||||||
columns.append("<table border='0' cellspacing='0' cellpadding='1' width='100%'>" \
|
columns.append("<table border='0' cellspacing='0' cellpadding='1' width='100%'>" \
|
||||||
"<tr>" \
|
"<tr>" \
|
||||||
" <td><b>" + tr("Channel") + "</b></td>" \
|
" <td><b>" + tr("Channel") + "</b></td>" \
|
||||||
" <td><b>" + (firmware->getCapability(HasChNames) ? tr("Name") : "") + "</b></td>" \
|
" <td><b>" + (firmware->getCapability(ChannelsName) > 0 ? tr("Name") : "") + "</b></td>" \
|
||||||
" <td><b>" + tr("Offset") + "</b></td>" \
|
" <td><b>" + tr("Offset") + "</b></td>" \
|
||||||
" <td><b>" + tr("Min") + "</b></td>" \
|
" <td><b>" + tr("Min") + "</b></td>" \
|
||||||
" <td><b>" + tr("Max") + "</b></td>" \
|
" <td><b>" + tr("Max") + "</b></td>" \
|
||||||
|
|||||||
Reference in New Issue
Block a user