[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 23/37: qtgui: time raster display updates.
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 23/37: qtgui: time raster display updates. |
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 c60d058b6d71ba750cb79a8280c5caa3a218c0e7
Author: Tom Rondeau <address@hidden>
Date: Sat Jul 12 10:39:05 2014 -0400
qtgui: time raster display updates.
Fixes issue with autoscaling; allows settable intensity min/max in GRC and
through runtime menu.
---
gr-qtgui/grc/qtgui_time_raster_x.xml | 17 +++++++++
.../include/gnuradio/qtgui/timerasterdisplayform.h | 6 ++--
gr-qtgui/lib/timerasterdisplayform.cc | 42 +++++++++++++++++-----
3 files changed, 55 insertions(+), 10 deletions(-)
diff --git a/gr-qtgui/grc/qtgui_time_raster_x.xml
b/gr-qtgui/grc/qtgui_time_raster_x.xml
index 512773a..16619cb 100644
--- a/gr-qtgui/grc/qtgui_time_raster_x.xml
+++ b/gr-qtgui/grc/qtgui_time_raster_x.xml
@@ -22,6 +22,7 @@ qtgui.$(type.fcn)(
)
self.$(id).set_update_time($update_time)
+self.$(id).set_intensity_range($zmin, $zmax)
self.$(id).enable_grid($grid)
labels = [$label1, $label2, $label3, $label4, $label5,
@@ -106,6 +107,22 @@ $(gui_hint()($win))</make>
</param>
<param>
+ <name>Int. min</name>
+ <key>zmin</key>
+ <value>-1</value>
+ <type>real</type>
+ <hide>part</hide>
+ </param>
+
+ <param>
+ <name>Int. max</name>
+ <key>zmax</key>
+ <value>1</value>
+ <type>real</type>
+ <hide>part</hide>
+ </param>
+
+ <param>
<name>Multiplier</name>
<key>mult</key>
<value>[]</value>
diff --git a/gr-qtgui/include/gnuradio/qtgui/timerasterdisplayform.h
b/gr-qtgui/include/gnuradio/qtgui/timerasterdisplayform.h
index dff2986..1abc6eb 100644
--- a/gr-qtgui/include/gnuradio/qtgui/timerasterdisplayform.h
+++ b/gr-qtgui/include/gnuradio/qtgui/timerasterdisplayform.h
@@ -72,6 +72,8 @@ public slots:
void setIntensityRange(const double minIntensity,
const double maxIntensity);
+ void setMaxIntensity(const QString &m);
+ void setMinIntensity(const QString &m);
void setColorMap(int which,
const int newType,
@@ -86,8 +88,8 @@ private slots:
void newData(const QEvent *updateEvent);
private:
- double d_min_val;
- double d_max_val;
+ double d_min_val, d_cur_min_val;
+ double d_max_val, d_cur_max_val;
};
#endif /* TIMERASTER_DISPLAY_FORM_H */
diff --git a/gr-qtgui/lib/timerasterdisplayform.cc
b/gr-qtgui/lib/timerasterdisplayform.cc
index 382e916..eb5405d 100644
--- a/gr-qtgui/lib/timerasterdisplayform.cc
+++ b/gr-qtgui/lib/timerasterdisplayform.cc
@@ -91,6 +91,16 @@ TimeRasterDisplayForm::TimeRasterDisplayForm(int nplots,
connect(rowsmenu, SIGNAL(whichTrigger(QString)),
this, SLOT(setNumRows(QString)));
+ 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)));
+
getPlot()->setIntensityRange(0, zmax);
Reset();
@@ -155,8 +165,6 @@ TimeRasterDisplayForm::newData(const QEvent *updateEvent)
const std::vector<double*> dataPoints = event->getPoints();
const uint64_t numDataPoints = event->getNumDataPoints();
- d_min_val = 10;
- d_max_val = -10;
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]);
@@ -239,18 +247,36 @@ TimeRasterDisplayForm::setAlpha(int which, int alpha)
void
TimeRasterDisplayForm::setIntensityRange(const double minIntensity,
- const double maxIntensity)
+ const double maxIntensity)
{
+ // reset max and min values
+ d_min_val = 10;
+ d_max_val = -10;
+
+ d_cur_min_val = minIntensity;
+ d_cur_max_val = maxIntensity;
getPlot()->setIntensityRange(minIntensity, maxIntensity);
getPlot()->replot();
}
void
-TimeRasterDisplayForm::autoScale(bool en)
+TimeRasterDisplayForm::setMaxIntensity(const QString &m)
{
- double min_int = d_min_val;
- double max_int = d_max_val;
+ double new_max = m.toDouble();
+ if(new_max > d_cur_min_val)
+ setIntensityRange(d_cur_min_val, new_max);
+}
- getPlot()->setIntensityRange(min_int, max_int);
- getPlot()->replot();
+void
+TimeRasterDisplayForm::setMinIntensity(const QString &m)
+{
+ double new_min = m.toDouble();
+ if(new_min < d_cur_max_val)
+ setIntensityRange(new_min, d_cur_max_val);
+}
+
+void
+TimeRasterDisplayForm::autoScale(bool en)
+{
+ setIntensityRange(d_min_val, d_max_val);
}
- [Commit-gnuradio] [gnuradio] 04/37: uhd: Updated docs, in particular for the command interface, (continued)
- [Commit-gnuradio] [gnuradio] 04/37: uhd: Updated docs, in particular for the command interface, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 03/37: grc: allow blocks to dynamically hide some of their ports, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 10/37: uhd: Added checks for lock sensors., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 17/37: qtgui: allows users to set title and unit of Y axis for qt time plotter., git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 05/37: uhd: Added command interface to uhd source, modified command syntax, git, 2014/07/17
- [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 <=
- [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, 2014/07/17
- [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