FW however apparently also has an issue when turning extended limits off
This commit is contained in:
Andre Bernet
2014-03-23 15:57:33 +01:00
parent e9035d3649
commit 31823c0c95
5 changed files with 34 additions and 2 deletions
+16
View File
@@ -63,10 +63,12 @@ Channels::Channels(QWidget * parent, ModelData & model):
minSB->setAccelerated(true);
minSB->setDecimals(1);
minSB->setMinimum(model.extendedLimits ? -125 : -100);
minSB->setSingleStep(0.1);
minSB->setMaximum(0);
minSB->setValue(float(model.limitData[i].min) / 10);
connect(minSB, SIGNAL(editingFinished()), this, SLOT(minEdited()));
gridLayout->addWidget(minSB, i+1, col++, 1, 1);
minSpins << minSB;
// Channel max
QDoubleSpinBox * maxSB = new QDoubleSpinBox(this);
@@ -75,10 +77,12 @@ Channels::Channels(QWidget * parent, ModelData & model):
maxSB->setAccelerated(true);
maxSB->setDecimals(1);
maxSB->setMinimum(0);
maxSB->setSingleStep(0.1);
maxSB->setMaximum(model.extendedLimits ? 125 : 100);
maxSB->setValue(float(model.limitData[i].max) / 10);
connect(maxSB, SIGNAL(editingFinished()), this, SLOT(maxEdited()));
gridLayout->addWidget(maxSB, i+1, col++, 1, 1);
maxSpins << maxSB;
// Channel inversion
QComboBox * invCB = new QComboBox(this);
@@ -160,6 +164,18 @@ void Channels::maxEdited()
emit modified();
}
void Channels::refreshExtendedLimits()
{
for (int i=0; i<GetEepromInterface()->getCapability(Outputs); i++) {
QDoubleSpinBox * minDSB = minSpins[i];
QDoubleSpinBox * maxDSB = maxSpins[i];
minDSB->setMinimum(model.extendedLimits ? -125 : -100);
maxDSB->setMaximum(model.extendedLimits ? 125 : 100);
}
emit modified();
}
void Channels::invEdited()
{
QComboBox *cb = qobject_cast<QComboBox*>(sender());