From 059831534c7e884f0a607ed86b582fd00d821731 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Sat, 26 Sep 2026 23:24:03 +0200 Subject: New upstream version 3.2.0~rc1+dfsg --- widgets/echoplot.cpp | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) (limited to 'widgets/echoplot.cpp') diff --git a/widgets/echoplot.cpp b/widgets/echoplot.cpp index 65feb7a8..039c9e5f 100644 --- a/widgets/echoplot.cpp +++ b/widgets/echoplot.cpp @@ -1,13 +1,13 @@ #include "echoplot.h" #include "commons.h" +#include #include #include #include +#include #include #include "moc_echoplot.cpp" -#define MAX_SCREENSIZE 2048 - EPlotter::EPlotter(QWidget *parent) : //EPlotter Constructor QFrame(parent) @@ -33,6 +33,7 @@ EPlotter::EPlotter(QWidget *parent) : //EPlotter Constructor m_TxFreq = 1500; m_line = 0; m_dBStepSize=10; + m_bBaseline=false; } EPlotter::~EPlotter() { } // Destructor @@ -81,7 +82,7 @@ void EPlotter::paintEvent(QPaintEvent *) // paintEvent() void EPlotter::draw() //draw() { int i,j,y; - float blue[4096],red[4096]; + float blue[4096] {},red[4096] {}; float gain = pow(10.0,(m_plotGain/20.0)); QPen penBlue(QColor(0,255,255),1); QPen penRed(Qt::red,1); @@ -100,13 +101,10 @@ void EPlotter::draw() //draw() painter2D.drawLine(0,0,m_w,0); } - QPoint LineBuf[MAX_SCREENSIZE]; - - if(m_binsPerPixel==0) m_binsPerPixel=1; + m_binsPerPixel=std::max(1,std::min(4096,m_binsPerPixel)); + int compressedCount=4096/m_binsPerPixel; j=0; - for(i=0; i<4096/m_binsPerPixel; i++) { - blue[i]=0.0; - red[i]=0.0; + for(i=0; i0) { for(i=0; i