From 32ef4974395913878f252434c21a63a259bb9b97 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sat, 15 Oct 2011 16:32:35 -0400 Subject: qtgui: avoids a simple warning. --- gr-qtgui/lib/spectrumdisplayform.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gr-qtgui/lib/spectrumdisplayform.cc') diff --git a/gr-qtgui/lib/spectrumdisplayform.cc b/gr-qtgui/lib/spectrumdisplayform.cc index 0e8594029..d3ca01483 100644 --- a/gr-qtgui/lib/spectrumdisplayform.cc +++ b/gr-qtgui/lib/spectrumdisplayform.cc @@ -466,7 +466,8 @@ SpectrumDisplayForm::_AverageHistory(const double* newBuffer) if(_historyEntryCount > static_cast(_historyVector->size())){ _historyEntryCount = _historyVector->size(); } - _historyEntry = (++_historyEntry)%_historyVector->size(); + _historyEntry += 1; + _historyEntry = _historyEntry % _historyVector->size(); // Total up and then average the values double sum; -- cgit From 25fd6e0324dc8296b66a3c9b8e628d6738f15fe7 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sat, 15 Oct 2011 18:23:04 -0400 Subject: qtgui: wip: updating qtgui to work with QWT 6 (and trying to maintain backwards compatability to 5.2). This wip works for just the fft plots. --- gr-qtgui/lib/spectrumdisplayform.cc | 87 ++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 34 deletions(-) (limited to 'gr-qtgui/lib/spectrumdisplayform.cc') diff --git a/gr-qtgui/lib/spectrumdisplayform.cc b/gr-qtgui/lib/spectrumdisplayform.cc index d3ca01483..f52f96241 100644 --- a/gr-qtgui/lib/spectrumdisplayform.cc +++ b/gr-qtgui/lib/spectrumdisplayform.cc @@ -34,37 +34,37 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) _intValidator = new QIntValidator(this); _intValidator->setBottom(0); _frequencyDisplayPlot = new FrequencyDisplayPlot(FrequencyPlotDisplayFrame); - _waterfallDisplayPlot = new WaterfallDisplayPlot(WaterfallPlotDisplayFrame); + //_waterfallDisplayPlot = new WaterfallDisplayPlot(WaterfallPlotDisplayFrame); - _timeDomainDisplayPlot = new TimeDomainDisplayPlot(2, TimeDomainDisplayFrame); - _constellationDisplayPlot = new ConstellationDisplayPlot(ConstellationDisplayFrame); + //_timeDomainDisplayPlot = new TimeDomainDisplayPlot(2, TimeDomainDisplayFrame); + //_constellationDisplayPlot = new ConstellationDisplayPlot(ConstellationDisplayFrame); _numRealDataPoints = 1024; _realFFTDataPoints = new double[_numRealDataPoints]; _averagedValues = new double[_numRealDataPoints]; _historyVector = new std::vector; - _timeDomainDisplayPlot->setTitle(0, "real"); - _timeDomainDisplayPlot->setTitle(1, "imag"); + //_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 ); - WaterfallMaximumIntensityWheel->setRange(-200, 0); - WaterfallMaximumIntensityWheel->setTickCnt(50); - WaterfallMinimumIntensityWheel->setRange(-200, 0); - WaterfallMinimumIntensityWheel->setTickCnt(50); - WaterfallMinimumIntensityWheel->setValue(-200); + //WaterfallMaximumIntensityWheel->setRange(-200, 0); + //WaterfallMaximumIntensityWheel->setTickCnt(50); + //WaterfallMinimumIntensityWheel->setRange(-200, 0); + //WaterfallMinimumIntensityWheel->setTickCnt(50); + //WaterfallMinimumIntensityWheel->setValue(-200); _peakFrequency = 0; _peakAmplitude = -HUGE_VAL; _noiseFloorAmplitude = -HUGE_VAL; - connect(_waterfallDisplayPlot, SIGNAL(UpdatedLowerIntensityLevel(const double)), - _frequencyDisplayPlot, SLOT(SetLowerIntensityLevel(const double))); - connect(_waterfallDisplayPlot, SIGNAL(UpdatedUpperIntensityLevel(const double)), - _frequencyDisplayPlot, SLOT(SetUpperIntensityLevel(const double))); + //connect(_waterfallDisplayPlot, SIGNAL(UpdatedLowerIntensityLevel(const double)), + // _frequencyDisplayPlot, SLOT(SetLowerIntensityLevel(const double))); + //connect(_waterfallDisplayPlot, SIGNAL(UpdatedUpperIntensityLevel(const double)), + // _frequencyDisplayPlot, SLOT(SetUpperIntensityLevel(const double))); _frequencyDisplayPlot->SetLowerIntensityLevel(-200); _frequencyDisplayPlot->SetUpperIntensityLevel(-200); @@ -77,9 +77,9 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) Reset(); ToggleTabFrequency(false); - ToggleTabWaterfall(false); - ToggleTabTime(false); - ToggleTabConstellation(false); + //ToggleTabWaterfall(false); + //ToggleTabTime(false); + //ToggleTabConstellation(false); _historyEntry = 0; _historyEntryCount = 0; @@ -90,16 +90,16 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) // Connect double click signals up connect(_frequencyDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), - this, SLOT(onFFTPlotPointSelected(const QPointF))); + this, SLOT(onFFTPlotPointSelected(const QPointF))); - connect(_waterfallDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), - this, SLOT(onWFallPlotPointSelected(const QPointF))); + //connect(_waterfallDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), + // this, SLOT(onWFallPlotPointSelected(const QPointF))); - connect(_timeDomainDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), - this, SLOT(onTimePlotPointSelected(const QPointF))); + //connect(_timeDomainDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), + // this, SLOT(onTimePlotPointSelected(const QPointF))); - connect(_constellationDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), - this, SLOT(onConstPlotPointSelected(const QPointF))); + //connect(_constellationDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), + // this, SLOT(onConstPlotPointSelected(const QPointF))); } SpectrumDisplayForm::~SpectrumDisplayForm() @@ -238,6 +238,7 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate _noiseFloorAmplitude, _peakFrequency, _peakAmplitude, d_update_time); } + /* if(tabindex == d_plot_time) { _timeDomainDisplayPlot->PlotNewData(timeDomainDataPoints, numTimeDomainDataPoints, @@ -258,7 +259,7 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate spectrumUpdateEvent->getDroppedFFTFrames()); } } - + */ // Tell the system the GUI has been updated if(_systemSpecifiedFlag){ @@ -276,6 +277,7 @@ SpectrumDisplayForm::resizeEvent( QResizeEvent *e ) s.setHeight(FrequencyPlotDisplayFrame->height()); emit _frequencyDisplayPlot->resizeSlot(&s); + /* s.setWidth(TimeDomainDisplayFrame->width()); s.setHeight(TimeDomainDisplayFrame->height()); emit _timeDomainDisplayPlot->resizeSlot(&s); @@ -287,6 +289,7 @@ SpectrumDisplayForm::resizeEvent( QResizeEvent *e ) s.setWidth(ConstellationDisplayFrame->width()); s.setHeight(ConstellationDisplayFrame->height()); emit _constellationDisplayPlot->resizeSlot(&s); + */ } void @@ -299,8 +302,8 @@ SpectrumDisplayForm::customEvent( QEvent * e) //FFTSizeComboBox->setCurrentIndex(1); } - waterfallMinimumIntensityChangedCB(WaterfallMinimumIntensityWheel->value()); - waterfallMaximumIntensityChangedCB(WaterfallMaximumIntensityWheel->value()); + //waterfallMinimumIntensityChangedCB(WaterfallMinimumIntensityWheel->value()); + //waterfallMaximumIntensityChangedCB(WaterfallMaximumIntensityWheel->value()); // Clear any previous display Reset(); @@ -333,9 +336,9 @@ SpectrumDisplayForm::UpdateGuiTimer() // This is called by the displayTimer and redraws the canvases of // all of the plots. _frequencyDisplayPlot->canvas()->update(); - _waterfallDisplayPlot->canvas()->update(); - _timeDomainDisplayPlot->canvas()->update(); - _constellationDisplayPlot->canvas()->update(); + //_waterfallDisplayPlot->canvas()->update(); + //_timeDomainDisplayPlot->canvas()->update(); + //_constellationDisplayPlot->canvas()->update(); } @@ -417,6 +420,7 @@ SpectrumDisplayForm::SetFrequencyRange(const double newCenterFrequency, _centerFrequency, UseRFFrequenciesCheckBox->isChecked(), units, strunits[iunit]); + /* _waterfallDisplayPlot->SetFrequencyRange(_startFrequency, _stopFrequency, _centerFrequency, @@ -424,6 +428,7 @@ SpectrumDisplayForm::SetFrequencyRange(const double newCenterFrequency, units, strunits[iunit]); _timeDomainDisplayPlot->SetSampleRate(_stopFrequency - _startFrequency, units, strtime[iunit]); + */ } } @@ -512,7 +517,7 @@ SpectrumDisplayForm::Reset() { AverageDataReset(); - _waterfallDisplayPlot->Reset(); + //_waterfallDisplayPlot->Reset(); } @@ -561,6 +566,7 @@ SpectrumDisplayForm::UseRFFrequenciesCB( bool useRFFlag ) void SpectrumDisplayForm::waterfallMaximumIntensityChangedCB( double newValue ) { + /* if(newValue > WaterfallMinimumIntensityWheel->value()){ WaterfallMaximumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0)); } @@ -570,12 +576,14 @@ SpectrumDisplayForm::waterfallMaximumIntensityChangedCB( double newValue ) _waterfallDisplayPlot->SetIntensityRange(WaterfallMinimumIntensityWheel->value(), WaterfallMaximumIntensityWheel->value()); + */ } void SpectrumDisplayForm::waterfallMinimumIntensityChangedCB( double newValue ) { + /* if(newValue < WaterfallMaximumIntensityWheel->value()){ WaterfallMinimumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0)); } @@ -585,6 +593,7 @@ SpectrumDisplayForm::waterfallMinimumIntensityChangedCB( double newValue ) _waterfallDisplayPlot->SetIntensityRange(WaterfallMinimumIntensityWheel->value(), WaterfallMaximumIntensityWheel->value()); + */ } void @@ -599,6 +608,7 @@ SpectrumDisplayForm::FFTComboBoxSelectedCB( const QString &fftSizeString ) void SpectrumDisplayForm::WaterfallAutoScaleBtnCB() { + /* double minimumIntensity = _noiseFloorAmplitude - 5; if(minimumIntensity < WaterfallMinimumIntensityWheel->minValue()){ minimumIntensity = WaterfallMinimumIntensityWheel->minValue(); @@ -610,11 +620,13 @@ SpectrumDisplayForm::WaterfallAutoScaleBtnCB() } WaterfallMaximumIntensityWheel->setValue(maximumIntensity); waterfallMaximumIntensityChangedCB(maximumIntensity); + */ } void SpectrumDisplayForm::WaterfallIntensityColorTypeChanged( int newType ) { + /* QColor lowIntensityColor; QColor highIntensityColor; if(newType == WaterfallDisplayPlot::INTENSITY_COLOR_MAP_TYPE_USER_DEFINED){ @@ -636,6 +648,7 @@ SpectrumDisplayForm::WaterfallIntensityColorTypeChanged( int newType ) } _waterfallDisplayPlot->SetIntensityColorMapType(newType, lowIntensityColor, highIntensityColor); + */ } void @@ -656,6 +669,7 @@ SpectrumDisplayForm::ToggleTabFrequency(const bool state) void SpectrumDisplayForm::ToggleTabWaterfall(const bool state) { + /* if(state == true) { if(d_plot_waterfall == -1) { SpectrumTypeTab->addTab(WaterfallPage, "Waterfall Display"); @@ -666,11 +680,13 @@ SpectrumDisplayForm::ToggleTabWaterfall(const bool state) SpectrumTypeTab->removeTab(SpectrumTypeTab->indexOf(WaterfallPage)); d_plot_waterfall = -1; } + */ } void SpectrumDisplayForm::ToggleTabTime(const bool state) { + /* if(state == true) { if(d_plot_time == -1) { SpectrumTypeTab->addTab(TimeDomainPage, "Time Domain Display"); @@ -681,11 +697,13 @@ SpectrumDisplayForm::ToggleTabTime(const bool state) SpectrumTypeTab->removeTab(SpectrumTypeTab->indexOf(TimeDomainPage)); d_plot_time = -1; } + */ } void SpectrumDisplayForm::ToggleTabConstellation(const bool state) { + /* if(state == true) { if(d_plot_constellation == -1) { SpectrumTypeTab->addTab(ConstellationPage, "Constellation Display"); @@ -696,26 +714,27 @@ SpectrumDisplayForm::ToggleTabConstellation(const bool state) SpectrumTypeTab->removeTab(SpectrumTypeTab->indexOf(ConstellationPage)); d_plot_constellation = -1; } + */ } void SpectrumDisplayForm::SetTimeDomainAxis(double min, double max) { - _timeDomainDisplayPlot->setYaxis(min, max); + //_timeDomainDisplayPlot->setYaxis(min, max); } void SpectrumDisplayForm::SetConstellationAxis(double xmin, double xmax, double ymin, double ymax) { - _constellationDisplayPlot->set_axis(xmin, xmax, ymin, ymax); + //_constellationDisplayPlot->set_axis(xmin, xmax, ymin, ymax); } void SpectrumDisplayForm::SetConstellationPenSize(int size) { - _constellationDisplayPlot->set_pen_size( size ); + //_constellationDisplayPlot->set_pen_size( size ); } void -- cgit From 33158da478cb0db5739663556e8dbeccbf08d7c9 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 16 Oct 2011 00:19:10 -0400 Subject: qtgui: Time domain plot working againt under qwt6. --- gr-qtgui/lib/spectrumdisplayform.cc | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'gr-qtgui/lib/spectrumdisplayform.cc') diff --git a/gr-qtgui/lib/spectrumdisplayform.cc b/gr-qtgui/lib/spectrumdisplayform.cc index f52f96241..8c9cc085f 100644 --- a/gr-qtgui/lib/spectrumdisplayform.cc +++ b/gr-qtgui/lib/spectrumdisplayform.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009,2010,2011 Free Software Foundation, Inc. + * Copyright 2008-2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -35,16 +35,15 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) _intValidator->setBottom(0); _frequencyDisplayPlot = new FrequencyDisplayPlot(FrequencyPlotDisplayFrame); //_waterfallDisplayPlot = new WaterfallDisplayPlot(WaterfallPlotDisplayFrame); - - //_timeDomainDisplayPlot = new TimeDomainDisplayPlot(2, TimeDomainDisplayFrame); + _timeDomainDisplayPlot = new TimeDomainDisplayPlot(2, TimeDomainDisplayFrame); //_constellationDisplayPlot = new ConstellationDisplayPlot(ConstellationDisplayFrame); _numRealDataPoints = 1024; _realFFTDataPoints = new double[_numRealDataPoints]; _averagedValues = new double[_numRealDataPoints]; _historyVector = new std::vector; - //_timeDomainDisplayPlot->setTitle(0, "real"); - //_timeDomainDisplayPlot->setTitle(1, "imag"); + _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 ); @@ -78,7 +77,7 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) ToggleTabFrequency(false); //ToggleTabWaterfall(false); - //ToggleTabTime(false); + ToggleTabTime(false); //ToggleTabConstellation(false); _historyEntry = 0; @@ -95,8 +94,8 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) //connect(_waterfallDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), // this, SLOT(onWFallPlotPointSelected(const QPointF))); - //connect(_timeDomainDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), - // this, SLOT(onTimePlotPointSelected(const QPointF))); + connect(_timeDomainDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), + this, SLOT(onTimePlotPointSelected(const QPointF))); //connect(_constellationDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), // this, SLOT(onConstPlotPointSelected(const QPointF))); @@ -238,12 +237,12 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate _noiseFloorAmplitude, _peakFrequency, _peakAmplitude, d_update_time); } - /* if(tabindex == d_plot_time) { _timeDomainDisplayPlot->PlotNewData(timeDomainDataPoints, numTimeDomainDataPoints, d_update_time); - } + } + /* if(tabindex == d_plot_constellation) { _constellationDisplayPlot->PlotNewData(realTimeDomainDataPoints, imagTimeDomainDataPoints, @@ -277,11 +276,11 @@ SpectrumDisplayForm::resizeEvent( QResizeEvent *e ) s.setHeight(FrequencyPlotDisplayFrame->height()); emit _frequencyDisplayPlot->resizeSlot(&s); - /* s.setWidth(TimeDomainDisplayFrame->width()); s.setHeight(TimeDomainDisplayFrame->height()); emit _timeDomainDisplayPlot->resizeSlot(&s); + /* s.setWidth(WaterfallPlotDisplayFrame->width()); s.setHeight(WaterfallPlotDisplayFrame->height()); emit _waterfallDisplayPlot->resizeSlot(&s); @@ -337,7 +336,7 @@ SpectrumDisplayForm::UpdateGuiTimer() // all of the plots. _frequencyDisplayPlot->canvas()->update(); //_waterfallDisplayPlot->canvas()->update(); - //_timeDomainDisplayPlot->canvas()->update(); + _timeDomainDisplayPlot->canvas()->update(); //_constellationDisplayPlot->canvas()->update(); } @@ -426,9 +425,9 @@ SpectrumDisplayForm::SetFrequencyRange(const double newCenterFrequency, _centerFrequency, UseRFFrequenciesCheckBox->isChecked(), units, strunits[iunit]); + */ _timeDomainDisplayPlot->SetSampleRate(_stopFrequency - _startFrequency, units, strtime[iunit]); - */ } } @@ -686,7 +685,6 @@ SpectrumDisplayForm::ToggleTabWaterfall(const bool state) void SpectrumDisplayForm::ToggleTabTime(const bool state) { - /* if(state == true) { if(d_plot_time == -1) { SpectrumTypeTab->addTab(TimeDomainPage, "Time Domain Display"); @@ -697,7 +695,6 @@ SpectrumDisplayForm::ToggleTabTime(const bool state) SpectrumTypeTab->removeTab(SpectrumTypeTab->indexOf(TimeDomainPage)); d_plot_time = -1; } - */ } void @@ -721,7 +718,7 @@ SpectrumDisplayForm::ToggleTabConstellation(const bool state) void SpectrumDisplayForm::SetTimeDomainAxis(double min, double max) { - //_timeDomainDisplayPlot->setYaxis(min, max); + _timeDomainDisplayPlot->setYaxis(min, max); } void -- cgit From 4ba2c75f9109b750f8c04b60a04f2100e33e9416 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 16 Oct 2011 00:23:32 -0400 Subject: qtgui: constellation plot working again under qwt6. --- gr-qtgui/lib/spectrumdisplayform.cc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'gr-qtgui/lib/spectrumdisplayform.cc') diff --git a/gr-qtgui/lib/spectrumdisplayform.cc b/gr-qtgui/lib/spectrumdisplayform.cc index 8c9cc085f..6f82c03ff 100644 --- a/gr-qtgui/lib/spectrumdisplayform.cc +++ b/gr-qtgui/lib/spectrumdisplayform.cc @@ -36,7 +36,7 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) _frequencyDisplayPlot = new FrequencyDisplayPlot(FrequencyPlotDisplayFrame); //_waterfallDisplayPlot = new WaterfallDisplayPlot(WaterfallPlotDisplayFrame); _timeDomainDisplayPlot = new TimeDomainDisplayPlot(2, TimeDomainDisplayFrame); - //_constellationDisplayPlot = new ConstellationDisplayPlot(ConstellationDisplayFrame); + _constellationDisplayPlot = new ConstellationDisplayPlot(ConstellationDisplayFrame); _numRealDataPoints = 1024; _realFFTDataPoints = new double[_numRealDataPoints]; _averagedValues = new double[_numRealDataPoints]; @@ -78,7 +78,7 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) ToggleTabFrequency(false); //ToggleTabWaterfall(false); ToggleTabTime(false); - //ToggleTabConstellation(false); + ToggleTabConstellation(false); _historyEntry = 0; _historyEntryCount = 0; @@ -97,8 +97,8 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) connect(_timeDomainDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), this, SLOT(onTimePlotPointSelected(const QPointF))); - //connect(_constellationDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), - // this, SLOT(onConstPlotPointSelected(const QPointF))); + connect(_constellationDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), + this, SLOT(onConstPlotPointSelected(const QPointF))); } SpectrumDisplayForm::~SpectrumDisplayForm() @@ -242,7 +242,6 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate numTimeDomainDataPoints, d_update_time); } - /* if(tabindex == d_plot_constellation) { _constellationDisplayPlot->PlotNewData(realTimeDomainDataPoints, imagTimeDomainDataPoints, @@ -250,6 +249,7 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate d_update_time); } + /* // Don't update the repeated data for the waterfall if(!repeatDataFlag){ if(tabindex == d_plot_waterfall) { @@ -284,11 +284,11 @@ SpectrumDisplayForm::resizeEvent( QResizeEvent *e ) s.setWidth(WaterfallPlotDisplayFrame->width()); s.setHeight(WaterfallPlotDisplayFrame->height()); emit _waterfallDisplayPlot->resizeSlot(&s); + */ s.setWidth(ConstellationDisplayFrame->width()); s.setHeight(ConstellationDisplayFrame->height()); emit _constellationDisplayPlot->resizeSlot(&s); - */ } void @@ -337,7 +337,7 @@ SpectrumDisplayForm::UpdateGuiTimer() _frequencyDisplayPlot->canvas()->update(); //_waterfallDisplayPlot->canvas()->update(); _timeDomainDisplayPlot->canvas()->update(); - //_constellationDisplayPlot->canvas()->update(); + _constellationDisplayPlot->canvas()->update(); } @@ -700,7 +700,6 @@ SpectrumDisplayForm::ToggleTabTime(const bool state) void SpectrumDisplayForm::ToggleTabConstellation(const bool state) { - /* if(state == true) { if(d_plot_constellation == -1) { SpectrumTypeTab->addTab(ConstellationPage, "Constellation Display"); @@ -711,7 +710,6 @@ SpectrumDisplayForm::ToggleTabConstellation(const bool state) SpectrumTypeTab->removeTab(SpectrumTypeTab->indexOf(ConstellationPage)); d_plot_constellation = -1; } - */ } @@ -725,13 +723,13 @@ void SpectrumDisplayForm::SetConstellationAxis(double xmin, double xmax, double ymin, double ymax) { - //_constellationDisplayPlot->set_axis(xmin, xmax, ymin, ymax); + _constellationDisplayPlot->set_axis(xmin, xmax, ymin, ymax); } void SpectrumDisplayForm::SetConstellationPenSize(int size) { - //_constellationDisplayPlot->set_pen_size( size ); + _constellationDisplayPlot->set_pen_size( size ); } void -- cgit From 4496fae2deea200755225c007a26f4c7be0470e9 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 16 Oct 2011 16:32:41 -0400 Subject: qtgui: waterfall plot mostly working under qwt6 (plots, but updates to scale and color not working yet). --- gr-qtgui/lib/spectrumdisplayform.cc | 51 +++++++++++++------------------------ 1 file changed, 17 insertions(+), 34 deletions(-) (limited to 'gr-qtgui/lib/spectrumdisplayform.cc') diff --git a/gr-qtgui/lib/spectrumdisplayform.cc b/gr-qtgui/lib/spectrumdisplayform.cc index 6f82c03ff..9fe553557 100644 --- a/gr-qtgui/lib/spectrumdisplayform.cc +++ b/gr-qtgui/lib/spectrumdisplayform.cc @@ -34,7 +34,7 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) _intValidator = new QIntValidator(this); _intValidator->setBottom(0); _frequencyDisplayPlot = new FrequencyDisplayPlot(FrequencyPlotDisplayFrame); - //_waterfallDisplayPlot = new WaterfallDisplayPlot(WaterfallPlotDisplayFrame); + _waterfallDisplayPlot = new WaterfallDisplayPlot(WaterfallPlotDisplayFrame); _timeDomainDisplayPlot = new TimeDomainDisplayPlot(2, TimeDomainDisplayFrame); _constellationDisplayPlot = new ConstellationDisplayPlot(ConstellationDisplayFrame); _numRealDataPoints = 1024; @@ -49,21 +49,21 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) MinHoldCheckBox_toggled( false ); MaxHoldCheckBox_toggled( false ); - //WaterfallMaximumIntensityWheel->setRange(-200, 0); - //WaterfallMaximumIntensityWheel->setTickCnt(50); - //WaterfallMinimumIntensityWheel->setRange(-200, 0); - //WaterfallMinimumIntensityWheel->setTickCnt(50); - //WaterfallMinimumIntensityWheel->setValue(-200); + WaterfallMaximumIntensityWheel->setRange(-200, 0); + WaterfallMaximumIntensityWheel->setTickCnt(50); + WaterfallMinimumIntensityWheel->setRange(-200, 0); + WaterfallMinimumIntensityWheel->setTickCnt(50); + WaterfallMinimumIntensityWheel->setValue(-200); _peakFrequency = 0; _peakAmplitude = -HUGE_VAL; _noiseFloorAmplitude = -HUGE_VAL; - //connect(_waterfallDisplayPlot, SIGNAL(UpdatedLowerIntensityLevel(const double)), - // _frequencyDisplayPlot, SLOT(SetLowerIntensityLevel(const double))); - //connect(_waterfallDisplayPlot, SIGNAL(UpdatedUpperIntensityLevel(const double)), - // _frequencyDisplayPlot, SLOT(SetUpperIntensityLevel(const double))); + connect(_waterfallDisplayPlot, SIGNAL(UpdatedLowerIntensityLevel(const double)), + _frequencyDisplayPlot, SLOT(SetLowerIntensityLevel(const double))); + connect(_waterfallDisplayPlot, SIGNAL(UpdatedUpperIntensityLevel(const double)), + _frequencyDisplayPlot, SLOT(SetUpperIntensityLevel(const double))); _frequencyDisplayPlot->SetLowerIntensityLevel(-200); _frequencyDisplayPlot->SetUpperIntensityLevel(-200); @@ -76,7 +76,7 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) Reset(); ToggleTabFrequency(false); - //ToggleTabWaterfall(false); + ToggleTabWaterfall(false); ToggleTabTime(false); ToggleTabConstellation(false); @@ -91,8 +91,8 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) connect(_frequencyDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), this, SLOT(onFFTPlotPointSelected(const QPointF))); - //connect(_waterfallDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), - // this, SLOT(onWFallPlotPointSelected(const QPointF))); + connect(_waterfallDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), + this, SLOT(onWFallPlotPointSelected(const QPointF))); connect(_timeDomainDisplayPlot, SIGNAL(plotPointSelected(const QPointF)), this, SLOT(onTimePlotPointSelected(const QPointF))); @@ -249,7 +249,6 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate d_update_time); } - /* // Don't update the repeated data for the waterfall if(!repeatDataFlag){ if(tabindex == d_plot_waterfall) { @@ -258,7 +257,6 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate spectrumUpdateEvent->getDroppedFFTFrames()); } } - */ // Tell the system the GUI has been updated if(_systemSpecifiedFlag){ @@ -280,11 +278,9 @@ SpectrumDisplayForm::resizeEvent( QResizeEvent *e ) s.setHeight(TimeDomainDisplayFrame->height()); emit _timeDomainDisplayPlot->resizeSlot(&s); - /* s.setWidth(WaterfallPlotDisplayFrame->width()); s.setHeight(WaterfallPlotDisplayFrame->height()); emit _waterfallDisplayPlot->resizeSlot(&s); - */ s.setWidth(ConstellationDisplayFrame->width()); s.setHeight(ConstellationDisplayFrame->height()); @@ -298,11 +294,10 @@ SpectrumDisplayForm::customEvent( QEvent * e) if(_systemSpecifiedFlag){ WindowComboBox->setCurrentIndex(_system->GetWindowType()); FFTSizeComboBox->setCurrentIndex(_system->GetFFTSizeIndex()); - //FFTSizeComboBox->setCurrentIndex(1); } - //waterfallMinimumIntensityChangedCB(WaterfallMinimumIntensityWheel->value()); - //waterfallMaximumIntensityChangedCB(WaterfallMaximumIntensityWheel->value()); + waterfallMinimumIntensityChangedCB(WaterfallMinimumIntensityWheel->value()); + waterfallMaximumIntensityChangedCB(WaterfallMaximumIntensityWheel->value()); // Clear any previous display Reset(); @@ -335,7 +330,7 @@ SpectrumDisplayForm::UpdateGuiTimer() // This is called by the displayTimer and redraws the canvases of // all of the plots. _frequencyDisplayPlot->canvas()->update(); - //_waterfallDisplayPlot->canvas()->update(); + _waterfallDisplayPlot->canvas()->update(); _timeDomainDisplayPlot->canvas()->update(); _constellationDisplayPlot->canvas()->update(); } @@ -419,13 +414,11 @@ SpectrumDisplayForm::SetFrequencyRange(const double newCenterFrequency, _centerFrequency, UseRFFrequenciesCheckBox->isChecked(), units, strunits[iunit]); - /* _waterfallDisplayPlot->SetFrequencyRange(_startFrequency, _stopFrequency, _centerFrequency, UseRFFrequenciesCheckBox->isChecked(), units, strunits[iunit]); - */ _timeDomainDisplayPlot->SetSampleRate(_stopFrequency - _startFrequency, units, strtime[iunit]); } @@ -516,7 +509,7 @@ SpectrumDisplayForm::Reset() { AverageDataReset(); - //_waterfallDisplayPlot->Reset(); + _waterfallDisplayPlot->Reset(); } @@ -565,7 +558,6 @@ SpectrumDisplayForm::UseRFFrequenciesCB( bool useRFFlag ) void SpectrumDisplayForm::waterfallMaximumIntensityChangedCB( double newValue ) { - /* if(newValue > WaterfallMinimumIntensityWheel->value()){ WaterfallMaximumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0)); } @@ -575,14 +567,12 @@ SpectrumDisplayForm::waterfallMaximumIntensityChangedCB( double newValue ) _waterfallDisplayPlot->SetIntensityRange(WaterfallMinimumIntensityWheel->value(), WaterfallMaximumIntensityWheel->value()); - */ } void SpectrumDisplayForm::waterfallMinimumIntensityChangedCB( double newValue ) { - /* if(newValue < WaterfallMaximumIntensityWheel->value()){ WaterfallMinimumIntensityLabel->setText(QString("%1 dB").arg(newValue, 0, 'f', 0)); } @@ -592,7 +582,6 @@ SpectrumDisplayForm::waterfallMinimumIntensityChangedCB( double newValue ) _waterfallDisplayPlot->SetIntensityRange(WaterfallMinimumIntensityWheel->value(), WaterfallMaximumIntensityWheel->value()); - */ } void @@ -607,7 +596,6 @@ SpectrumDisplayForm::FFTComboBoxSelectedCB( const QString &fftSizeString ) void SpectrumDisplayForm::WaterfallAutoScaleBtnCB() { - /* double minimumIntensity = _noiseFloorAmplitude - 5; if(minimumIntensity < WaterfallMinimumIntensityWheel->minValue()){ minimumIntensity = WaterfallMinimumIntensityWheel->minValue(); @@ -619,13 +607,11 @@ SpectrumDisplayForm::WaterfallAutoScaleBtnCB() } WaterfallMaximumIntensityWheel->setValue(maximumIntensity); waterfallMaximumIntensityChangedCB(maximumIntensity); - */ } void SpectrumDisplayForm::WaterfallIntensityColorTypeChanged( int newType ) { - /* QColor lowIntensityColor; QColor highIntensityColor; if(newType == WaterfallDisplayPlot::INTENSITY_COLOR_MAP_TYPE_USER_DEFINED){ @@ -647,7 +633,6 @@ SpectrumDisplayForm::WaterfallIntensityColorTypeChanged( int newType ) } _waterfallDisplayPlot->SetIntensityColorMapType(newType, lowIntensityColor, highIntensityColor); - */ } void @@ -668,7 +653,6 @@ SpectrumDisplayForm::ToggleTabFrequency(const bool state) void SpectrumDisplayForm::ToggleTabWaterfall(const bool state) { - /* if(state == true) { if(d_plot_waterfall == -1) { SpectrumTypeTab->addTab(WaterfallPage, "Waterfall Display"); @@ -679,7 +663,6 @@ SpectrumDisplayForm::ToggleTabWaterfall(const bool state) SpectrumTypeTab->removeTab(SpectrumTypeTab->indexOf(WaterfallPage)); d_plot_waterfall = -1; } - */ } void -- cgit