diff options
Diffstat (limited to 'grc')
-rw-r--r-- | grc/blocks/Makefile.am | 3 | ||||
-rw-r--r-- | grc/blocks/qtgui_sink_x.xml | 123 | ||||
-rw-r--r-- | grc/python/flow_graph.tmpl | 13 |
3 files changed, 10 insertions, 129 deletions
diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index ea3c94cbe..56893b46f 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008, 2009 Free Software Foundation, Inc. +# Copyright 2008-2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -203,7 +203,6 @@ 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/qtgui_sink_x.xml b/grc/blocks/qtgui_sink_x.xml deleted file mode 100644 index c9fa12eef..000000000 --- a/grc/blocks/qtgui_sink_x.xml +++ /dev/null @@ -1,123 +0,0 @@ -<?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 676da33b4..108e15ca0 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -60,11 +60,12 @@ class $(class_name)(grc_wxgui.top_block_gui): self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) #end if #elif $generate_options == 'qt_gui' -class $(class_name)(gr.top_block): +class $(class_name)(gr.top_block, QtGui.QWidget): def __init__($param_str): gr.top_block.__init__(self, "$title") - self.qapp = QtGui.QApplication(sys.argv) + QtGui.QWidget.__init__(self) + self.layout = QtGui.QBoxLayout(QtGui.QBoxLayout.TopToBottom, self) #elif $generate_options == 'no_gui' class $(class_name)(gr.top_block): @@ -245,15 +246,19 @@ if __name__ == '__main__': if gr.enable_realtime_scheduling() != gr.RT_OK: print "Error: failed to enable realtime scheduling." #end if - tb = $(class_name)($(', '.join($params_eq_list))) #if $generate_options == 'wx_gui' + tb = $(class_name)($(', '.join($params_eq_list))) tb.Run($flow_graph.get_option('run')) #elif $generate_options == 'qt_gui' + qapp = QtGui.QApplication(sys.argv) + tb = $(class_name)($(', '.join($params_eq_list))) tb.start() - tb.qapp.exec_() + tb.show() + qapp.exec_() #elif $generate_options == 'no_gui' #set $run_options = $flow_graph.get_option('run_options') #if $run_options == 'prompt' + tb = $(class_name)($(', '.join($params_eq_list))) tb.start() raw_input('Press Enter to quit: ') tb.stop() |