diff options
Diffstat (limited to 'gr-qtgui')
-rw-r--r-- | gr-qtgui/lib/TimeDomainDisplayPlot.cc | 21 | ||||
-rw-r--r-- | gr-qtgui/lib/TimeDomainDisplayPlot.h | 8 | ||||
-rw-r--r-- | gr-qtgui/lib/spectrumdisplayform.cc | 5 | ||||
-rw-r--r-- | gr-qtgui/lib/timedisplayform.cc | 10 |
4 files changed, 23 insertions, 21 deletions
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc index 28cca3aaa..ee13a7dce 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc @@ -117,14 +117,13 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots, QWidget* parent) canvas()->setPalette(palette); setAxisScaleEngine(QwtPlot::xBottom, new QwtLinearScaleEngine); - set_xaxis(0, _numPoints); + setXaxis(0, _numPoints); setAxisTitle(QwtPlot::xBottom, "Time (sec)"); setAxisScaleEngine(QwtPlot::yLeft, new QwtLinearScaleEngine); - set_yaxis(-2.0, 2.0); - setAxisTitle(QwtPlot::yLeft, "Normalized Voltage"); - - //QColor clr(Qt::blue); + setYaxis(-2.0, 2.0); + setAxisTitle(QwtPlot::yLeft, "Amplitude"); + QList<QColor> colors; colors << QColor(Qt::blue) << QColor(Qt::red) << QColor(Qt::green) << QColor(Qt::black) << QColor(Qt::cyan) << QColor(Qt::magenta) @@ -149,9 +148,9 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots, QWidget* parent) _resetXAxisPoints(); _zoomer->setMousePattern(QwtEventPattern::MouseSelect2, - Qt::RightButton, Qt::ControlModifier); + Qt::RightButton, Qt::ControlModifier); _zoomer->setMousePattern(QwtEventPattern::MouseSelect3, - Qt::RightButton); + Qt::RightButton); _panner = new QwtPlotPanner(canvas()); _panner->setAxisEnabled(QwtPlot::yRight, false); @@ -195,21 +194,21 @@ TimeDomainDisplayPlot::~TimeDomainDisplayPlot() } void -TimeDomainDisplayPlot::set_yaxis(double min, double max) +TimeDomainDisplayPlot::setYaxis(double min, double max) { setAxisScale(QwtPlot::yLeft, min, max); _zoomer->setZoomBase(); } void -TimeDomainDisplayPlot::set_xaxis(double min, double max) +TimeDomainDisplayPlot::setXaxis(double min, double max) { setAxisScale(QwtPlot::xBottom, min, max); _zoomer->setZoomBase(); } void -TimeDomainDisplayPlot::set_title(int which, QString title) +TimeDomainDisplayPlot::setTitle(int which, QString title) { _plot_curve[which]->setTitle(title); } @@ -242,7 +241,7 @@ void TimeDomainDisplayPlot::PlotNewData(const std::vector<double*> dataPoints, _plot_curve[i]->setRawData(_xAxisPoints, _dataPoints[i], _numPoints); } - set_xaxis(0, numDataPoints); + setXaxis(0, numDataPoints); _resetXAxisPoints(); } diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.h b/gr-qtgui/lib/TimeDomainDisplayPlot.h index bc8b0c862..1693e7537 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.h +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.h @@ -52,11 +52,11 @@ public: virtual void replot(); - void set_yaxis(double min, double max); - void set_xaxis(double min, double max); - void set_title(int which, QString title); - public slots: + void setYaxis(double min, double max); + void setXaxis(double min, double max); + void setTitle(int which, QString title); + void resizeSlot( QSize *s ); void SetSampleRate(double sr, double units, const std::string &strunits); diff --git a/gr-qtgui/lib/spectrumdisplayform.cc b/gr-qtgui/lib/spectrumdisplayform.cc index 2d2d8648f..991f51f47 100644 --- a/gr-qtgui/lib/spectrumdisplayform.cc +++ b/gr-qtgui/lib/spectrumdisplayform.cc @@ -43,6 +43,9 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) _averagedValues = new double[_numRealDataPoints]; _historyVector = new std::vector<double*>; + _timeDomainDisplayPlot->setTitle(0, "real"); + _timeDomainDisplayPlot->setTitle(1, "imag"); + AvgLineEdit->setRange(0, 500); // Set range of Average box value from 0 to 500 MinHoldCheckBox_toggled( false ); MaxHoldCheckBox_toggled( false ); @@ -698,7 +701,7 @@ SpectrumDisplayForm::ToggleTabConstellation(const bool state) void SpectrumDisplayForm::SetTimeDomainAxis(double min, double max) { - _timeDomainDisplayPlot->set_yaxis(min, max); + _timeDomainDisplayPlot->setYaxis(min, max); } void diff --git a/gr-qtgui/lib/timedisplayform.cc b/gr-qtgui/lib/timedisplayform.cc index 816331771..05baee7f9 100644 --- a/gr-qtgui/lib/timedisplayform.cc +++ b/gr-qtgui/lib/timedisplayform.cc @@ -35,7 +35,7 @@ TimeDisplayForm::TimeDisplayForm(int nplots, QWidget* parent) _layout = new QGridLayout(this); _timeDomainDisplayPlot = new TimeDomainDisplayPlot(nplots, this); - _layout->addWidget(_timeDomainDisplayPlot, 0, 0, 100, 100); + _layout->addWidget(_timeDomainDisplayPlot, 0, 0); _numRealDataPoints = 1024; @@ -67,7 +67,6 @@ TimeDisplayForm::newData( const TimeUpdateEvent* spectrumUpdateEvent) { const std::vector<double*> timeDomainDataPoints = spectrumUpdateEvent->getTimeDomainPoints(); const uint64_t numTimeDomainDataPoints = spectrumUpdateEvent->getNumTimeDomainDataPoints(); - const timespec generatedTimestamp = {0,0}; _timeDomainDisplayPlot->PlotNewData(timeDomainDataPoints, numTimeDomainDataPoints, @@ -77,7 +76,8 @@ TimeDisplayForm::newData( const TimeUpdateEvent* spectrumUpdateEvent) void TimeDisplayForm::resizeEvent( QResizeEvent *e ) { - emit _timeDomainDisplayPlot->resizeSlot(&size()); + QSize s = size(); + emit _timeDomainDisplayPlot->resizeSlot(&s); } void @@ -153,7 +153,7 @@ TimeDisplayForm::closeEvent( QCloseEvent *e ) void TimeDisplayForm::SetTimeDomainAxis(double min, double max) { - _timeDomainDisplayPlot->set_yaxis(min, max); + _timeDomainDisplayPlot->setYaxis(min, max); } void @@ -167,5 +167,5 @@ TimeDisplayForm::SetUpdateTime(double t) void TimeDisplayForm::SetTitle(int which, QString title) { - _timeDomainDisplayPlot->set_title(which, title); + _timeDomainDisplayPlot->setTitle(which, title); } |