[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 24/37: qtgui: fixes waterfall plots.
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 24/37: qtgui: fixes waterfall plots. |
Date: |
Thu, 17 Jul 2014 20:23:42 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit 79f06c437d61b9847cf66f7baa845dab29eda55e
Author: Tom Rondeau <address@hidden>
Date: Sat Jul 12 10:49:21 2014 -0400
qtgui: fixes waterfall plots.
Better autoscaling and ability to set max and min intensity in runtime menu.
---
.../include/gnuradio/qtgui/waterfalldisplayform.h | 6 ++--
gr-qtgui/lib/waterfalldisplayform.cc | 37 +++++++++++++++++++---
2 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/gr-qtgui/include/gnuradio/qtgui/waterfalldisplayform.h
b/gr-qtgui/include/gnuradio/qtgui/waterfalldisplayform.h
index 5af2680..8017d5c 100644
--- a/gr-qtgui/include/gnuradio/qtgui/waterfalldisplayform.h
+++ b/gr-qtgui/include/gnuradio/qtgui/waterfalldisplayform.h
@@ -75,6 +75,8 @@ public slots:
void setIntensityRange(const double minIntensity,
const double maxIntensity);
+ void setMaxIntensity(const QString &m);
+ void setMinIntensity(const QString &m);
void setAlpha(int which, int alpha);
@@ -101,8 +103,8 @@ private:
bool d_clicked;
double d_clicked_freq;
- double d_min_val;
- double d_max_val;
+ double d_min_val, d_cur_min_val;
+ double d_max_val, d_cur_max_val;
FFTSizeMenu *d_sizemenu;
FFTAverageMenu *d_avgmenu;
diff --git a/gr-qtgui/lib/waterfalldisplayform.cc
b/gr-qtgui/lib/waterfalldisplayform.cc
index 51f518f..fdf09d9 100644
--- a/gr-qtgui/lib/waterfalldisplayform.cc
+++ b/gr-qtgui/lib/waterfalldisplayform.cc
@@ -91,6 +91,16 @@ WaterfallDisplayForm::WaterfallDisplayForm(int nplots,
QWidget* parent)
connect(d_winmenu, SIGNAL(whichTrigger(gr::filter::firdes::win_type)),
this, SLOT(setFFTWindowType(const gr::filter::firdes::win_type)));
+ PopupMenu *maxintmenu = new PopupMenu("Int. Max", this);
+ d_menu->addAction(maxintmenu);
+ connect(maxintmenu, SIGNAL(whichTrigger(QString)),
+ this, SLOT(setMaxIntensity(QString)));
+
+ PopupMenu *minintmenu = new PopupMenu("Int. Min", this);
+ d_menu->addAction(minintmenu);
+ connect(minintmenu, SIGNAL(whichTrigger(QString)),
+ this, SLOT(setMinIntensity(QString)));
+
Reset();
connect(d_display_plot, SIGNAL(plotPointSelected(const QPointF)),
@@ -119,8 +129,6 @@ WaterfallDisplayForm::newData(const QEvent *updateEvent)
const uint64_t numDataPoints = event->getNumDataPoints();
const gr::high_res_timer_type dataTimestamp = event->getDataTimestamp();
- d_min_val = 1000;
- d_max_val = -1000;
for(size_t i=0; i < dataPoints.size(); i++) {
double *min_val = std::min_element(&dataPoints[i][0],
&dataPoints[i][numDataPoints-1]);
double *max_val = std::max_element(&dataPoints[i][0],
&dataPoints[i][numDataPoints-1]);
@@ -257,18 +265,39 @@ void
WaterfallDisplayForm::setIntensityRange(const double minIntensity,
const double maxIntensity)
{
+ // reset max and min values
+ d_min_val = 1000;
+ d_max_val = -1000;
+
+ d_cur_min_val = minIntensity;
+ d_cur_max_val = maxIntensity;
getPlot()->setIntensityRange(minIntensity, maxIntensity);
getPlot()->replot();
}
void
+WaterfallDisplayForm::setMaxIntensity(const QString &m)
+{
+ double new_max = m.toDouble();
+ if(new_max > d_cur_min_val)
+ setIntensityRange(d_cur_min_val, new_max);
+}
+
+void
+WaterfallDisplayForm::setMinIntensity(const QString &m)
+{
+ double new_min = m.toDouble();
+ if(new_min < d_cur_max_val)
+ setIntensityRange(new_min, d_cur_max_val);
+}
+
+void
WaterfallDisplayForm::autoScale(bool en)
{
double min_int = d_min_val - 5;
double max_int = d_max_val + 10;
- getPlot()->setIntensityRange(min_int, max_int);
- getPlot()->replot();
+ setIntensityRange(min_int, max_int);
}
void
- [Commit-gnuradio] [gnuradio] 16/37: qtgui: adding ability to set grid on/off from grc properties dialog boxes for all qtgui sinks except the "sink" which doesn't support this., (continued)
- [Commit-gnuradio] [gnuradio] 16/37: qtgui: adding ability to set grid on/off from grc properties dialog boxes for all qtgui sinks except the "sink" which doesn't support this., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 12/37: Merge remote-tracking branch 'gnuradio-wg-grc/grc_variable_blocks', git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 22/37: Merge remote-tracking branch 'gnuradio-wg-grc/grc_port_view_options', git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 09/37: uhd: Added example for re-tuning through messages, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 06/37: uhd: Refactored common stuff from usrp sink and source, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 23/37: qtgui: time raster display updates., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 11/37: build: missed gnuradio-uhd in static libs build., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 15/37: grc: fixing some spacing issues in various xml files., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 13/37: Merge remote-tracking branch 'gnuradio-wg-grc/grc_hide_ports', git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 18/37: Merge branch 'maint', git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 24/37: qtgui: fixes waterfall plots.,
git <=
- [Commit-gnuradio] [gnuradio] 25/37: qtgui: adding menu item to frequency sink to set y min/max., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 14/37: grc: fixing xml files of some blocks with message control ports to be able to hide/show them as wanted., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 21/37: qtgui: updates number sink behavor., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 20/37: grc: toogle action to disable auto-hiding port labels, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 19/37: grc: auto-hide port labels, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 34/37: Merge remote-tracking branch 'mbant/uhd/msg_format' into qt_the_things, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 30/37: qtgui: minor fix to how number sink handles autoscale., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 37/37: Merge branch 'qt_the_things', git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 29/37: Merge remote-tracking branch 'mbant/qtify-examples', git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 28/37: qtgui: adding a formatter to qtgui label widget to behave like formatter in the wxgui static text widget., git, 2014/07/17