summaryrefslogtreecommitdiff
path: root/gr-qtgui
diff options
context:
space:
mode:
authorMike Cornelius2011-04-12 21:55:51 -0400
committerTom Rondeau2011-04-12 22:28:59 -0400
commit117bf31ca76a2751f7e9dfd06860211b7fc14205 (patch)
tree0d8126b96333cab3d3293037b3aeb146fa10dd1c /gr-qtgui
parent41ad09b4f22228dd555ea73f2078cb9ff056b979 (diff)
downloadgnuradio-117bf31ca76a2751f7e9dfd06860211b7fc14205.tar.gz
gnuradio-117bf31ca76a2751f7e9dfd06860211b7fc14205.tar.bz2
gnuradio-117bf31ca76a2751f7e9dfd06860211b7fc14205.zip
gr-qtgui: exposing double-click events through spectrumdisplayform and through to Python.
Diffstat (limited to 'gr-qtgui')
-rw-r--r--gr-qtgui/lib/spectrumdisplayform.cc37
-rw-r--r--gr-qtgui/lib/spectrumdisplayform.h8
2 files changed, 44 insertions, 1 deletions
diff --git a/gr-qtgui/lib/spectrumdisplayform.cc b/gr-qtgui/lib/spectrumdisplayform.cc
index 804dbdd62..238c9889f 100644
--- a/gr-qtgui/lib/spectrumdisplayform.cc
+++ b/gr-qtgui/lib/spectrumdisplayform.cc
@@ -62,6 +62,19 @@ SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent)
// Create a timer to update plots at the specified rate
displayTimer = new QTimer(this);
connect(displayTimer, SIGNAL(timeout()), this, SLOT(UpdateGuiTimer()));
+
+ // Connect double click signals up
+ connect(_frequencyDisplayPlot, SIGNAL(plotPointSelected(const QPointF)),
+ this, SLOT(onFFTPlotPointSelected(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(_constellationDisplayPlot, SIGNAL(plotPointSelected(const QPointF)),
+ this, SLOT(onConstPlotPointSelected(const QPointF)));
}
SpectrumDisplayForm::~SpectrumDisplayForm()
@@ -689,3 +702,27 @@ SpectrumDisplayForm::SetUpdateTime(double t)
// QTimer class takes millisecond input
displayTimer->start(d_update_time*1000);
}
+
+void
+SpectrumDisplayForm::onFFTPlotPointSelected(const QPointF p)
+{
+ emit plotPointSelected(p, 1);
+}
+
+void
+SpectrumDisplayForm::onWFallPlotPointSelected(const QPointF p)
+{
+ emit plotPointSelected(p, 2);
+}
+
+void
+SpectrumDisplayForm::onTimePlotPointSelected(const QPointF p)
+{
+ emit plotPointSelected(p, 3);
+}
+
+void
+SpectrumDisplayForm::onConstPlotPointSelected(const QPointF p)
+{
+ emit plotPointSelected(p, 4);
+}
diff --git a/gr-qtgui/lib/spectrumdisplayform.h b/gr-qtgui/lib/spectrumdisplayform.h
index 794a8c58e..860edf2d1 100644
--- a/gr-qtgui/lib/spectrumdisplayform.h
+++ b/gr-qtgui/lib/spectrumdisplayform.h
@@ -71,7 +71,13 @@ private slots:
void newFrequencyData( const SpectrumUpdateEvent* );
void UpdateGuiTimer();
-protected:
+ void onFFTPlotPointSelected(const QPointF p);
+ void onWFallPlotPointSelected(const QPointF p);
+ void onTimePlotPointSelected(const QPointF p);
+ void onConstPlotPointSelected(const QPointF p);
+
+signals:
+ void plotPointSelected(const QPointF p, int type);
private:
void _AverageHistory( const double * newBuffer );