From 4f3de02482bd29a2548b4d497e70d6a8a8e4aed4 Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sat, 10 Apr 2021 15:34:35 -0700 Subject: [PATCH] Added frequency line. Let's see how we like it. --- wfmain.cpp | 9 +++++++-- wfmain.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/wfmain.cpp b/wfmain.cpp index dc0cb5b..bc70266 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -214,6 +214,11 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent tracer->setBrush(Qt::green); tracer->setSize(30); + freqIndicatorLine = new QCPItemLine(plot); + freqIndicatorLine->setAntialiased(true); + freqIndicatorLine->setPen(QPen(Qt::blue)); + + ui->modeSelectCombo->addItem("LSB", 0x00); ui->modeSelectCombo->addItem("USB", 0x01); ui->modeSelectCombo->addItem("AM", 0x02); @@ -2201,9 +2206,9 @@ void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double e plot->graph(0)->setData(x,y); if((freq.MHzDouble < endFreq) && (freq.MHzDouble > startFreq)) { - // tracer->setGraphKey(freqMhz); tracer->setGraphKey(freq.MHzDouble); - + freqIndicatorLine->start->setCoords(freq.MHzDouble,0); + freqIndicatorLine->end->setCoords(freq.MHzDouble,160); } if(drawPeaks) { diff --git a/wfmain.h b/wfmain.h index 756206a..32b5eec 100644 --- a/wfmain.h +++ b/wfmain.h @@ -403,6 +403,7 @@ private: QCustomPlot *plot; // line plot QCustomPlot *wf; // waterfall image QCPItemTracer * tracer; // marker of current frequency + QCPItemLine * freqIndicatorLine; //commHandler *comm; void setAppTheme(bool isCustom); void setPlotTheme(QCustomPlot *plot, bool isDark);