mirror of https://github.com/EspoTek/Labrador.git
Added attenuation and offset to backend
This commit is contained in:
parent
5e185ba08c
commit
b78a65174f
|
@ -701,6 +701,11 @@ void isoDriver::frameActionGeneric(char CH1_mode, char CH2_mode) //0 for off, 1
|
|||
|
||||
if (CH1_mode == 1){
|
||||
analogConvert(readData375_CH1.get(), &CH1, 128, AC_CH1, 1);
|
||||
for (int i=0; i < GRAPH_SAMPLES; i++)
|
||||
{
|
||||
CH1[i] /= m_attenuation_CH1;
|
||||
CH1[i] += m_offset_CH1;
|
||||
}
|
||||
xmin = (currentVmin < xmin) ? currentVmin : xmin;
|
||||
xmax = (currentVmax > xmax) ? currentVmax : xmax;
|
||||
broadcastStats(0);
|
||||
|
@ -709,6 +714,11 @@ void isoDriver::frameActionGeneric(char CH1_mode, char CH2_mode) //0 for off, 1
|
|||
|
||||
if (CH2_mode == 1){
|
||||
analogConvert(readData375_CH2.get(), &CH2, 128, AC_CH2, 2);
|
||||
for (int i=0; i < GRAPH_SAMPLES; i++)
|
||||
{
|
||||
CH2[i] /= m_attenuation_CH2;
|
||||
CH2[i] += m_offset_CH2;
|
||||
}
|
||||
ymin = (currentVmin < ymin) ? currentVmin : ymin;
|
||||
ymax = (currentVmax > ymax) ? currentVmax : ymax;
|
||||
broadcastStats(1);
|
||||
|
|
|
@ -108,6 +108,10 @@ private:
|
|||
double estimated_resistance = 0;
|
||||
int multimeterRsource = 0;
|
||||
int triggerMode = 0;
|
||||
double m_offset_CH1 = 0;
|
||||
double m_offset_CH2 = 0;
|
||||
double m_attenuation_CH1 = 1;
|
||||
double m_attenuation_CH2 = 1;
|
||||
//Pure MM++ related variables
|
||||
enum multimeterType_enum {V = 0, I = 1, R = 2, C = 3};
|
||||
multimeterType_enum multimeterType = V;
|
||||
|
|
|
@ -202,6 +202,10 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
qDebug() << "Low resolution detected:" << QApplication::desktop()->availableGeometry().width() << "x" << QApplication::desktop()->availableGeometry().height();
|
||||
this->setGeometry(64, 64, 800, 600);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->setGeometry(64, 64, 1440, 900);
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
|
Loading…
Reference in New Issue