diff options
Diffstat (limited to 'grc')
-rw-r--r-- | grc/blocks/Makefile.am | 1 | ||||
-rw-r--r-- | grc/blocks/block_tree.xml | 1 | ||||
-rw-r--r-- | grc/blocks/options.xml | 8 | ||||
-rw-r--r-- | grc/blocks/qtgui_sink_x.xml | 123 | ||||
-rw-r--r-- | grc/python/flow_graph.tmpl | 9 |
5 files changed, 142 insertions, 0 deletions
diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index 18420a013..ea3c94cbe 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -203,6 +203,7 @@ dist_ourdata_DATA = \ pad_source.xml \ parameter.xml \ probe_function.xml \ + qtgui_sink_x.xml \ random_source_x.xml \ root_raised_cosine_filter.xml \ trellis_encoder_xx.xml \ diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 610a88102..644841884 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -47,6 +47,7 @@ <block>wxgui_waterfallsink2</block> <block>wxgui_histosink2</block> <block>wxgui_termsink</block> + <block>qtgui_sink_x</block> </cat> <cat> <name>Operators</name> diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml index 4d0dd2899..62ceeba0f 100644 --- a/grc/blocks/options.xml +++ b/grc/blocks/options.xml @@ -15,6 +15,10 @@ from grc_gnuradio import wxgui as grc_wxgui import wx #end if +#if $generate_options() == 'qt_gui' +from PyQt4 import QtGui +import sys +#end if #if $generate_options() != 'hb' from optparse import OptionParser from gnuradio.eng_option import eng_option @@ -62,6 +66,10 @@ else: self.stop(); self.wait()</callback> <key>wx_gui</key> </option> <option> + <name>QT GUI</name> + <key>qt_gui</key> + </option> + <option> <name>No GUI</name> <key>no_gui</key> </option> diff --git a/grc/blocks/qtgui_sink_x.xml b/grc/blocks/qtgui_sink_x.xml new file mode 100644 index 000000000..c9fa12eef --- /dev/null +++ b/grc/blocks/qtgui_sink_x.xml @@ -0,0 +1,123 @@ +<?xml version="1.0"?> +<!-- +################################################### +##QT GUI Sink +################################################### + --> +<block> + <name>QT GUI Sink</name> + <key>qtgui_sink_x</key> + <import>from gnuradio.qtgui import qtgui</import> + <import>from gnuradio.gr import firdes</import> + <import>import sip</import> + <make>qtgui.$(type.fcn)( + $fftsize, \#fftsize + $wintype, \#wintype + $fc, \#fc + $bw, \#bw + $name, \#name + $plotfreq, \#plotfreq + $plotwaterfall, \#plotwaterfall + $plotwaterfall3d, \#plotwaterfall3d + $plottime, \#plottime + $plotconst, \#plotconst +) +self._$(id)_win = sip.wrapinstance(self.$(id).pyqwidget(), QtGui.QWidget) +self._$(id)_win.show()</make> + <callback>set_frequency_range($fc, $bw)</callback> + <param> + <name>Type</name> + <key>type</key> + <value>complex</value> + <type>enum</type> + <option><name>Complex</name><key>complex</key><opt>fcn:sink_c</opt></option> + <option><name>Float</name><key>float</key><opt>fcn:sink_f</opt></option> + </param> + <param> + <name>Name</name> + <key>name</key> + <value>QT GUI Plot</value> + <type>string</type> + </param> + <param> + <name>FFT Size</name> + <key>fftsize</key> + <value>1024</value> + <type>int</type> + </param> + <param> + <name>Window Type</name> + <key>wintype</key> + <value>firdes.WIN_BLACKMAN_hARRIS</value> + <type>int</type> + <hide>part</hide> + <option> + <name>Blackman-harris</name> + <key>firdes.WIN_BLACKMAN_hARRIS</key> + </option> + </param> + <param> + <name>Center Frequency (Hz)</name> + <key>fc</key> + <value>0</value> + <type>real</type> + </param> + <param> + <name>Bandwidth (Hz)</name> + <key>bw</key> + <value>samp_rate</value> + <type>real</type> + </param> + <param> + <name>Plot Frequency</name> + <key>plotfreq</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>Plot Waterfall</name> + <key>plotwaterfall</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>Plot Waterfall 3D</name> + <key>plotwaterfall3d</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>Plot Time</name> + <key>plottime</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <param> + <name>Plot Const</name> + <key>plotconst</key> + <value>True</value> + <type>bool</type> + <hide>part</hide> + <option><name>On</name><key>True</key></option> + <option><name>Off</name><key>False</key></option> + </param> + <sink> + <name>in</name> + <type>$type</type> + <nports>$num_inputs</nports> + </sink> + <doc> + </doc> +</block> diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index a1a9308aa..676da33b4 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -59,6 +59,12 @@ class $(class_name)(grc_wxgui.top_block_gui): _icon_path = "$icon.get_filename()" self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #end if +#elif $generate_options == 'qt_gui' +class $(class_name)(gr.top_block): + + def __init__($param_str): + gr.top_block.__init__(self, "$title") + self.qapp = QtGui.QApplication(sys.argv) #elif $generate_options == 'no_gui' class $(class_name)(gr.top_block): @@ -242,6 +248,9 @@ if __name__ == '__main__': tb = $(class_name)($(', '.join($params_eq_list))) #if $generate_options == 'wx_gui' tb.Run($flow_graph.get_option('run')) + #elif $generate_options == 'qt_gui' + tb.start() + tb.qapp.exec_() #elif $generate_options == 'no_gui' #set $run_options = $flow_graph.get_option('run_options') #if $run_options == 'prompt' |