From 7aa3c56b01768ba7d38fccedc17b30a4046b3fbb Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 28 Sep 2020 23:28:13 +0200 Subject: New upstream version 2.3.0~rc1+repack --- widgets/plotter.cpp | 84 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 63 insertions(+), 21 deletions(-) (limited to 'widgets/plotter.cpp') diff --git a/widgets/plotter.cpp b/widgets/plotter.cpp index c5ade99a..d612b2eb 100644 --- a/widgets/plotter.cpp +++ b/widgets/plotter.cpp @@ -48,7 +48,8 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor m_Percent2DScreen0 {0}, m_rxFreq {1020}, m_txFreq {0}, - m_startFreq {0} + m_startFreq {0}, + m_tol {100} { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setFocusPolicy(Qt::StrongFocus); @@ -56,6 +57,7 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor setAutoFillBackground(false); setAttribute(Qt::WA_OpaquePaintEvent, false); setAttribute(Qt::WA_NoSystemBackground, true); + setMouseTracking(true); m_bReplot=false; // contextual pop up menu @@ -161,7 +163,6 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) int iz=XfromFreq(5000.0); int jz=iz*m_binsPerPixel; m_fMax=FreqfromX(iz); - if(bScroll and swide[0]<1.e29) { flat4_(swide,&iz,&m_Flatten); if(!m_bReplot) flat4_(&dec_data.savg[j0],&jz,&m_Flatten); @@ -184,7 +185,6 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) if (swide[i]<1.e29) painter1.setPen(g_ColorTbl[y1]); painter1.drawPoint(i,m_j); } - m_line++; float y2min=1.e30; @@ -211,7 +211,7 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) for(int k=0; kx(); + QToolTip::showText(event->globalPos(),QString::number(int(FreqfromX(x)))); + QWidget::mouseMoveEvent(event); +} + void CPlotter::mouseReleaseEvent (QMouseEvent * event) { - if (Qt::LeftButton == event->button ()) { + if (Qt::LeftButton == event->button () and m_mode!="FST4W") { int x=event->x(); if(x<0) x=0; if(x>m_Size.width()) x=m_Size.width(); @@ -791,9 +820,22 @@ void CPlotter::setFlatten(bool b1, bool b2) void CPlotter::setTol(int n) //setTol() { m_tol=n; +} + +void CPlotter::setFST4_FreqRange(int fLow,int fHigh) +{ + m_nfa=fLow; + m_nfb=fHigh; DrawOverlay(); + update(); +} + +void CPlotter::setSingleDecode(bool b) +{ + m_bSingleDecode=b; } + void CPlotter::setColours(QVector const& cl) { g_ColorTbl = cl; -- cgit v1.2.3