From bf8fb4aa8589327737a706745734976a0b3705a0 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Thu, 7 May 2020 15:47:50 -0400 Subject: [PATCH] Smaller increment adjustment for drift. 1 second interval lines. --- mainwindow.cpp | 2 +- plotter.cpp | 11 ++++++++++- plotter.h | 3 ++- widegraph.cpp | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index ffc9743..86d3298 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -4914,7 +4914,7 @@ void MainWindow::processDecodedLine(QByteArray t){ n -= (float)period; n += computeFramesNeededForDecode(m)/RX_SAMPLE_RATE; - n -= xdt; + n -= xdt/2; int xdtmin = qMin(n*1000, (float)DriftingDateTime::drift()); int xdtmax = qMax(n*1000, (float)DriftingDateTime::drift()); diff --git a/plotter.cpp b/plotter.cpp index b2e44a7..f580585 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -281,7 +281,7 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) m_bScaleOK=true; } -void CPlotter::drawLine(const QColor &color, int ia, int ib) +void CPlotter::drawDecodeLine(const QColor &color, int ia, int ib) { int x1=XfromFreq(ia); int x2=XfromFreq(ib); @@ -295,6 +295,15 @@ void CPlotter::drawLine(const QColor &color, int ia, int ib) painter1.drawLine(qMax(x1, x2),0,qMax(x1, x2),9); } +void CPlotter::drawHorizontalLine(const QColor &color, int x, int width) +{ + QPen pen0(color, 1); + + QPainter painter1(&m_WaterfallPixmap); + painter1.setPen(pen0); + painter1.drawLine(x,0,width <= 0 ? m_w : x+width,0); +} + void CPlotter::replot() { float swide[m_w]; diff --git a/plotter.h b/plotter.h index ced70fb..a3df2a6 100644 --- a/plotter.h +++ b/plotter.h @@ -90,7 +90,8 @@ public: void setReference(bool b) {m_bReference = b;} bool Reference() const {return m_bReference;} #endif - void drawLine(const QColor &color, int ia, int ib); + void drawDecodeLine(const QColor &color, int ia, int ib); + void drawHorizontalLine(const QColor &color, int x, int width); void setVHF(bool bVHF); void setRedFile(QString fRed); bool scaleOK () const {return m_bScaleOK;} diff --git a/widegraph.cpp b/widegraph.cpp index 2607fdf..71b69d4 100644 --- a/widegraph.cpp +++ b/widegraph.cpp @@ -246,7 +246,7 @@ void WideGraph::saveSettings() //saveS void WideGraph::drawLine(const QColor &color, int ia, int ib) { - ui->widePlot->drawLine(color, ia, ib); + ui->widePlot->drawDecodeLine(color, ia, ib); } void WideGraph::dataSink2(float s[], float df3, int ihsym, int ndiskdata) //dataSink2 @@ -357,7 +357,7 @@ void WideGraph::drawSwide(){ } ui->widePlot->draw(swideLocal,true,false); } else if(lastSecondInPeriod != secondInPeriod) { - drawLine(Qt::gray, ui->widePlot->startFreq(), 10); + ui->widePlot->drawHorizontalLine(Qt::white, 0, 5); } lastSecondInPeriod=secondInPeriod;