1414
1515#include " settings.h"
1616#include " sispinbox.h"
17- #include " utils/dsoStrings.h"
1817#include " utils/printutils.h"
1918
2019template <typename ... Args> struct SELECT {
@@ -66,9 +65,9 @@ VoltageDock::VoltageDock(DsoSettingsScope *scope, const Dso::ControlSpecificatio
6665 dockLayout->addWidget (b.invertCheckBox , (int )channel * 3 + 2 , 1 );
6766
6867 if (channel < spec->channels )
69- setCoupling (channel, scope->voltage [channel].couplingIndex );
68+ setCoupling (channel, scope->voltage [channel].couplingOrMathIndex );
7069 else
71- setMode (scope->voltage [channel].math );
70+ setMode (scope->voltage [channel].couplingOrMathIndex );
7271 setGain (channel, scope->voltage [channel].gainStepIndex );
7372 setUsed (channel, scope->voltage [channel].used );
7473
@@ -80,12 +79,11 @@ VoltageDock::VoltageDock(DsoSettingsScope *scope, const Dso::ControlSpecificatio
8079 this ->scope ->voltage [channel].inverted = checked;
8180 });
8281 connect (b.miscComboBox , SELECT<int >::OVERLOAD_OF (&QComboBox::currentIndexChanged), [this ,channel,spec,scope](int index){
82+ this ->scope ->voltage [channel].couplingOrMathIndex = (unsigned )index;
8383 if (channel < spec->channels ) {
84- this ->scope ->voltage [channel].couplingIndex = (unsigned )index;
8584 emit couplingChanged (channel, scope->coupling (channel, spec));
8685 } else {
87- this ->scope ->voltage [channel].math = (Dso::MathMode) index;
88- emit modeChanged (this ->scope ->voltage [channel].math );
86+ emit modeChanged (Dso::getMathMode (this ->scope ->voltage [channel]));
8987 }
9088 });
9189 connect (b.usedCheckBox , &QAbstractButton::toggled, [this ,channel](bool checked) {
@@ -119,9 +117,9 @@ void VoltageDock::setGain(ChannelID channel, unsigned gainStepIndex) {
119117 channelBlocks[channel].gainComboBox ->setCurrentIndex ((unsigned )gainStepIndex);
120118}
121119
122- void VoltageDock::setMode (Dso::MathMode mode ) {
120+ void VoltageDock::setMode (unsigned mathModeIndex ) {
123121 QSignalBlocker blocker (channelBlocks[spec->channels ].miscComboBox );
124- channelBlocks[spec->channels ].miscComboBox ->setCurrentIndex ((int )mode );
122+ channelBlocks[spec->channels ].miscComboBox ->setCurrentIndex ((int )mathModeIndex );
125123}
126124
127125void VoltageDock::setUsed (ChannelID channel, bool used) {
0 commit comments