diff options
23 files changed, 42 insertions, 72 deletions
diff --git a/gr-qtgui/grc/qtgui_sink_x.xml b/gr-qtgui/grc/qtgui_sink_x.xml index 6e5c9549b..7a5f5ec13 100644 --- a/gr-qtgui/grc/qtgui_sink_x.xml +++ b/gr-qtgui/grc/qtgui_sink_x.xml @@ -7,7 +7,7 @@ <block> <name>QT GUI Sink</name> <key>qtgui_sink_x</key> - <category>Graphical Sinks</category> + <category>QT GUI Widgets</category> <import>from PyQt4 import Qt</import> <import>from gnuradio.qtgui import qtgui</import> <import>from gnuradio.gr import firdes</import> diff --git a/gr-qtgui/grc/qtgui_tab_widget.xml b/gr-qtgui/grc/qtgui_tab_widget.xml index 66597b454..3c4edfd35 100644 --- a/gr-qtgui/grc/qtgui_tab_widget.xml +++ b/gr-qtgui/grc/qtgui_tab_widget.xml @@ -7,9 +7,10 @@ <block> <name>QT GUI Tab Widget</name> <key>qtgui_tab_widget</key> + <category>QT GUI Widgets</category> <import>from PyQt4 import Qt</import> <make>#set $win = 'self.%s'%$id -$win = Qt.QTabWidget(None) +Qt.QTabWidget(None) #for i, label in enumerate([$label0, $label1, $label2, $label3, $label4]) #if int($num_tabs()) > $i self.$(id)_widget_$(i) = Qt.QWidget() diff --git a/gr-qtgui/grc/qtgui_variable_chooser.xml b/gr-qtgui/grc/qtgui_variable_chooser.xml index 46e302bc7..d9c9c8f3f 100644 --- a/gr-qtgui/grc/qtgui_variable_chooser.xml +++ b/gr-qtgui/grc/qtgui_variable_chooser.xml @@ -1,14 +1,14 @@ <?xml version="1.0"?> <!-- ################################################### -##Variable Slider: -## a combined slider and text box form +##Variable Chooser: +## A chooser, radio buttons ################################################### --> <block> <name>QT GUI Chooser</name> <key>variable_qtgui_chooser</key> - <category>Variables</category> + <category>QT GUI Widgets</category> <import>from PyQt4 import Qt</import> <import>import PyQt4.Qwt5 as Qwt</import> <var_make>self.$(id) = $(id) = $value</var_make> diff --git a/gr-qtgui/grc/qtgui_variable_slider.xml b/gr-qtgui/grc/qtgui_variable_slider.xml index 4eeb7a29b..68000fa2f 100644 --- a/gr-qtgui/grc/qtgui_variable_slider.xml +++ b/gr-qtgui/grc/qtgui_variable_slider.xml @@ -8,7 +8,7 @@ <block> <name>QT GUI Slider</name> <key>variable_qtgui_slider</key> - <category>Variables</category> + <category>QT GUI Widgets</category> <import>from PyQt4 import Qt</import> <import>import PyQt4.Qwt5 as Qwt</import> <var_make>self.$(id) = $(id) = $value</var_make> diff --git a/gr-wxgui/grc/Makefile.am b/gr-wxgui/grc/Makefile.am index 26217077a..d8c7b3471 100644 --- a/gr-wxgui/grc/Makefile.am +++ b/gr-wxgui/grc/Makefile.am @@ -23,6 +23,7 @@ include $(top_srcdir)/Makefile.common grcblocksdir = $(grc_blocksdir) dist_grcblocks_DATA = \ + notebook.xml \ variable_check_box.xml \ variable_chooser.xml \ variable_slider.xml \ diff --git a/grc/blocks/notebook.xml b/gr-wxgui/grc/notebook.xml index d41db9e2d..bb3de51cb 100644 --- a/grc/blocks/notebook.xml +++ b/gr-wxgui/grc/notebook.xml @@ -5,8 +5,9 @@ ################################################### --> <block> - <name>Notebook</name> + <name>WX GUI Notebook</name> <key>notebook</key> + <category>WX GUI Widgets</category> <import>from grc_gnuradio import wxgui as grc_wxgui</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' self.$(id) = wx.Notebook($(parent).GetWin(), style=$style) diff --git a/gr-wxgui/grc/variable_check_box.xml b/gr-wxgui/grc/variable_check_box.xml index d1e4d990c..0c7bd1081 100644 --- a/gr-wxgui/grc/variable_check_box.xml +++ b/gr-wxgui/grc/variable_check_box.xml @@ -8,7 +8,7 @@ <block> <name>WX GUI Check Box</name> <key>variable_check_box</key> - <category>Variables</category> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/variable_chooser.xml b/gr-wxgui/grc/variable_chooser.xml index 99bf4389c..e16e88c5d 100644 --- a/gr-wxgui/grc/variable_chooser.xml +++ b/gr-wxgui/grc/variable_chooser.xml @@ -9,7 +9,7 @@ <block> <name>WX GUI Chooser</name> <key>variable_chooser</key> - <category>Variables</category> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/variable_slider.xml b/gr-wxgui/grc/variable_slider.xml index 09aa4d3d7..5e3c175aa 100644 --- a/gr-wxgui/grc/variable_slider.xml +++ b/gr-wxgui/grc/variable_slider.xml @@ -8,7 +8,7 @@ <block> <name>WX GUI Slider</name> <key>variable_slider</key> - <category>Variables</category> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/variable_static_text.xml b/gr-wxgui/grc/variable_static_text.xml index d7bb30eea..cd122e76a 100644 --- a/gr-wxgui/grc/variable_static_text.xml +++ b/gr-wxgui/grc/variable_static_text.xml @@ -8,7 +8,7 @@ <block> <name>WX GUI Static Text</name> <key>variable_static_text</key> - <category>Variables</category> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/variable_text_box.xml b/gr-wxgui/grc/variable_text_box.xml index c5416aee7..afff839cf 100644 --- a/gr-wxgui/grc/variable_text_box.xml +++ b/gr-wxgui/grc/variable_text_box.xml @@ -8,7 +8,7 @@ <block> <name>WX GUI Text Box</name> <key>variable_text_box</key> - <category>Variables</category> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import forms</import> <var_make>self.$(id) = $(id) = $value</var_make> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/wxgui_constellationsink2.xml b/gr-wxgui/grc/wxgui_constellationsink2.xml index 881c6eba3..c200790f9 100644 --- a/gr-wxgui/grc/wxgui_constellationsink2.xml +++ b/gr-wxgui/grc/wxgui_constellationsink2.xml @@ -7,6 +7,7 @@ <block> <name>WX GUI Constellation Sink</name> <key>wxgui_constellationsink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import constsink_gl</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' constsink_gl.const_sink_c( diff --git a/gr-wxgui/grc/wxgui_fftsink2.xml b/gr-wxgui/grc/wxgui_fftsink2.xml index b06220d1e..9b35ab848 100644 --- a/gr-wxgui/grc/wxgui_fftsink2.xml +++ b/gr-wxgui/grc/wxgui_fftsink2.xml @@ -7,6 +7,7 @@ <block> <name>WX GUI FFT Sink</name> <key>wxgui_fftsink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio import window</import> <import>from gnuradio.wxgui import fftsink2</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/wxgui_histosink2.xml b/gr-wxgui/grc/wxgui_histosink2.xml index 2f475fe2e..f4f6a2959 100644 --- a/gr-wxgui/grc/wxgui_histosink2.xml +++ b/gr-wxgui/grc/wxgui_histosink2.xml @@ -7,6 +7,7 @@ <block> <name>WX GUI Histo Sink</name> <key>wxgui_histosink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import histosink_gl</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' histosink_gl.histo_sink_f( diff --git a/gr-wxgui/grc/wxgui_numbersink2.xml b/gr-wxgui/grc/wxgui_numbersink2.xml index b3b4cb254..255926610 100644 --- a/gr-wxgui/grc/wxgui_numbersink2.xml +++ b/gr-wxgui/grc/wxgui_numbersink2.xml @@ -7,6 +7,7 @@ <block> <name>WX GUI Number Sink</name> <key>wxgui_numbersink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import numbersink2</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' numbersink2.$(type.fcn)( diff --git a/gr-wxgui/grc/wxgui_scopesink2.xml b/gr-wxgui/grc/wxgui_scopesink2.xml index 43922f45e..dbf983e11 100644 --- a/gr-wxgui/grc/wxgui_scopesink2.xml +++ b/gr-wxgui/grc/wxgui_scopesink2.xml @@ -7,6 +7,7 @@ <block> <name>WX GUI Scope Sink</name> <key>wxgui_scopesink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import scopesink2</import> <import>from gnuradio import gr</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/gr-wxgui/grc/wxgui_termsink.xml b/gr-wxgui/grc/wxgui_termsink.xml index ae15b98a6..3e35c7578 100644 --- a/gr-wxgui/grc/wxgui_termsink.xml +++ b/gr-wxgui/grc/wxgui_termsink.xml @@ -7,6 +7,7 @@ <block> <name>WX GUI Terminal Sink</name> <key>wxgui_termsink</key> + <category>WX GUI Widgets</category> <import>from gnuradio.wxgui import termsink</import> diff --git a/gr-wxgui/grc/wxgui_waterfallsink2.xml b/gr-wxgui/grc/wxgui_waterfallsink2.xml index 9789994be..7c646c3b2 100644 --- a/gr-wxgui/grc/wxgui_waterfallsink2.xml +++ b/gr-wxgui/grc/wxgui_waterfallsink2.xml @@ -7,6 +7,7 @@ <block> <name>WX GUI Waterfall Sink</name> <key>wxgui_waterfallsink2</key> + <category>WX GUI Widgets</category> <import>from gnuradio import window</import> <import>from gnuradio.wxgui import waterfallsink2</import> <make>#set $parent = $notebook() and 'self.%s.GetPage(%s)'%$notebook() or 'self' diff --git a/grc/blocks/Makefile.am b/grc/blocks/Makefile.am index 40353a1fa..d9ec0896e 100644 --- a/grc/blocks/Makefile.am +++ b/grc/blocks/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2008-2010 Free Software Foundation, Inc. +# Copyright 2008-2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -197,7 +197,6 @@ dist_ourdata_DATA = \ import.xml \ low_pass_filter.xml \ note.xml \ - notebook.xml \ options.xml \ pad_sink.xml \ pad_source.xml \ diff --git a/grc/blocks/block_tree.xml b/grc/blocks/block_tree.xml index 782d6ca9b..50c463f55 100644 --- a/grc/blocks/block_tree.xml +++ b/grc/blocks/block_tree.xml @@ -39,17 +39,6 @@ <block>virtual_sink</block> </cat> <cat> - <name>Graphical Sinks</name> - <block>wxgui_numbersink2</block> - <block>wxgui_scopesink2</block> - <block>wxgui_fftsink2</block> - <block>wxgui_constellationsink2</block> - <block>wxgui_waterfallsink2</block> - <block>wxgui_histosink2</block> - <block>wxgui_termsink</block> - <block>qtgui_sink_x</block> - </cat> - <cat> <name>Operators</name> <block>gr_add_xx</block> <block>gr_sub_xx</block> @@ -139,7 +128,7 @@ <block>gr_pll_freqdet_cf</block> <block>gr_pll_refout_cc</block> - <block>gr_fll_band_edge_cc</block> + <block>gr_fll_band_edge_cc</block> <block>gr_correlate_access_code_bb</block> <block>gr_pn_correlator_cc</block> @@ -263,7 +252,7 @@ <block>gr_additive_scrambler_bb</block> </cat> <cat> - <name>Vocoders</name> + <name>Vocoders</name> <block>blks2_cvsd_encode</block> <block>blks2_cvsd_decode</block> </cat> @@ -311,7 +300,5 @@ <block>xmlrpc_server</block> <block>xmlrpc_client</block> - - <block>notebook</block> </cat> </cat> diff --git a/grc/python/Generator.py b/grc/python/Generator.py index 7d08b914b..b669fa65a 100644 --- a/grc/python/Generator.py +++ b/grc/python/Generator.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or @@ -90,22 +90,20 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') imports = self._flow_graph.get_imports() variables = self._flow_graph.get_variables() parameters = self._flow_graph.get_parameters() - #list of variables with controls - controls = filter(lambda v: v.get_make(), variables) #list of blocks not including variables and imports and parameters and disabled - blocks = sorted(self._flow_graph.get_enabled_blocks(), lambda x, y: cmp(x.get_id(), y.get_id())) - probes = filter(lambda b: b.get_key().startswith('probe_'), blocks) #ensure probes are last in the block list - #get a list of notebooks and sort them according dependencies - notebooks = expr_utils.sort_objects( - filter(lambda b: b.get_key() == 'notebook', blocks), - lambda n: n.get_id(), lambda n: n.get_param('notebook').get_value(), - ) - notebooks += expr_utils.sort_objects( - filter(lambda b: b.get_key() == 'qtgui_tab_widget', blocks), - lambda n: n.get_id(), lambda n: n.get_param('gui_hint').get_value(), + def _get_block_sort_text(block): + code = block.get_make().replace(block.get_id(), ' ') + try: code += block.get_param('notebook').get_value() #older gui markup w/ wxgui + except: pass + try: code += block.get_param('gui_hint').get_value() #newer gui markup w/ qtgui + except: pass + return code + blocks = expr_utils.sort_objects( + self._flow_graph.get_enabled_blocks(), + lambda b: b.get_id(), _get_block_sort_text ) #list of regular blocks (all blocks minus the special ones) - blocks = filter(lambda b: b not in (imports + parameters + variables + probes + notebooks), blocks) + probes + blocks = filter(lambda b: b not in (imports + parameters), blocks) #list of connections where each endpoint is enabled connections = filter(lambda c: not c.is_msg(), self._flow_graph.get_enabled_connections()) messages = filter(lambda c: c.is_msg(), self._flow_graph.get_enabled_connections()) @@ -129,8 +127,6 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''') 'imports': imports, 'flow_graph': self._flow_graph, 'variables': variables, - 'notebooks': notebooks, - 'controls': controls, 'parameters': parameters, 'blocks': blocks, 'connections': connections, diff --git a/grc/python/Param.py b/grc/python/Param.py index 27258faab..303ab3ed8 100644 --- a/grc/python/Param.py +++ b/grc/python/Param.py @@ -1,5 +1,5 @@ """ -Copyright 2008, 2009, 2010 Free Software Foundation, Inc. +Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 88049a9ef..8757b5204 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -5,8 +5,6 @@ ##@param imports the import statements ##@param flow_graph the flow_graph ##@param variables the variable blocks -##@param notebooks a list of notebook blocks -##@param controls the variables with gui controls ##@param parameters the paramater blocks ##@param blocks the signal blocks ##@param connections the connections @@ -121,30 +119,6 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))]) $indent($var.get_var_make()) #end for ######################################################## -##Create Notebooks -######################################################## -#if $notebooks - - $DIVIDER - # Notebooks - $DIVIDER -#end if -#for $notebook in $notebooks - $indent($notebook.get_make()) -#end for -######################################################## -##Create Controls -######################################################## -#if $controls - - $DIVIDER - # Controls - $DIVIDER -#end if -#for $ctrl in $controls - $indent($ctrl.get_make()) -#end for -######################################################## ##Create Message Queues ######################################################## #if $messages @@ -166,7 +140,11 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))]) $DIVIDER #end if #for $blk in filter(lambda b: b.get_make(), $blocks) + #if $blk in $variables + $indent($blk.get_make()) + #else self.$blk.get_id() = $indent($blk.get_make()) + #end if #end for ######################################################## ##Create Connections |