mirror of
https://github.com/opentx/opentx.git
synced 2025-07-20 23:05:12 +03:00
Channels limits go up to 150% when extended limits are enabled
This commit is contained in:
parent
621639ad0b
commit
ea731eae37
4 changed files with 16 additions and 6 deletions
|
@ -1237,6 +1237,14 @@ ModelData ModelData::removeGlobalVars()
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ModelData::getChannelsMax()
|
||||||
|
{
|
||||||
|
if (extendedLimits)
|
||||||
|
return IS_TARANIS(GetCurrentFirmware()->getBoard()) ? 150 : 125;
|
||||||
|
else
|
||||||
|
return 100;
|
||||||
|
}
|
||||||
|
|
||||||
QList<EEPROMInterface *> eepromInterfaces;
|
QList<EEPROMInterface *> eepromInterfaces;
|
||||||
void RegisterEepromInterfaces()
|
void RegisterEepromInterfaces()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1041,6 +1041,8 @@ class ModelData {
|
||||||
void clearMixes();
|
void clearMixes();
|
||||||
void clearInputs();
|
void clearInputs();
|
||||||
|
|
||||||
|
int getChannelsMax();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void removeGlobalVar(int & var);
|
void removeGlobalVar(int & var);
|
||||||
};
|
};
|
||||||
|
|
|
@ -69,7 +69,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||||
minSB->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
minSB->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||||
minSB->setAccelerated(true);
|
minSB->setAccelerated(true);
|
||||||
minSB->setDecimals(1);
|
minSB->setDecimals(1);
|
||||||
minSB->setMinimum(model.extendedLimits ? -125 : -100);
|
minSB->setMinimum(-model.getChannelsMax());
|
||||||
minSB->setSingleStep(0.1);
|
minSB->setSingleStep(0.1);
|
||||||
minSB->setMaximum(0);
|
minSB->setMaximum(0);
|
||||||
minSB->setValue(float(model.limitData[i].min) / 10);
|
minSB->setValue(float(model.limitData[i].min) / 10);
|
||||||
|
@ -85,7 +85,7 @@ Channels::Channels(QWidget * parent, ModelData & model, GeneralSettings & genera
|
||||||
maxSB->setDecimals(1);
|
maxSB->setDecimals(1);
|
||||||
maxSB->setMinimum(0);
|
maxSB->setMinimum(0);
|
||||||
maxSB->setSingleStep(0.1);
|
maxSB->setSingleStep(0.1);
|
||||||
maxSB->setMaximum(model.extendedLimits ? 125 : 100);
|
maxSB->setMaximum(model.getChannelsMax());
|
||||||
maxSB->setValue(float(model.limitData[i].max) / 10);
|
maxSB->setValue(float(model.limitData[i].max) / 10);
|
||||||
connect(maxSB, SIGNAL(editingFinished()), this, SLOT(maxEdited()));
|
connect(maxSB, SIGNAL(editingFinished()), this, SLOT(maxEdited()));
|
||||||
gridLayout->addWidget(maxSB, i+1, col++, 1, 1);
|
gridLayout->addWidget(maxSB, i+1, col++, 1, 1);
|
||||||
|
@ -194,8 +194,8 @@ void Channels::refreshExtendedLimits()
|
||||||
QDoubleSpinBox * minDSB = minSpins[i];
|
QDoubleSpinBox * minDSB = minSpins[i];
|
||||||
QDoubleSpinBox * maxDSB = maxSpins[i];
|
QDoubleSpinBox * maxDSB = maxSpins[i];
|
||||||
|
|
||||||
minDSB->setMinimum(model.extendedLimits ? -125 : -100);
|
minDSB->setMinimum(-model.getChannelsMax());
|
||||||
maxDSB->setMaximum(model.extendedLimits ? 125 : 100);
|
maxDSB->setMaximum(model.getChannelsMax());
|
||||||
}
|
}
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,7 +146,7 @@ ModulePanel::ModulePanel(QWidget *parent, ModelData & model, ModuleData & module
|
||||||
label->setText(QString::number(i+1));
|
label->setText(QString::number(i+1));
|
||||||
QDoubleSpinBox * spinbox = new QDoubleSpinBox(this);
|
QDoubleSpinBox * spinbox = new QDoubleSpinBox(this);
|
||||||
spinbox->setMinimumSize(QSize(20, 0));
|
spinbox->setMinimumSize(QSize(20, 0));
|
||||||
spinbox->setRange(-100, 100);
|
spinbox->setRange(-150, 150);
|
||||||
spinbox->setSingleStep(0.1);
|
spinbox->setSingleStep(0.1);
|
||||||
spinbox->setDecimals(1);
|
spinbox->setDecimals(1);
|
||||||
spinbox->setValue(((double)module.failsafeChannels[i]*100)/1024);
|
spinbox->setValue(((double)module.failsafeChannels[i]*100)/1024);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue