diff options
| author | Christoph Berg <myon@debian.org> | 2022-09-17 12:51:21 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2022-09-17 12:51:21 +0200 |
| commit | 4d2fac0dafe835b1ed479bebe136c3afe748ecf3 (patch) | |
| tree | efddc4f95ba73f57dcd6518ce31f8e6ea5b0cd15 /widgets/echoplot.cpp | |
| parent | 2d1068e60bce7ae1fff11623454900e8cee956b1 (diff) | |
New upstream version 2.6.0~rc4+repackupstream/2.6.0_rc4+repack
Diffstat (limited to 'widgets/echoplot.cpp')
| -rwxr-xr-x | widgets/echoplot.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/widgets/echoplot.cpp b/widgets/echoplot.cpp index 15c2d8e5..80202c35 100755 --- a/widgets/echoplot.cpp +++ b/widgets/echoplot.cpp @@ -127,7 +127,7 @@ void EPlotter::draw() //draw() painter2D.setPen(penBlue);
j=0;
for(i=0; i<m_w; i++) {
- y = 0.9*m_h2 - gain*(m_h/10.0)*(blue[i0+i]-1.0) - 0.01*m_h2*m_plotZero;
+ y = 0.9*m_h2 - gain*(m_h/10.0)*blue[i0+i] - 0.01*m_h2*m_plotZero;
LineBuf[j].setX(i);
LineBuf[j].setY(y);
j++;
@@ -145,12 +145,19 @@ void EPlotter::draw() //draw() j=0;
for(int i=0; i<m_w; i++) {
- y = 0.9*m_h2 - gain*(m_h/10.0)*(red[i0+i]-1.0) - 0.01*m_h2*m_plotZero;
+ y = 0.9*m_h2 - gain*(m_h/10.0)*red[i0+i] - 0.01*m_h2*m_plotZero;
LineBuf[j].setX(i);
LineBuf[j].setY(y);
j++;
}
painter2D.drawPolyline(LineBuf,j);
+
+ if(m_bBaseline) {
+ // Draw the baseline
+ y = 0.9*m_h2 - 0.01*m_h2*m_plotZero;
+ painter2D.drawLine(0,y,m_w,y);
+ }
+
update(); //trigger a new paintEvent
}
@@ -323,3 +330,9 @@ void EPlotter::setColors(qint32 n) //setSmooth() int EPlotter::plotWidth(){return m_2DPixmap.width();}
void EPlotter::UpdateOverlay() {DrawOverlay();}
+
+void EPlotter::setBaseline(bool b)
+{
+ m_bBaseline=b;
+ draw();
+}
|
