frontend for offset and attenuation:

This commit is contained in:
Chris Esposito 2019-02-17 19:08:50 +11:00
parent 17277fece6
commit 1479d95f97
4 changed files with 57 additions and 3 deletions

View File

@ -1458,6 +1458,50 @@ void isoDriver::triggerStateChanged()
break;
}
}
}
void isoDriver::offsetChanged_CH1(double newOffset)
{
m_offset_CH1 = newOffset;
}
void isoDriver::offsetChanged_CH2(double newOffset)
{
m_offset_CH2 = newOffset;
}
void isoDriver::attenuationChanged_CH1(int attenuationIndex)
{
switch(attenuationIndex)
{
case 0:
m_attenuation_CH1 = 1;
break;
case 1:
m_attenuation_CH1 = 5;
break;
case 2:
m_attenuation_CH1 = 10;
break;
default:
throw std::runtime_error("Unknown attenuation index for CH1");
}
}
void isoDriver::attenuationChanged_CH2(int attenuationIndex)
{
switch(attenuationIndex)
{
case 0:
m_attenuation_CH2 = 1;
break;
case 1:
m_attenuation_CH2 = 5;
break;
case 2:
m_attenuation_CH2 = 10;
break;
default:
throw std::runtime_error("Unknown attenuation index for CH2");
}
}

View File

@ -221,6 +221,10 @@ public slots:
void disableFileMode();
void hideCH1(bool enable);
void hideCH2(bool enable);
void offsetChanged_CH1(double newOffset);
void offsetChanged_CH2(double newOffset);
void attenuationChanged_CH1(int attenuationIndex);
void attenuationChanged_CH2(int attenuationIndex);
};
#endif // ISODRIVER_H

View File

@ -2,6 +2,7 @@
#include "uartstyledecoder.h"
#include "daqform.h"
#include <QDesktopServices>
#include "espospinbox.h"
namespace
{
@ -210,6 +211,11 @@ MainWindow::MainWindow(QWidget *parent) :
{
this->setGeometry(64, 64, 1440, 880);
}
connect(ui->offsetSpinBox_CH1, SIGNAL(valueChanged(double)), ui->controller_iso, SLOT(offsetChanged_CH1(double)));
connect(ui->offsetSpinBox_CH2, SIGNAL(valueChanged(double)), ui->controller_iso, SLOT(offsetChanged_CH2(double)));
connect(ui->attenuationComboBox_CH1, SIGNAL(currentIndexChanged(int)), ui->controller_iso, SLOT(attenuationChanged_CH1(int)));
connect(ui->attenuationComboBox_CH2, SIGNAL(currentIndexChanged(int)), ui->controller_iso, SLOT(attenuationChanged_CH2(int)));
}
MainWindow::~MainWindow()

View File

@ -266,7 +266,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="attenuationComboBox_CH2">
<widget class="QComboBox" name="attenuationComboBox_CH1">
<item>
<property name="text">
<string>1x</string>
@ -471,7 +471,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="attenuationComboBox_CH2_2">
<widget class="QComboBox" name="attenuationComboBox_CH2">
<item>
<property name="text">
<string>1x</string>