[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r10611 - in gnuradio/branches/releases/3.2: . config g
From: |
jcorgan |
Subject: |
[Commit-gnuradio] r10611 - in gnuradio/branches/releases/3.2: . config gr-qtgui/src/lib gr-qtgui/src/python |
Date: |
Sun, 15 Mar 2009 13:19:48 -0600 (MDT) |
Author: jcorgan
Date: 2009-03-15 13:19:48 -0600 (Sun, 15 Mar 2009)
New Revision: 10611
Added:
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/ConstellationDisplayPlot.cc
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/ConstellationDisplayPlot.h
gnuradio/branches/releases/3.2/gr-qtgui/src/python/qt_digital.py
Modified:
gnuradio/branches/releases/3.2/
gnuradio/branches/releases/3.2/config/grc_gr_qtgui.m4
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/Makefile.am
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/SpectrumGUIClass.cc
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/qtgui.i
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/qtgui_sink_c.cc
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/qtgui_sink_c.h
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/spectrumdisplayform.cc
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/spectrumdisplayform.h
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/spectrumdisplayform.ui
gnuradio/branches/releases/3.2/gr-qtgui/src/python/qttest_c.py
Log:
Applied changesets r10535, r10536:10538, r10550, r10565 to release 3.2 branch.
Property changes on: gnuradio/branches/releases/3.2
___________________________________________________________________
Modified: svn:mergeinfo
-
/gnuradio/trunk:10356-10359,10481-10482,10497-10499,10506-10507,10511,10514,10521,10523-10524,10529,10531,10578,10600
+
/gnuradio/trunk:10356-10359,10481-10482,10497-10499,10506-10507,10511,10514,10521,10523-10524,10529,10531,10535,10537-10538,10550,10565,10578,10600
Modified: gnuradio/branches/releases/3.2/config/grc_gr_qtgui.m4
===================================================================
--- gnuradio/branches/releases/3.2/config/grc_gr_qtgui.m4 2009-03-15
19:10:22 UTC (rev 10610)
+++ gnuradio/branches/releases/3.2/config/grc_gr_qtgui.m4 2009-03-15
19:19:48 UTC (rev 10611)
@@ -41,12 +41,12 @@
if test $passed = yes; then
dnl Check for package qt or qt-mt, set QT_CFLAGS and QT_LIBS
- PKG_CHECK_MODULES(QTCORE, QtCore >= 4.3.4, [],
- [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtCore.])])
- PKG_CHECK_MODULES(QTGUI, QtGui >= 4.3.4, [],
- [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtGui.])])
- PKG_CHECK_MODULES(QTOPENGL, QtOpenGL >= 4.3.4, [],
- [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtOpenGL.])])
+ PKG_CHECK_MODULES(QTCORE, QtCore >= 4.2, [],
+ [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtCore >= 4.2.])])
+ PKG_CHECK_MODULES(QTGUI, QtGui >= 4.2, [],
+ [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtGui >= 4.2.])])
+ PKG_CHECK_MODULES(QTOPENGL, QtOpenGL >= 4.2, [],
+ [passed=no; AC_MSG_RESULT([gr-qtgui requires libQtOpenGL >- 4.2.])])
dnl Fetch QWT variables
GR_QWT([], [passed=no])
Property changes on: gnuradio/branches/releases/3.2/gr-qtgui/src/lib
___________________________________________________________________
Modified: svn:ignore
- Makefile
Makefile.in
.libs
.deps
qtgui.cc
qtgui.py
WaterfallDisplayPlot_moc.cc
Waterfall3DDisplayPlot_moc.cc
TimeDomainDisplayPlot_moc.cc
spectrumdisplayform_moc.cc
spectrumdisplayform_ui.h
FrequencyDisplayPlot_moc.cc
+ Makefile
Makefile.in
.libs
.deps
qtgui.cc
qtgui.py
WaterfallDisplayPlot_moc.cc
Waterfall3DDisplayPlot_moc.cc
TimeDomainDisplayPlot_moc.cc
spectrumdisplayform_moc.cc
spectrumdisplayform_ui.h
FrequencyDisplayPlot_moc.cc
ConstellationDisplayPlot_moc.cc
Copied:
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/ConstellationDisplayPlot.cc
(from rev 10538, gnuradio/trunk/gr-qtgui/src/lib/ConstellationDisplayPlot.cc)
===================================================================
--- gnuradio/branches/releases/3.2/gr-qtgui/src/lib/ConstellationDisplayPlot.cc
(rev 0)
+++ gnuradio/branches/releases/3.2/gr-qtgui/src/lib/ConstellationDisplayPlot.cc
2009-03-15 19:19:48 UTC (rev 10611)
@@ -0,0 +1,167 @@
+#ifndef CONSTELLATION_DISPLAY_PLOT_C
+#define CONSTELLATION_DISPLAY_PLOT_C
+
+#include <ConstellationDisplayPlot.h>
+
+#include <qwt_scale_draw.h>
+#include <qwt_legend.h>
+
+
+class ConstellationDisplayZoomer: public QwtPlotZoomer
+{
+public:
+ ConstellationDisplayZoomer(QwtPlotCanvas* canvas):QwtPlotZoomer(canvas)
+ {
+ setTrackerMode(QwtPicker::AlwaysOn);
+ }
+
+ virtual ~ConstellationDisplayZoomer(){
+
+ }
+
+ virtual void updateTrackerText(){
+ updateDisplay();
+ }
+
+protected:
+ virtual QwtText trackerText( const QwtDoublePoint& p ) const
+ {
+ QwtText t(QString("Sample %1, %2 V").arg(p.x(), 0, 'f', 0).arg(p.y(), 0,
'f', 4));
+
+ return t;
+ }
+};
+
+ConstellationDisplayPlot::ConstellationDisplayPlot(QWidget*
parent):QwtPlot(parent){
+ timespec_reset(&_lastReplot);
+
+ resize(parent->width(), parent->height());
+
+ _displayIntervalTime = (1.0/10.0); // 1/10 of a second between updates
+
+ _numPoints = 1024;
+ _realDataPoints = new double[_numPoints];
+ _imagDataPoints = new double[_numPoints];
+
+ // Disable polygon clipping
+ QwtPainter::setDeviceClipping(false);
+
+ // We don't need the cache here
+ canvas()->setPaintAttribute(QwtPlotCanvas::PaintCached, false);
+ canvas()->setPaintAttribute(QwtPlotCanvas::PaintPacked, false);
+
+ QPalette palette;
+ palette.setColor(canvas()->backgroundRole(), QColor("white"));
+ canvas()->setPalette(palette);
+
+ setAxisScaleEngine(QwtPlot::xBottom, new QwtLinearScaleEngine);
+ setAxisScale(QwtPlot::xBottom, -1.0, 1.0);
+ setAxisTitle(QwtPlot::xBottom, "In-phase");
+
+ setAxisScaleEngine(QwtPlot::yLeft, new QwtLinearScaleEngine);
+ setAxisScale(QwtPlot::yLeft, -1.0, 1.0);
+ setAxisTitle(QwtPlot::yLeft, "Quadrature");
+
+ // Automatically deleted when parent is deleted
+ _plot_curve = new QwtPlotCurve("Constellation Points");
+ _plot_curve->attach(this);
+ _plot_curve->setPen(QPen(Qt::blue, 5, Qt::SolidLine, Qt::RoundCap,
Qt::RoundJoin));
+ _plot_curve->setStyle(QwtPlotCurve::Dots);
+ _plot_curve->setRawData(_realDataPoints, _imagDataPoints, _numPoints);
+
+ memset(_realDataPoints, 0x0, _numPoints*sizeof(double));
+ memset(_imagDataPoints, 0x0, _numPoints*sizeof(double));
+
+ replot();
+
+ _zoomer = new ConstellationDisplayZoomer(canvas());
+#if QT_VERSION < 0x040000
+ _zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
+ Qt::RightButton, Qt::ControlModifier);
+#else
+ _zoomer->setMousePattern(QwtEventPattern::MouseSelect2,
+ Qt::RightButton, Qt::ControlModifier);
+#endif
+ _zoomer->setMousePattern(QwtEventPattern::MouseSelect3,
+ Qt::RightButton);
+
+ _panner = new QwtPlotPanner(canvas());
+ _panner->setAxisEnabled(QwtPlot::yRight, false);
+ _panner->setMouseButton(Qt::MidButton);
+
+ // Avoid jumping when labels with more/less digits
+ // appear/disappear when scrolling vertically
+
+ const QFontMetrics fm(axisWidget(QwtPlot::yLeft)->font());
+ QwtScaleDraw *sd = axisScaleDraw(QwtPlot::yLeft);
+ sd->setMinimumExtent( fm.width("100.00") );
+
+ const QColor c(Qt::darkRed);
+ _zoomer->setRubberBandPen(c);
+ _zoomer->setTrackerPen(c);
+
+ QwtLegend* legendDisplay = new QwtLegend(this);
+ legendDisplay->setItemMode(QwtLegend::CheckableItem);
+ insertLegend(legendDisplay);
+
+ connect(this, SIGNAL( legendChecked(QwtPlotItem *, bool ) ), this, SLOT(
LegendEntryChecked(QwtPlotItem *, bool ) ));
+}
+
+ConstellationDisplayPlot::~ConstellationDisplayPlot(){
+ delete[] _realDataPoints;
+ delete[] _imagDataPoints;
+
+ // _fft_plot_curves deleted when parent deleted
+ // _zoomer and _panner deleted when parent deleted
+}
+
+
+
+void ConstellationDisplayPlot::replot(){
+
+ const timespec startTime = get_highres_clock();
+
+ QwtPlot::replot();
+
+ double differenceTime = (diff_timespec(get_highres_clock(), startTime));
+
+ differenceTime *= 99.0;
+ // Require at least a 10% duty cycle
+ if(differenceTime > (1.0/10.0)){
+ _displayIntervalTime = differenceTime;
+ }
+}
+
+void ConstellationDisplayPlot::PlotNewData(const double* realDataPoints, const
double* imagDataPoints, const int64_t numDataPoints){
+ if(numDataPoints > 0){
+
+ if(numDataPoints != _numPoints){
+ _numPoints = numDataPoints;
+
+ delete[] _realDataPoints;
+ delete[] _imagDataPoints;
+ _realDataPoints = new double[_numPoints];
+ _imagDataPoints = new double[_numPoints];
+
+ _plot_curve->setRawData(_realDataPoints, _imagDataPoints, _numPoints);
+ }
+ memcpy(_realDataPoints, realDataPoints, numDataPoints*sizeof(double));
+ memcpy(_imagDataPoints, imagDataPoints, numDataPoints*sizeof(double));
+
+ }
+
+ // Allow at least a 50% duty cycle
+ if(diff_timespec(get_highres_clock(), _lastReplot) > _displayIntervalTime){
+ // Only replot the screen if it is visible
+ if(isVisible()){
+ replot();
+ }
+ _lastReplot = get_highres_clock();
+ }
+}
+
+void ConstellationDisplayPlot::LegendEntryChecked(QwtPlotItem* plotItem, bool
on){
+ plotItem->setVisible(!on);
+}
+
+#endif /* CONSTELLATION_DISPLAY_PLOT_C */
Copied:
gnuradio/branches/releases/3.2/gr-qtgui/src/lib/ConstellationDisplayPlot.h
(from rev 10538, gnuradio/trunk/gr-qtgui/src/lib/ConstellationDisplayPlot.h)
===================================================================
--- gnuradio/branches/releases/3.2/gr-qtgui/src/lib/ConstellationDisplayPlot.h
(rev 0)
+++ gnuradio/branches/releases/3.2/gr-qtgui/src/lib/ConstellationDisplayPlot.h
2009-03-15 19:19:48 UTC (rev 10611)
@@ -0,0 +1,49 @@
+#ifndef CONSTELLATION_DISPLAY_PLOT_HPP
+#define CONSTELLATION_DISPLAY_PLOT_HPP
+
+#include <qwt_plot.h>
+#include <qwt_painter.h>
+#include <qwt_plot_canvas.h>
+#include <qwt_plot_curve.h>
+#include <qwt_scale_engine.h>
+#include <qwt_scale_widget.h>
+#include <qwt_plot_zoomer.h>
+#include <qwt_plot_panner.h>
+#include <qwt_plot_marker.h>
+#include <highResTimeFunctions.h>
+#include <qwt_symbol.h>
+
+class ConstellationDisplayPlot:public QwtPlot{
+ Q_OBJECT
+
+public:
+ ConstellationDisplayPlot(QWidget*);
+ virtual ~ConstellationDisplayPlot();
+
+ void PlotNewData(const double* realDataPoints, const double* imagDataPoints,
+ const int64_t numDataPoints);
+
+ virtual void replot();
+
+protected slots:
+ void LegendEntryChecked(QwtPlotItem *plotItem, bool on);
+
+protected:
+
+private:
+ QwtPlotCurve* _plot_curve;
+
+ QwtPlotPanner* _panner;
+ QwtPlotZoomer* _zoomer;
+
+ double* _realDataPoints;
+ double* _imagDataPoints;
+
+ timespec _lastReplot;
+
+ int64_t _numPoints;
+
+ double _displayIntervalTime;
+};
+
+#endif /* CONSTELLATION_DISPLAY_PLOT_HPP */
Modified: gnuradio/branches/releases/3.2/gr-qtgui/src/lib/Makefile.am
===================================================================
--- gnuradio/branches/releases/3.2/gr-qtgui/src/lib/Makefile.am 2009-03-15
19:10:22 UTC (rev 10610)
+++ gnuradio/branches/releases/3.2/gr-qtgui/src/lib/Makefile.am 2009-03-15
19:19:48 UTC (rev 10611)
@@ -54,6 +54,7 @@
TimeDomainDisplayPlot_moc.cc \
WaterfallDisplayPlot_moc.cc \
Waterfall3DDisplayPlot_moc.cc \
+ ConstellationDisplayPlot_moc.cc \
spectrumdisplayform_ui.h
endif
@@ -76,12 +77,13 @@
# These are the source files that go into the shared library
libqtgui_la_SOURCES = \
- spectrumdisplayform.cc \
FrequencyDisplayPlot.cc \
TimeDomainDisplayPlot.cc \
WaterfallDisplayPlot.cc \
Waterfall3DDisplayPlot.cc \
waterfallGlobalData.cc \
+ ConstellationDisplayPlot.cc \
+ spectrumdisplayform.cc \
SpectrumGUIClass.cc \
spectrumUpdateEvents.cc \
plot_waterfall.cc \
@@ -95,15 +97,16 @@
# These headers get installed in ${prefix}/include/gnuradio
grinclude_HEADERS = \
- spectrumdisplayform.h \
FrequencyDisplayPlot.h \
TimeDomainDisplayPlot.h \
WaterfallDisplayPlot.h \
Waterfall3DDisplayPlot.h \
- SpectrumGUIClass.h \
waterfallGlobalData.h \
+ ConstellationDisplayPlot.h \
highResTimeFunctions.h \
plot_waterfall.h \
+ spectrumdisplayform.h \
+ SpectrumGUIClass.h \
spectrumUpdateEvents.h \
qtgui.h \
qtgui_sink_c.h \
Modified: gnuradio/branches/releases/3.2/gr-qtgui/src/lib/SpectrumGUIClass.cc
===================================================================
--- gnuradio/branches/releases/3.2/gr-qtgui/src/lib/SpectrumGUIClass.cc
2009-03-15 19:10:22 UTC (rev 10610)
+++ gnuradio/branches/releases/3.2/gr-qtgui/src/lib/SpectrumGUIClass.cc
2009-03-15 19:19:48 UTC (rev 10611)
@@ -9,7 +9,8 @@
const long SpectrumGUIClass::MAX_FFT_SIZE;
const long SpectrumGUIClass::MIN_FFT_SIZE;
-SpectrumGUIClass::SpectrumGUIClass(const uint64_t maxDataSize, const uint64_t
fftSize, const double newStartFrequency, const double newStopFrequency){
+SpectrumGUIClass::SpectrumGUIClass(const uint64_t maxDataSize, const uint64_t
fftSize,
+ const double newStartFrequency, const double
newStopFrequency){
_dataPoints = maxDataSize;
if(_dataPoints < 2){
_dataPoints = 2;
@@ -102,7 +103,9 @@
void SpectrumGUIClass::Reset(){
if(GetWindowOpenFlag()){
- qApp->postEvent(_spectrumDisplayForm, new
SpectrumFrequencyRangeEvent(_centerFrequency, _startFrequency, _stopFrequency));
+ qApp->postEvent(_spectrumDisplayForm, new
SpectrumFrequencyRangeEvent(_centerFrequency,
+
_startFrequency,
+
_stopFrequency));
qApp->postEvent(_spectrumDisplayForm, new SpectrumWindowResetEvent());
}
_droppedEntriesCount = 0;
Modified: gnuradio/branches/releases/3.2/gr-qtgui/src/lib/qtgui.i
===================================================================
--- gnuradio/branches/releases/3.2/gr-qtgui/src/lib/qtgui.i 2009-03-15
19:10:22 UTC (rev 10610)
+++ gnuradio/branches/releases/3.2/gr-qtgui/src/lib/qtgui.i 2009-03-15
19:19:48 UTC (rev 10611)
@@ -30,40 +30,51 @@
GR_SWIG_BLOCK_MAGIC(qtgui,sink_c)
qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype,
- float fmin=-0.5, float fmax=0.5, const
std::string &name="Display");
+ float fmin=-0.5, float fmax=0.5,
+ const std::string &name="Display");
class qtgui_sink_c : public gr_block
{
private:
friend qtgui_sink_c_sptr qtgui_make_sink_c (int fftsize, int wintype,
- float fmin, float fmax, const
std::string &name);
+ float fmin, float fmax,
+ const std::string &name);
qtgui_sink_c (int fftsize, int wintype,
float fmin, float fmax, const std::string &name);
public:
void start_app();
-
+ void initialize();
+ void initialize(QApplication *qapp);
+ QApplication* get_qapplication();
};
-/****************************************************************************************/
+/*********************************************************************/
GR_SWIG_BLOCK_MAGIC(qtgui,sink_f)
-qtgui_sink_f_sptr qtgui_make_sink_f (int fftsize, const std::vector<float>
&window,
- float fmin, float fmax, const std::string
&name="Display");
+qtgui_sink_f_sptr qtgui_make_sink_f (int fftsize,
+ const std::vector<float> &window,
+ float fmin, float fmax,
+ const std::string &name="Display");
class qtgui_sink_f : public gr_block
{
private:
- friend qtgui_sink_f_sptr qtgui_make_sink_f (int fftsize, const
std::vector<float> &window,
- float fmin, float fmax, const
std::string &name);
- qtgui_sink_fy (int fftsize, const std::vector<float> &window,
- float fmin, float fmax, const std::string &name);
+ friend qtgui_sink_f_sptr qtgui_make_sink_f (int fftsize,
+ const std::vector<float> &window,
+ float fmin, float fmax,
+ const std::string &name);
+ qtgui_sink_f (int fftsize,
+ const std::vector<float> &window,
+ float fmin, float fmax,
+ const std::string &name);
public:
void start_app();
};
+
Modified: gnuradio/branches/releases/3.2/gr-qtgui/src/lib/qtgui_sink_c.cc
===================================================================
--- gnuradio/branches/releases/3.2/gr-qtgui/src/lib/qtgui_sink_c.cc
2009-03-15 19:10:22 UTC (rev 10610)
+++ gnuradio/branches/releases/3.2/gr-qtgui/src/lib/qtgui_sink_c.cc
2009-03-15 19:19:48 UTC (rev 10611)
@@ -40,7 +40,7 @@
qtgui_sink_c::qtgui_sink_c (int fftsize, int wintype,
float fmin, float fmax, const std::string &name)
: gr_block ("sink_c",
- gr_make_io_signature (1, 1, sizeof(gr_complex)),
+ gr_make_io_signature (1, -1, sizeof(gr_complex)),
gr_make_io_signature (0, 0, 0)),
d_fftsize(fftsize), d_wintype((gr_firdes::win_type)(wintype)),
d_fmin(fmin), d_fmax(fmax), d_name(name)
@@ -59,10 +59,13 @@
d_residbuf = new gr_complex[d_fftsize];
buildwindow();
+
+ //initialize();
}
qtgui_sink_c::~qtgui_sink_c()
{
+ delete d_object;
delete [] d_fftdata;
delete [] d_residbuf;
delete d_main_gui;
@@ -79,13 +82,27 @@
pthread_mutex_unlock(&d_pmutex);
}
+
void
-qtgui_sink_c::start_app()
+qtgui_sink_c::initialize()
{
int argc;
char **argv = NULL;
d_qApplication = new QApplication(argc, argv);
+ __initialize();
+}
+
+void
+qtgui_sink_c::initialize(QApplication *qapp)
+{
+ d_qApplication = qapp;
+ __initialize();
+}
+
+void
+qtgui_sink_c::__initialize()
+{
uint64_t maxBufferSize = 32768;
d_main_gui = new SpectrumGUIClass(maxBufferSize, d_fftsize, d_fmin, d_fmax);
d_main_gui->SetDisplayTitle(d_name);
@@ -93,9 +110,20 @@
d_main_gui->SetWindowType((int)d_wintype);
d_main_gui->OpenSpectrumWindow(NULL);
- qtgui_obj object(d_qApplication);
- qApp->postEvent(&object, new qtgui_event(&d_pmutex));
+ d_object = new qtgui_obj(d_qApplication);
+ qApp->postEvent(d_object, new qtgui_event(&d_pmutex));
+}
+QApplication*
+qtgui_sink_c::get_qapplication()
+{
+ return d_qApplication;
+}
+
+
+void
+qtgui_sink_c::start_app()
+{
d_qApplication->exec();
}
Modified: gnuradio/branches/releases/3.2/gr-qtgui/src/lib/qtgui_sink_c.h
===================================================================
--- gnuradio/branches/releases/3.2/gr-qtgui/src/lib/qtgui_sink_c.h
2009-03-15 19:10:22 UTC (rev 10610)
+++ gnuradio/branches/releases/3.2/gr-qtgui/src/lib/qtgui_sink_c.h
2009-03-15 19:19:48 UTC (rev 10611)
@@ -44,6 +44,8 @@
float fmin, float fmax, const
std::string &name);
qtgui_sink_c (int fftsize, int wintype,
float fmin, float fmax, const std::string &name);
+
+ void __initialize();
int d_fftsize;
gr_firdes::win_type d_wintype;
@@ -70,13 +72,17 @@
public:
~qtgui_sink_c();
+ void initialize();
+ void initialize(QApplication *qapp);
void start_app();
void lock();
void unlock();
- QApplication *d_qApplication
-;
+ QApplication* get_qapplication();
+ QApplication *d_qApplication;
+ qtgui_obj *d_object;
+
int general_work (int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
Modified: gnuradio/branches/releases/3.2/gr-qtgui/src/lib/spectrumdisplayform.cc
===================================================================
--- gnuradio/branches/releases/3.2/gr-qtgui/src/lib/spectrumdisplayform.cc
2009-03-15 19:10:22 UTC (rev 10610)
+++ gnuradio/branches/releases/3.2/gr-qtgui/src/lib/spectrumdisplayform.cc
2009-03-15 19:19:48 UTC (rev 10611)
@@ -15,6 +15,7 @@
_waterfallDisplayPlot = new WaterfallDisplayPlot(Tab2PlotDisplayFrame);
_waterfall3DDisplayPlot = new
Waterfall3DDisplayPlot(Waterfall3DPlotDisplayFrame);
_timeDomainDisplayPlot = new TimeDomainDisplayPlot(TimeDomainDisplayFrame);
+ _constellationDisplayPlot = new
ConstellationDisplayPlot(ConstellationDisplayFrame);
_numRealDataPoints = 1024;
_realFFTDataPoints = new double[_numRealDataPoints];
_averagedValues = new double[_numRealDataPoints];
@@ -42,8 +43,10 @@
_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);
@@ -72,7 +75,9 @@
delete _historyVector;
}
-void SpectrumDisplayForm::setSystem( SpectrumGUIClass * newSystem, const
uint64_t numFFTDataPoints, const uint64_t numTimeDomainDataPoints )
+void SpectrumDisplayForm::setSystem( SpectrumGUIClass * newSystem,
+ const uint64_t numFFTDataPoints,
+ const uint64_t numTimeDomainDataPoints )
{
ResizeBuffers(numFFTDataPoints, numTimeDomainDataPoints);
@@ -123,7 +128,8 @@
_AverageHistory(_realFFTDataPoints);
double sumMean;
- const double fft_bin_size = (_stopFrequency-_startFrequency) /
static_cast<double>(numFFTDataPoints);
+ const double fft_bin_size = (_stopFrequency-_startFrequency) /
+ static_cast<double>(numFFTDataPoints);
// find the peak, sum (for mean), etc
_peakAmplitude = -HUGE_VAL;
@@ -161,14 +167,25 @@
}
if(lastOfMultipleUpdatesFlag){
- _frequencyDisplayPlot->PlotNewData(_averagedValues, numFFTDataPoints,
_noiseFloorAmplitude, _peakFrequency, _peakAmplitude);
- _timeDomainDisplayPlot->PlotNewData(realTimeDomainDataPoints,
imagTimeDomainDataPoints, numTimeDomainDataPoints);
+ _frequencyDisplayPlot->PlotNewData(_averagedValues, numFFTDataPoints,
+ _noiseFloorAmplitude, _peakFrequency,
+ _peakAmplitude);
+ _timeDomainDisplayPlot->PlotNewData(realTimeDomainDataPoints,
+ imagTimeDomainDataPoints,
+ numTimeDomainDataPoints);
+ _constellationDisplayPlot->PlotNewData(realTimeDomainDataPoints,
+ imagTimeDomainDataPoints,
+ numTimeDomainDataPoints);
}
// Don't update the repeated data for the waterfall
if(!repeatDataFlag){
- _waterfallDisplayPlot->PlotNewData(_realFFTDataPoints, numFFTDataPoints,
timePerFFT, dataTimestamp, spectrumUpdateEvent->getDroppedFFTFrames());
+ _waterfallDisplayPlot->PlotNewData(_realFFTDataPoints, numFFTDataPoints,
+ timePerFFT, dataTimestamp,
+
spectrumUpdateEvent->getDroppedFFTFrames());
if( _openGLWaterfall3DFlag == 1 ){
- _waterfall3DDisplayPlot->PlotNewData(_realFFTDataPoints,
numFFTDataPoints, timePerFFT, dataTimestamp,
spectrumUpdateEvent->getDroppedFFTFrames());
+ _waterfall3DDisplayPlot->PlotNewData(_realFFTDataPoints,
numFFTDataPoints,
+ timePerFFT, dataTimestamp,
+
spectrumUpdateEvent->getDroppedFFTFrames());
}
}
@@ -187,45 +204,104 @@
QWidget::resizeEvent(&et);
// Tell the Tab Window to Resize
- SpectrumTypeTab->resize( e->size().width(), SpectrumTypeTab->height());
+ SpectrumTypeTab->resize( e->size().width(), e->size().height()-60);
// Tell the TabXFreqDisplay to resize
- Tab1PlotDisplayFrame->resize(e->size().width()-4,
Tab1PlotDisplayFrame->height());
- Tab2PlotDisplayFrame->resize(e->size().width()-4,
Tab2PlotDisplayFrame->height());
- Waterfall3DPlotDisplayFrame->resize(e->size().width()-4,
Waterfall3DPlotDisplayFrame->height());
- TimeDomainDisplayFrame->resize(e->size().width()-4,
TimeDomainDisplayFrame->height());
- _frequencyDisplayPlot->resize( Tab1PlotDisplayFrame->width()-4,
Tab1PlotDisplayFrame->height());
- _waterfallDisplayPlot->resize( Tab2PlotDisplayFrame->width()-4,
Tab2PlotDisplayFrame->height());
- _waterfall3DDisplayPlot->resize( Waterfall3DPlotDisplayFrame->width()-4,
Waterfall3DPlotDisplayFrame->height());
- _timeDomainDisplayPlot->resize( TimeDomainDisplayFrame->width()-4,
TimeDomainDisplayFrame->height());
+ //Tab1PlotDisplayFrame->resize(e->size().width()-4,
+ //Tab1PlotDisplayFrame->height());
+ Tab1PlotDisplayFrame->resize(e->size().width()-4,
+ e->size().height()-140);
+ Tab2PlotDisplayFrame->resize(e->size().width()-4,
+ e->size().height()-140);
+ Waterfall3DPlotDisplayFrame->resize(e->size().width()-4,
+ e->size().height()-140);
+ TimeDomainDisplayFrame->resize(e->size().width()-4,
+ e->size().height()-140);
+ ConstellationDisplayFrame->resize(e->size().width()-4,
+ e->size().height()-140);
+ _frequencyDisplayPlot->resize( Tab1PlotDisplayFrame->width()-4,
+ e->size().height()-140);
+ _waterfallDisplayPlot->resize( Tab2PlotDisplayFrame->width()-4,
+ e->size().height()-140);
+ _waterfall3DDisplayPlot->resize( Waterfall3DPlotDisplayFrame->width()-4,
+ e->size().height()-140);
+ _timeDomainDisplayPlot->resize( TimeDomainDisplayFrame->width()-4,
+ e->size().height()-140);
+ _constellationDisplayPlot->resize( TimeDomainDisplayFrame->width()-4,
+ e->size().height()-140);
// Move the IntensityWheels and Labels
- WaterfallMaximumIntensityLabel->move(width() - 5 -
WaterfallMaximumIntensityLabel->width(), WaterfallMaximumIntensityLabel->y());
- WaterfallMinimumIntensityLabel->move(width() - 5 -
WaterfallMinimumIntensityLabel->width(), WaterfallMinimumIntensityLabel->y());
- WaterfallMaximumIntensityWheel->resize(WaterfallMaximumIntensityLabel->x() -
5 - WaterfallMaximumIntensityWheel->x(),
WaterfallMaximumIntensityWheel->height());
- WaterfallMinimumIntensityWheel->resize(WaterfallMinimumIntensityLabel->x() -
5 - WaterfallMinimumIntensityWheel->x(),
WaterfallMinimumIntensityWheel->height());
+ WaterfallMaximumIntensityLabel->move(width() - 5 -
+ WaterfallMaximumIntensityLabel->width(),
+ WaterfallMaximumIntensityLabel->y());
+ WaterfallMaximumIntensityWheel->resize(WaterfallMaximumIntensityLabel->x() -
5 -
+ WaterfallMaximumIntensityWheel->x(),
+
WaterfallMaximumIntensityWheel->height());
- Waterfall3DMaximumIntensityLabel->move(width() - 5 -
Waterfall3DMaximumIntensityLabel->width(),
Waterfall3DMaximumIntensityLabel->y());
- Waterfall3DMinimumIntensityLabel->move(width() - 5 -
Waterfall3DMinimumIntensityLabel->width(),
Waterfall3DMinimumIntensityLabel->y());
-
Waterfall3DMaximumIntensityWheel->resize(Waterfall3DMaximumIntensityLabel->x()
- 5 - Waterfall3DMaximumIntensityWheel->x(),
Waterfall3DMaximumIntensityWheel->height());
-
Waterfall3DMinimumIntensityWheel->resize(Waterfall3DMinimumIntensityLabel->x()
- 5 - Waterfall3DMinimumIntensityWheel->x(),
Waterfall3DMinimumIntensityWheel->height());
+ WaterfallMinimumIntensityLabel->move(width() - 5 -
+ WaterfallMinimumIntensityLabel->width(),
+ height() - 115);
+ WaterfallMinimumIntensityWheel->resize(WaterfallMinimumIntensityLabel->x() -
5 -
+ WaterfallMinimumIntensityWheel->x(),
+
WaterfallMaximumIntensityWheel->height());
+ WaterfallMinimumIntensityWheel->move(WaterfallMinimumIntensityWheel->x(),
+ height() - 115);
+ Waterfall3DMaximumIntensityLabel->move(width() - 5 -
+
Waterfall3DMaximumIntensityLabel->width(),
+ Waterfall3DMaximumIntensityLabel->y());
+
Waterfall3DMaximumIntensityWheel->resize(Waterfall3DMaximumIntensityLabel->x()
- 5 -
+
Waterfall3DMaximumIntensityWheel->x(),
+
Waterfall3DMaximumIntensityWheel->height());
- // Move the Power Lbl
- PowerLabel->move(e->size().width()-(415-324) - PowerLabel->width(),
PowerLabel->y());
+ Waterfall3DMinimumIntensityLabel->move(width() - 5 -
+
Waterfall3DMinimumIntensityLabel->width(),
+ height() - 115);
+
Waterfall3DMinimumIntensityWheel->resize(Waterfall3DMinimumIntensityLabel->x()
- 5 -
+
Waterfall3DMinimumIntensityWheel->x(),
+
Waterfall3DMaximumIntensityWheel->height());
+ Waterfall3DMinimumIntensityWheel->move(Waterfall3DMinimumIntensityWheel->x(),
+ height() - 115);
- // Move the Power Line Edit
- PowerLineEdit->move(e->size().width()-(415-318) - PowerLineEdit->width(),
PowerLineEdit->y());
+ // Move Waterfall and Waterfall3D Auto Scan button
+ WaterfallAutoScaleBtn->move(WaterfallAutoScaleBtn->x(),
+ e->size().height()-115);
+ Waterfall3DAutoScaleBtn->move(WaterfallAutoScaleBtn->x(),
+ e->size().height()-115);
+
- // Move the Avg Lbl
- AvgLabel->move(e->size().width()-(415-406) - AvgLabel->width(),
AvgLabel->y());
+ // Move the Power Lbl and Line Edit
+ PowerLabel->move(e->size().width()-(415-324) - PowerLabel->width(),
+ e->size().height()-135);
+ PowerLineEdit->move(e->size().width()-(415-318) - PowerLineEdit->width(),
+ e->size().height()-115);
- // Move the Avg Line Edit
- AvgLineEdit->move(e->size().width()-(415-400) - AvgLineEdit->width(),
AvgLineEdit->y());
+ // Move the Avg Lbl and Line Edit
+ AvgLabel->move(e->size().width()-(415-406) - AvgLabel->width(),
+ e->size().height()-135);
+ AvgLineEdit->move(e->size().width()-(415-400) - AvgLineEdit->width(),
+ e->size().height()-115);
+
+ // Move Max and Min check boxes
+ MaxHoldCheckBox->move(MaxHoldCheckBox->x(),
+ e->size().height()-135);
+ MaxHoldResetBtn->move(MaxHoldResetBtn->x(),
+ e->size().height()-135);
+ MinHoldCheckBox->move(MinHoldCheckBox->x(),
+ e->size().height()-115);
+ MinHoldResetBtn->move(MinHoldResetBtn->x(),
+ e->size().height()-115);
// Move the FFT Size Combobox and label
- FFTSizeComboBox->move(width() - 5 - FFTSizeComboBox->width(),
FFTSizeComboBox->y());
- FFTSizeLabel->move(width() - 10 - FFTSizeComboBox->width() -
FFTSizeLabel->width(), FFTSizeLabel->y());
+ FFTSizeComboBox->move(width() - 5 - FFTSizeComboBox->width(),
+ height()-50);
+ FFTSizeLabel->move(width() - 10 - FFTSizeComboBox->width() -
FFTSizeLabel->width(),
+ height()-50);
+
+ // Move the lower check and combo boxes
+ UseRFFrequenciesCheckBox->move(UseRFFrequenciesCheckBox->x(), height()-50);
+ WindowLbl->move(WindowLbl->x(), height()-25);
+ WindowComboBox->move(WindowComboBox->x(), height()-25);
}
Modified: gnuradio/branches/releases/3.2/gr-qtgui/src/lib/spectrumdisplayform.h
===================================================================
--- gnuradio/branches/releases/3.2/gr-qtgui/src/lib/spectrumdisplayform.h
2009-03-15 19:10:22 UTC (rev 10610)
+++ gnuradio/branches/releases/3.2/gr-qtgui/src/lib/spectrumdisplayform.h
2009-03-15 19:19:48 UTC (rev 10611)
@@ -11,6 +11,7 @@
#include <WaterfallDisplayPlot.h>
#include <Waterfall3DDisplayPlot.h>
#include <TimeDomainDisplayPlot.h>
+#include <ConstellationDisplayPlot.h>
#include <QValidator>
#include <vector>
@@ -73,6 +74,7 @@
WaterfallDisplayPlot* _waterfallDisplayPlot;
Waterfall3DDisplayPlot* _waterfall3DDisplayPlot;
TimeDomainDisplayPlot* _timeDomainDisplayPlot;
+ ConstellationDisplayPlot* _constellationDisplayPlot;
SpectrumGUIClass* _system;
bool _systemSpecifiedFlag;
double _centerFrequency;
Modified: gnuradio/branches/releases/3.2/gr-qtgui/src/lib/spectrumdisplayform.ui
===================================================================
--- gnuradio/branches/releases/3.2/gr-qtgui/src/lib/spectrumdisplayform.ui
2009-03-15 19:10:22 UTC (rev 10610)
+++ gnuradio/branches/releases/3.2/gr-qtgui/src/lib/spectrumdisplayform.ui
2009-03-15 19:19:48 UTC (rev 10611)
@@ -5,7 +5,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>637</width>
+ <width>633</width>
<height>436</height>
</rect>
</property>
@@ -157,6 +157,9 @@
<height>380</height>
</rect>
</property>
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
<widget class="QWidget" name="FrequencyPage" >
<attribute name="title" >
<string>Frequency Display</string>
@@ -373,9 +376,6 @@
<property name="valid" >
<bool>true</bool>
</property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
<property name="totalAngle" >
<double>200.000000000000000</double>
</property>
@@ -430,9 +430,6 @@
<property name="valid" >
<bool>true</bool>
</property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
<property name="totalAngle" >
<double>200.000000000000000</double>
</property>
@@ -540,9 +537,6 @@
<property name="valid" >
<bool>true</bool>
</property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
<property name="totalAngle" >
<double>200.000000000000000</double>
</property>
@@ -638,9 +632,6 @@
<property name="valid" >
<bool>true</bool>
</property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
<property name="totalAngle" >
<double>200.000000000000000</double>
</property>
@@ -673,6 +664,27 @@
</property>
</widget>
</widget>
+ <widget class="QWidget" name="ConstellationPage" >
+ <attribute name="title" >
+ <string>Constellation Display</string>
+ </attribute>
+ <widget class="QFrame" name="ConstellationDisplayFrame" >
+ <property name="geometry" >
+ <rect>
+ <x>5</x>
+ <y>5</y>
+ <width>620</width>
+ <height>340</height>
+ </rect>
+ </property>
+ <property name="frameShape" >
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow" >
+ <enum>QFrame::Raised</enum>
+ </property>
+ </widget>
+ </widget>
</widget>
</widget>
<layoutdefault spacing="6" margin="11" />
Copied: gnuradio/branches/releases/3.2/gr-qtgui/src/python/qt_digital.py (from
rev 10538, gnuradio/trunk/gr-qtgui/src/python/qt_digital.py)
===================================================================
--- gnuradio/branches/releases/3.2/gr-qtgui/src/python/qt_digital.py
(rev 0)
+++ gnuradio/branches/releases/3.2/gr-qtgui/src/python/qt_digital.py
2009-03-15 19:19:48 UTC (rev 10611)
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+
+from gnuradio import gr, blks2
+from gnuradio.qtgui import qtgui
+import scipy
+
+class my_top_block(gr.top_block):
+ def __init__(self):
+ gr.top_block.__init__(self)
+
+ sps = 2
+ excess_bw = 0.35
+ gray_code = True
+
+ fftsize = 2048
+
+ data = scipy.random.randint(0, 255, 1000)
+ src = gr.vector_source_b(data, True)
+ mod = blks2.dqpsk_mod(sps, excess_bw, gray_code, False, False)
+
+ rrctaps = gr.firdes.root_raised_cosine(1, sps, 1, excess_bw, 21)
+ rx_rrc = gr.fir_filter_ccf(sps, rrctaps)
+
+ thr = gr.throttle(gr.sizeof_gr_complex, 10*fftsize)
+ self.snk_tx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
-1/2, 1/2)
+ self.snk_rx = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
-1/2, 1/2)
+
+ self.connect(src, mod, self.snk_tx)
+ self.connect(mod, rx_rrc, thr, self.snk_rx)
+
+ self.snk_tx.initialize()
+ qapp = self.snk_tx.get_qapplication()
+ self.snk_rx.initialize(qapp)
+
+if __name__ == "__main__":
+ tb = my_top_block();
+ tb.start()
+ tb.snk_tx.start_app();
+ #tb.wait();
+
Modified: gnuradio/branches/releases/3.2/gr-qtgui/src/python/qttest_c.py
===================================================================
--- gnuradio/branches/releases/3.2/gr-qtgui/src/python/qttest_c.py
2009-03-15 19:10:22 UTC (rev 10610)
+++ gnuradio/branches/releases/3.2/gr-qtgui/src/python/qttest_c.py
2009-03-15 19:19:48 UTC (rev 10611)
@@ -7,21 +7,31 @@
def __init__(self):
gr.top_block.__init__(self)
+ Rs = 8000
+ f1 = 1000
+ f2 = 2000
+
fftsize = 2048
- src1 = gr.sig_source_c(1, gr.GR_SIN_WAVE, 0.1, 0.01, 0)
- src2 = gr.sig_source_c(1, gr.GR_SIN_WAVE, 0.015, 0.01, 0)
+ src1 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f1, 0.1, 0)
+ src2 = gr.sig_source_c(Rs, gr.GR_SIN_WAVE, f2, 0.1, 0)
src = gr.add_cc()
thr = gr.throttle(gr.sizeof_gr_complex, 20*fftsize)
- self.snk = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS, -0.5,
0.5)
+ self.snk1 = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
-Rs/2, Rs/2)
+ self.snk2 = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS,
-Rs/2, Rs/2)
self.connect(src1, (src,0))
self.connect(src2, (src,1))
- self.connect(src, thr, self.snk)
+ self.connect(src, thr, self.snk1)
+ self.connect(src1, self.snk2)
+ self.snk1.initialize()
+ qapp = self.snk1.get_qapplication()
+ self.snk2.initialize(qapp)
+
if __name__ == "__main__":
tb = my_top_block();
tb.start()
- tb.snk.start_app();
+ tb.snk1.start_app();
#tb.wait();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r10611 - in gnuradio/branches/releases/3.2: . config gr-qtgui/src/lib gr-qtgui/src/python,
jcorgan <=