[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 16/37: qtgui: adding ability to set grid on
From: |
git |
Subject: |
[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. |
Date: |
Thu, 17 Jul 2014 20:23:41 +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 d6330a5842081c77761b832fa273f6325ee11316
Author: Tom Rondeau <address@hidden>
Date: Fri Jul 11 15:56:14 2014 -0400
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.
Addresses issue #688. Keeping default to off since the grid's not the
prettiest thing.
---
gr-qtgui/grc/qtgui_const_sink_x.xml | 17 ++
gr-qtgui/grc/qtgui_freq_sink_x.xml | 17 ++
gr-qtgui/grc/qtgui_histogram_sink_x.xml | 228 ++++++++++++++-----------
gr-qtgui/grc/qtgui_time_raster_x.xml | 198 +++++++++++----------
gr-qtgui/grc/qtgui_time_sink_x.xml | 17 ++
gr-qtgui/grc/qtgui_waterfall_sink_x.xml | 17 ++
gr-qtgui/include/gnuradio/qtgui/const_sink_c.h | 1 +
gr-qtgui/lib/const_sink_c_impl.cc | 6 +
gr-qtgui/lib/const_sink_c_impl.h | 1 +
9 files changed, 312 insertions(+), 190 deletions(-)
diff --git a/gr-qtgui/grc/qtgui_const_sink_x.xml
b/gr-qtgui/grc/qtgui_const_sink_x.xml
index 0062bca..a6fb2af 100644
--- a/gr-qtgui/grc/qtgui_const_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_const_sink_x.xml
@@ -21,6 +21,7 @@ self.$(id).set_y_axis($ymin, $ymax)
self.$(id).set_x_axis($xmin, $xmax)
self.$(id).set_trigger_mode($tr_mode, $tr_slope, $tr_level, $tr_chan, $tr_tag)
self.$(id).enable_autoscale($autoscale)
+self.$(id).enable_grid($grid)
labels = [$label1, $label2, $label3, $label4, $label5,
$label6, $label7, $label8, $label9, $label10]
@@ -83,6 +84,22 @@ $(gui_hint()($win))</make>
</param>
<param>
+ <name>Grid</name>
+ <key>grid</key>
+ <value>False</value>
+ <type>enum</type>
+ <hide>part</hide>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+
+ <param>
<name>Autoscale</name>
<key>autoscale</key>
<value>False</value>
diff --git a/gr-qtgui/grc/qtgui_freq_sink_x.xml
b/gr-qtgui/grc/qtgui_freq_sink_x.xml
index 632db25..94989f5 100644
--- a/gr-qtgui/grc/qtgui_freq_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_freq_sink_x.xml
@@ -23,6 +23,7 @@ qtgui.$(type.fcn)(
self.$(id).set_update_time($update_time)
self.$(id).set_y_axis($ymin, $ymax)
self.$(id).enable_autoscale($autoscale)
+self.$(id).enable_grid($grid)
self.$(id).set_fft_average($average)
labels = [$label1, $label2, $label3, $label4, $label5,
@@ -129,6 +130,22 @@ $(gui_hint()($win))</make>
</param>
<param>
+ <name>Grid</name>
+ <key>grid</key>
+ <value>False</value>
+ <type>enum</type>
+ <hide>part</hide>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+
+ <param>
<name>Autoscale</name>
<key>autoscale</key>
<value>False</value>
diff --git a/gr-qtgui/grc/qtgui_histogram_sink_x.xml
b/gr-qtgui/grc/qtgui_histogram_sink_x.xml
index a7137ac..7165fb8 100644
--- a/gr-qtgui/grc/qtgui_histogram_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_histogram_sink_x.xml
@@ -5,12 +5,12 @@
###################################################
-->
<block>
- <name>QT GUI Histogram Sink</name>
- <key>qtgui_histogram_sink_x</key>
- <import>from PyQt4 import Qt</import>
- <import>from gnuradio import qtgui</import>
- <import>import sip</import>
- <make>#set $win = 'self._%s_win'%$id
+ <name>QT GUI Histogram Sink</name>
+ <key>qtgui_histogram_sink_x</key>
+ <import>from PyQt4 import Qt</import>
+ <import>from gnuradio import qtgui</import>
+ <import>import sip</import>
+ <make>#set $win = 'self._%s_win'%$id
qtgui.histogram_sink_f(
$size,
$bins,
@@ -23,6 +23,7 @@ qtgui.histogram_sink_f(
self.$(id).set_update_time($update_time)
self.$(id).enable_autoscale($autoscale)
self.$(id).enable_accumulate($accum)
+self.$(id).enable_grid($grid)
labels = [$label1, $label2, $label3, $label4, $label5,
$label6, $label7, $label8, $label9, $label10]
@@ -48,104 +49,125 @@ for i in xrange($nconnections):
self.$(id).set_line_alpha(i, alphas[i])
self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget)
-$(gui_hint()($win))</make>
- <callback>set_update_time($update_time)</callback>
- <callback>set_title($which, $title)</callback>
- <callback>set_color($which, $color)</callback>
- <callback>set_bins($bins)</callback>
- <callback>set_bins($bins)</callback>
- <callback>set_x_axis($xmin, $xmax)</callback>
-
- <param_tab_order>
- <tab>General</tab>
- <tab>Config</tab>
- </param_tab_order>
-
- <param>
- <name>Name</name>
- <key>name</key>
- <value>""</value>
- <type>string</type>
- <hide>#if len($name()) > 0 then 'none' else 'part'#</hide>
- </param>
-
- <param>
- <name>Number of Points</name>
- <key>size</key>
- <value>1024</value>
- <type>int</type>
- </param>
- <param>
- <name>Number of Bins</name>
- <key>bins</key>
- <value>100</value>
- <type>int</type>
- </param>
-
- <param>
- <name>Autoscale</name>
- <key>autoscale</key>
- <value>True</value>
- <type>enum</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
-
- <param>
- <name>Accumulate</name>
- <key>accum</key>
- <value>False</value>
- <type>enum</type>
- <option>
- <name>Yes</name>
- <key>True</key>
- </option>
- <option>
- <name>No</name>
- <key>False</key>
- </option>
- </param>
-
- <param>
- <name>Min x-axis</name>
- <key>xmin</key>
- <value>-1</value>
- <type>real</type>
- </param>
- <param>
- <name>Max x-axis</name>
- <key>xmax</key>
- <value>1</value>
- <type>real</type>
- </param>
- <param>
- <name>Number of Inputs</name>
- <key>nconnections</key>
- <value>1</value>
- <type>int</type>
- <hide>part</hide>
- </param>
- <param>
- <name>Update Period</name>
- <key>update_time</key>
- <value>0.10</value>
- <type>float</type>
- <hide>part</hide>
- </param>
- <param>
- <name>GUI Hint</name>
- <key>gui_hint</key>
- <value></value>
- <type>gui_hint</type>
- <hide>part</hide>
- </param>
+$(gui_hint()($win))
+ </make>
+ <callback>set_update_time($update_time)</callback>
+ <callback>set_title($which, $title)</callback>
+ <callback>set_color($which, $color)</callback>
+ <callback>set_bins($bins)</callback>
+ <callback>set_bins($bins)</callback>
+ <callback>set_x_axis($xmin, $xmax)</callback>
+
+ <param_tab_order>
+ <tab>General</tab>
+ <tab>Config</tab>
+ </param_tab_order>
+
+ <param>
+ <name>Name</name>
+ <key>name</key>
+ <value>""</value>
+ <type>string</type>
+ <hide>#if len($name()) > 0 then 'none' else 'part'#</hide>
+ </param>
+
+ <param>
+ <name>Number of Points</name>
+ <key>size</key>
+ <value>1024</value>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Number of Bins</name>
+ <key>bins</key>
+ <value>100</value>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Grid</name>
+ <key>grid</key>
+ <value>False</value>
+ <type>enum</type>
+ <hide>part</hide>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+ <param>
+ <name>Autoscale</name>
+ <key>autoscale</key>
+ <value>True</value>
+ <type>enum</type>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+
+ <param>
+ <name>Accumulate</name>
+ <key>accum</key>
+ <value>False</value>
+ <type>enum</type>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+
+ <param>
+ <name>Min x-axis</name>
+ <key>xmin</key>
+ <value>-1</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>Max x-axis</name>
+ <key>xmax</key>
+ <value>1</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>Number of Inputs</name>
+ <key>nconnections</key>
+ <value>1</value>
+ <type>int</type>
+ <hide>part</hide>
+ </param>
+
+ <param>
+ <name>Update Period</name>
+ <key>update_time</key>
+ <value>0.10</value>
+ <type>float</type>
+ <hide>part</hide>
+ </param>
+
+ <param>
+ <name>GUI Hint</name>
+ <key>gui_hint</key>
+ <value></value>
+ <type>gui_hint</type>
+ <hide>part</hide>
+ </param>
<param>
<name>Line 1 Label</name>
diff --git a/gr-qtgui/grc/qtgui_time_raster_x.xml
b/gr-qtgui/grc/qtgui_time_raster_x.xml
index d303e7f..512773a 100644
--- a/gr-qtgui/grc/qtgui_time_raster_x.xml
+++ b/gr-qtgui/grc/qtgui_time_raster_x.xml
@@ -5,12 +5,12 @@
###################################################
-->
<block>
- <name>QT GUI Time Raster Sink</name>
- <key>qtgui_time_raster_sink_x</key>
- <import>from PyQt4 import Qt</import>
- <import>from gnuradio import qtgui</import>
- <import>import sip</import>
- <make>#set $win = 'self._%s_win'%$id
+ <name>QT GUI Time Raster Sink</name>
+ <key>qtgui_time_raster_sink_x</key>
+ <import>from PyQt4 import Qt</import>
+ <import>from gnuradio import qtgui</import>
+ <import>import sip</import>
+ <make>#set $win = 'self._%s_win'%$id
qtgui.$(type.fcn)(
$samp_rate,
$nrows,
@@ -22,6 +22,7 @@ qtgui.$(type.fcn)(
)
self.$(id).set_update_time($update_time)
+self.$(id).enable_grid($grid)
labels = [$label1, $label2, $label3, $label4, $label5,
$label6, $label7, $label8, $label9, $label10]
@@ -39,87 +40,110 @@ for i in xrange($nconnections):
self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), Qt.QWidget)
$(gui_hint()($win))</make>
- <callback>set_num_rows($nrows)</callback>
- <callback>set_num_cols($ncols)</callback>
- <callback>set_multiplier($mult)</callback>
- <callback>set_offset($offset)</callback>
- <callback>set_update_time($update_time)</callback>
- <callback>set_title($which, $title)</callback>
- <callback>set_color($which, $color)</callback>
-
- <param_tab_order>
- <tab>General</tab>
- <tab>Config</tab>
- </param_tab_order>
-
- <param>
- <name>Type</name>
- <key>type</key>
- <value>complex</value>
- <type>enum</type>
-
<option><name>Byte</name><key>byte</key><opt>fcn:time_raster_sink_b</opt></option>
-
<option><name>Float</name><key>float</key><opt>fcn:time_raster_sink_f</opt></option>
- </param>
-
- <param>
- <name>Name</name>
- <key>name</key>
- <value>""</value>
- <type>string</type>
- <hide>#if len($name()) > 0 then 'none' else 'part'#</hide>
- </param>
-
- <param>
- <name>Sample Rate</name>
- <key>samp_rate</key>
- <value>samp_rate</value>
- <type>real</type>
- </param>
- <param>
- <name>Num. Rows</name>
- <key>nrows</key>
- <type>int</type>
- </param>
- <param>
- <name>Num. Cols</name>
- <key>ncols</key>
- <type>int</type>
- </param>
- <param>
- <name>Multiplier</name>
- <key>mult</key>
- <value>[]</value>
- <type>real_vector</type>
- <hide>part</hide>
- </param>
- <param>
- <name>Offset</name>
- <key>offset</key>
- <value>[]</value>
- <type>real_vector</type>
- <hide>part</hide>
- </param>
- <param>
- <name>Number of Inputs</name>
- <key>nconnections</key>
- <value>1</value>
- <type>int</type>
- <hide>part</hide>
- </param>
- <param>
- <name>Update Period</name>
- <key>update_time</key>
- <value>0.10</value>
- <type>real</type>
- <hide>part</hide>
- </param>
- <param>
- <name>GUI Hint</name>
- <key>gui_hint</key>
- <value></value>
- <type>gui_hint</type>
- <hide>part</hide>
- </param>
+ <callback>set_num_rows($nrows)</callback>
+ <callback>set_num_cols($ncols)</callback>
+ <callback>set_multiplier($mult)</callback>
+ <callback>set_offset($offset)</callback>
+ <callback>set_update_time($update_time)</callback>
+ <callback>set_title($which, $title)</callback>
+ <callback>set_color($which, $color)</callback>
+
+ <param_tab_order>
+ <tab>General</tab>
+ <tab>Config</tab>
+ </param_tab_order>
+
+ <param>
+ <name>Type</name>
+ <key>type</key>
+ <value>complex</value>
+ <type>enum</type>
+
<option><name>Byte</name><key>byte</key><opt>fcn:time_raster_sink_b</opt></option>
+
<option><name>Float</name><key>float</key><opt>fcn:time_raster_sink_f</opt></option>
+ </param>
+
+ <param>
+ <name>Name</name>
+ <key>name</key>
+ <value>""</value>
+ <type>string</type>
+ <hide>#if len($name()) > 0 then 'none' else 'part'#</hide>
+ </param>
+
+ <param>
+ <name>Sample Rate</name>
+ <key>samp_rate</key>
+ <value>samp_rate</value>
+ <type>real</type>
+ </param>
+
+ <param>
+ <name>Num. Rows</name>
+ <key>nrows</key>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Num. Cols</name>
+ <key>ncols</key>
+ <type>int</type>
+ </param>
+
+ <param>
+ <name>Grid</name>
+ <key>grid</key>
+ <value>False</value>
+ <type>enum</type>
+ <hide>part</hide>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+
+ <param>
+ <name>Multiplier</name>
+ <key>mult</key>
+ <value>[]</value>
+ <type>real_vector</type>
+ <hide>part</hide>
+ </param>
+
+ <param>
+ <name>Offset</name>
+ <key>offset</key>
+ <value>[]</value>
+ <type>real_vector</type>
+ <hide>part</hide>
+ </param>
+
+ <param>
+ <name>Number of Inputs</name>
+ <key>nconnections</key>
+ <value>1</value>
+ <type>int</type>
+ <hide>part</hide>
+ </param>
+
+ <param>
+ <name>Update Period</name>
+ <key>update_time</key>
+ <value>0.10</value>
+ <type>real</type>
+ <hide>part</hide>
+ </param>
+
+ <param>
+ <name>GUI Hint</name>
+ <key>gui_hint</key>
+ <value></value>
+ <type>gui_hint</type>
+ <hide>part</hide>
+ </param>
<param>
diff --git a/gr-qtgui/grc/qtgui_time_sink_x.xml
b/gr-qtgui/grc/qtgui_time_sink_x.xml
index f40487e..c605a0a 100644
--- a/gr-qtgui/grc/qtgui_time_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_time_sink_x.xml
@@ -23,6 +23,7 @@ self.$(id).set_y_axis($ymin, $ymax)
self.$(id).enable_tags(-1, $entags)
self.$(id).set_trigger_mode($tr_mode, $tr_slope, $tr_level, $tr_delay,
$tr_chan, $tr_tag)
self.$(id).enable_autoscale($autoscale)
+self.$(id).enable_grid($grid)
labels = [$label1, $label2, $label3, $label4, $label5,
$label6, $label7, $label8, $label9, $label10]
@@ -110,6 +111,22 @@ $(gui_hint()($win))</make>
</param>
<param>
+ <name>Grid</name>
+ <key>grid</key>
+ <value>False</value>
+ <type>enum</type>
+ <hide>part</hide>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+
+ <param>
<name>Autoscale</name>
<key>autoscale</key>
<value>False</value>
diff --git a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml
b/gr-qtgui/grc/qtgui_waterfall_sink_x.xml
index c6c6f68..d6e0f59 100644
--- a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_waterfall_sink_x.xml
@@ -21,6 +21,7 @@ qtgui.$(type.fcn)(
$nconnections \#number of inputs
)
self.$(id).set_update_time($update_time)
+self.$(id).enable_grid($grid)
labels = [$label1, $label2, $label3, $label4, $label5,
$label6, $label7, $label8, $label9, $label10]
@@ -142,6 +143,22 @@ $(gui_hint()($win))</make>
</param>
<param>
+ <name>Grid</name>
+ <key>grid</key>
+ <value>False</value>
+ <type>enum</type>
+ <hide>part</hide>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ </option>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ </option>
+ </param>
+
+ <param>
<name>Number of Inputs</name>
<key>nconnections</key>
<value>1</value>
diff --git a/gr-qtgui/include/gnuradio/qtgui/const_sink_c.h
b/gr-qtgui/include/gnuradio/qtgui/const_sink_c.h
index 84f9a87..b942032 100644
--- a/gr-qtgui/include/gnuradio/qtgui/const_sink_c.h
+++ b/gr-qtgui/include/gnuradio/qtgui/const_sink_c.h
@@ -132,6 +132,7 @@ namespace gr {
virtual void enable_menu(bool en=true) = 0;
virtual void enable_autoscale(bool en) = 0;
+ virtual void enable_grid(bool en) = 0;
virtual int nsamps() const = 0;
virtual void reset() = 0;
diff --git a/gr-qtgui/lib/const_sink_c_impl.cc
b/gr-qtgui/lib/const_sink_c_impl.cc
index 93986d8..2da1c21 100644
--- a/gr-qtgui/lib/const_sink_c_impl.cc
+++ b/gr-qtgui/lib/const_sink_c_impl.cc
@@ -351,6 +351,12 @@ namespace gr {
}
void
+ const_sink_c_impl::enable_grid(bool en)
+ {
+ d_main_gui->setGrid(en);
+ }
+
+ void
const_sink_c_impl::reset()
{
gr::thread::scoped_lock lock(d_mutex);
diff --git a/gr-qtgui/lib/const_sink_c_impl.h b/gr-qtgui/lib/const_sink_c_impl.h
index 0f1540d..964759b 100644
--- a/gr-qtgui/lib/const_sink_c_impl.h
+++ b/gr-qtgui/lib/const_sink_c_impl.h
@@ -117,6 +117,7 @@ namespace gr {
int nsamps() const;
void enable_menu(bool en);
void enable_autoscale(bool en);
+ void enable_grid(bool en);
void reset();
int work(int noutput_items,
- [Commit-gnuradio] [gnuradio] branch master updated (2bb2b31 -> 001ab47), git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 08/37: uhd: Added more type checking and flexibility to commands and tags, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 07/37: uhd: Added GRC bindings for command interface, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 02/37: digital: using new var_value for constellation variables, git, 2014/07/17
- [Commit-gnuradio] [gnuradio] 01/37: grc: design time values for object-like variables, git, 2014/07/17
- [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 <=
- [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, 2014/07/17