Stop extended limits affecting output fields referencing gvars

This commit is contained in:
elecpower
2021-02-22 08:07:38 +11:00
parent 2a719199e3
commit 08a5015ea0
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -57,7 +57,7 @@ LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout * tableLayout, int row
spinbox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
QHBoxLayout *horizontalLayout = new QHBoxLayout();
QCheckBox *gv = new QCheckBox(tr("GV"));
gv = new QCheckBox(tr("GV"));
gv->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
horizontalLayout->addWidget(gv);
QComboBox *cb = new QComboBox();
@@ -84,14 +84,14 @@ void LimitsGroup::updateMinMax(int max)
if (spinbox->maximum() == 0) {
spinbox->setMinimum(-max * displayStep);
gvarGroup->setMinimum(-max);
if (value < -max) {
if (!gv->isChecked() && value < -max) {
value = -max;
}
}
if (spinbox->minimum() == 0) {
spinbox->setMaximum(max * displayStep);
gvarGroup->setMaximum(max);
if (value > max) {
if (!gv->isChecked() && value > max) {
value = max;
}
}
+1
View File
@@ -50,6 +50,7 @@ class LimitsGroup
GVarGroup *gvarGroup;
int &value;
double displayStep;
QCheckBox *gv;
};
class ChannelsPanel : public ModelPanel