From a3ba8cf268816af51c4bb39ea7ecd7e85ea0807b Mon Sep 17 00:00:00 2001 From: jblum Date: Fri, 1 May 2009 20:28:04 +0000 Subject: [PATCH] Merged grc developer branch r10679:10938 Misc fixes and internal changes. Added help menu for usage tips. Added drag and drop for blocks. Removed callback controls, adopted forms. Any type can have enumerated options. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10941 221aa14e-8319-0410-a670-987f0aec2ac5 --- config/grc_grc.m4 | 5 - grc/Makefile.inc | 1 - .../platforms/python/blocks/audio_sink.xml | 4 +- .../platforms/python/blocks/audio_source.xml | 4 +- .../blocks/blks2_rational_resampler_xxx.xml | 4 +- .../platforms/python/blocks/gr_fft_vxx.xml | 2 +- .../platforms/python/blocks/gr_mute_xx.xml | 8 + .../python/blocks/gr_noise_source_x.xml | 3 +- .../python/blocks/gr_sig_source_x.xml | 3 +- .../python/blocks/gr_vector_sink_x.xml | 10 +- .../python/blocks/gr_vector_source_x.xml | 10 +- grc/data/platforms/python/blocks/options.xml | 12 +- .../platforms/python/blocks/parameter.xml | 12 +- .../python/blocks/probe_function.xml | 2 +- .../python/blocks/usrp2_sink_xxxx.xml | 4 +- .../python/blocks/usrp2_source_xxxx.xml | 4 +- .../python/blocks/usrp_dual_source_x.xml | 12 +- .../python/blocks/usrp_simple_sink_x.xml | 8 +- .../python/blocks/usrp_simple_source_x.xml | 16 +- .../python/blocks/variable_chooser.xml | 70 +- .../platforms/python/blocks/variable_sink.xml | 6 +- .../python/blocks/variable_slider.xml | 77 +- .../python/blocks/variable_text_box.xml | 50 +- .../blocks/wxgui_constellationsink2.xml | 2 +- .../python/blocks/wxgui_fftsink2.xml | 10 +- .../python/blocks/wxgui_histosink2.xml | 2 +- .../python/blocks/wxgui_numbersink2.xml | 10 +- .../python/blocks/wxgui_scopesink2.xml | 6 +- .../python/blocks/wxgui_waterfallsink2.xml | 4 +- .../platforms/python/blocks/xmlrpc_client.xml | 4 +- grc/data/platforms/python/flow_graph.tmpl | 30 +- grc/examples/Makefile.am | 40 +- grc/examples/audio/Makefile.am | 26 - grc/examples/simple/Makefile.am | 28 - grc/examples/trellis/Makefile.am | 28 - grc/examples/usrp/Makefile.am | 30 - grc/examples/usrp/usrp2_const_wave.grc | 168 +++-- grc/examples/usrp/usrp2_dpsk_mod.grc | 693 ++++++++++++++++++ grc/examples/usrp/usrp2_fft.grc | 133 ++-- grc/examples/usrp/usrp_two_tone_loopback.grc | 527 +++++++------ grc/examples/usrp/usrp_wbfm_receive.grc | 294 ++++---- grc/examples/xmlrpc/Makefile.am | 30 - grc/scripts/grc | 8 + grc/src/grc_gnuradio/wxgui/Makefile.am | 8 +- grc/src/grc_gnuradio/wxgui/__init__.py | 8 - .../grc_gnuradio/wxgui/callback_controls.py | 303 -------- grc/src/grc_gnuradio/wxgui/forms/__init__.py | 54 ++ .../grc_gnuradio/wxgui/forms/converters.py | 143 ++++ grc/src/grc_gnuradio/wxgui/forms/forms.py | 473 ++++++++++++ grc/src/grc_gnuradio/wxgui/top_block_gui.py | 4 +- grc/src/gui/ActionHandler.py | 77 +- grc/src/gui/Actions.py | 140 ++-- grc/src/gui/Bars.py | 12 +- grc/src/gui/BlockTreeWindow.py | 42 +- grc/src/gui/Constants.py | 23 +- grc/src/gui/Dialogs.py | 20 +- grc/src/gui/DrawingArea.py | 36 +- grc/src/gui/ParamsDialog.py | 8 +- grc/src/platforms/base/Block.py | 43 +- grc/src/platforms/base/FlowGraph.py | 37 +- grc/src/platforms/base/Param.py | 103 ++- grc/src/platforms/base/Platform.py | 35 +- grc/src/platforms/base/Port.py | 3 +- grc/src/platforms/gui/Block.py | 33 +- grc/src/platforms/gui/Connection.py | 6 +- grc/src/platforms/gui/Constants.py | 51 +- grc/src/platforms/gui/Element.py | 19 +- grc/src/platforms/gui/FlowGraph.py | 135 ++-- grc/src/platforms/gui/Param.py | 70 +- grc/src/platforms/gui/Port.py | 18 +- grc/src/platforms/gui/Utils.py | 13 +- grc/src/platforms/python/Block.py | 11 +- grc/src/platforms/python/Constants.py.in | 1 + grc/src/platforms/python/FlowGraph.py | 28 +- grc/src/platforms/python/Generator.py | 2 +- grc/src/platforms/python/Param.py | 6 +- grc/src/platforms/python/Port.py | 9 +- grc/src/utils/Makefile.am | 3 +- grc/src/utils/__init__.py | 66 +- grc/src/utils/odict.py | 93 +++ grc/todo.txt | 2 - 81 files changed, 2906 insertions(+), 1632 deletions(-) delete mode 100644 grc/examples/audio/Makefile.am delete mode 100644 grc/examples/simple/Makefile.am delete mode 100644 grc/examples/trellis/Makefile.am delete mode 100644 grc/examples/usrp/Makefile.am create mode 100644 grc/examples/usrp/usrp2_dpsk_mod.grc delete mode 100644 grc/examples/xmlrpc/Makefile.am delete mode 100644 grc/src/grc_gnuradio/wxgui/callback_controls.py create mode 100644 grc/src/grc_gnuradio/wxgui/forms/__init__.py create mode 100644 grc/src/grc_gnuradio/wxgui/forms/converters.py create mode 100644 grc/src/grc_gnuradio/wxgui/forms/forms.py create mode 100644 grc/src/utils/odict.py diff --git a/config/grc_grc.m4 b/config/grc_grc.m4 index 07463a52..d8bc02a2 100644 --- a/config/grc_grc.m4 +++ b/config/grc_grc.m4 @@ -60,11 +60,6 @@ AC_DEFUN([GRC_GRC],[ grc/src/utils/Makefile \ grc/src/gui/Makefile \ grc/examples/Makefile \ - grc/examples/xmlrpc/Makefile \ - grc/examples/usrp/Makefile \ - grc/examples/audio/Makefile \ - grc/examples/simple/Makefile \ - grc/examples/trellis/Makefile \ grc/Makefile \ grc/data/Makefile \ grc/data/platforms/Makefile \ diff --git a/grc/Makefile.inc b/grc/Makefile.inc index 8acd4e10..4d78070d 100644 --- a/grc/Makefile.inc +++ b/grc/Makefile.inc @@ -23,7 +23,6 @@ include $(top_srcdir)/Makefile.common grc_gnuradio_prefix = $(pythondir)/grc_gnuradio grc_src_prefix = $(pythondir)/gnuradio/grc grc_data_prefix = $(datadir)/$(PACKAGE)/grc -grc_examples_prefix = $(exampledir)/grc grc_base_data_dir = $(grc_data_prefix)/platforms/base grc_python_data_dir = $(grc_data_prefix)/platforms/python grc_python_blocks_dir = $(grc_data_prefix)/platforms/python/blocks diff --git a/grc/data/platforms/python/blocks/audio_sink.xml b/grc/data/platforms/python/blocks/audio_sink.xml index decaf2a0..75d58347 100644 --- a/grc/data/platforms/python/blocks/audio_sink.xml +++ b/grc/data/platforms/python/blocks/audio_sink.xml @@ -13,7 +13,7 @@ Sample Rate samp_rate 32000 - enum + int + + Vec Length + vlen + 1 + int + + $vlen > 0 out $type + $vlen diff --git a/grc/data/platforms/python/blocks/options.xml b/grc/data/platforms/python/blocks/options.xml index 11e46bbe..07f659af 100644 --- a/grc/data/platforms/python/blocks/options.xml +++ b/grc/data/platforms/python/blocks/options.xml @@ -10,10 +10,14 @@ Options options from gnuradio import gr -#if $generate_options.eval == 'wx_gui' +#if $generate_options() == 'wx_gui' from grc_gnuradio import wxgui as grc_wxgui import wx #end if +#if $generate_options() != 'hb' +from optparse import OptionParser +from gnuradio.eng_option import eng_option +#end if @@ -64,16 +68,16 @@ import wx category Custom string - #if $generate_options.eval == 'hb' then 'none' else 'all'# + #if $generate_options() == 'hb' then 'none' else 'all'# Realtime Scheduling realtime_scheduling enum - #if $generate_options.eval == 'hb' + #if $generate_options() == 'hb' all#slurp -#elif $realtime_scheduling.eval +#elif $realtime_scheduling() none#slurp #else part#slurp diff --git a/grc/data/platforms/python/blocks/parameter.xml b/grc/data/platforms/python/blocks/parameter.xml index de208501..e7bf6156 100644 --- a/grc/data/platforms/python/blocks/parameter.xml +++ b/grc/data/platforms/python/blocks/parameter.xml @@ -7,13 +7,13 @@ Parameter parameter - from optparse import OptionParser $value Label label string + #if $label() then 'none' else 'part'# Value @@ -41,7 +41,7 @@ @@ -65,12 +65,14 @@ -This block represents a parameter to the flow graph, \ -used when the flow graph is instantiated as a hier block. +This block represents a parameter to the flow graph. \ +A parameter can be used to pass command line arguments into a top block. \ +Or, parameters can pass arguments into an instantiated hierarchical block. The paramater value cannot depend on any variables. -Leave the label blank to use the parameter id as the label. +Leave the label blank to use the parameter id as the label. \ +The label only applies when this flow graph is instantiated as a hierarchical block. When type is not None, this parameter also becomes a command line option of the form --[id] [value]. diff --git a/grc/data/platforms/python/blocks/probe_function.xml b/grc/data/platforms/python/blocks/probe_function.xml index d4687852..ac0b3dcd 100644 --- a/grc/data/platforms/python/blocks/probe_function.xml +++ b/grc/data/platforms/python/blocks/probe_function.xml @@ -9,7 +9,7 @@ probe_function from grc_gnuradio import blks2 as grc_blks2 grc_blks2.probe_function( - probe_callback=self.$(block_id.eval).$(function_name.eval), + probe_callback=self.$(block_id()).$(function_name()), probe_rate=$probe_rate, ) set_probe_rate($probe_rate) diff --git a/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml b/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml index e6e31578..264ed4f2 100644 --- a/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml +++ b/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml @@ -8,9 +8,9 @@ USRP2 Sink usrp2_sink_xxxx from gnuradio import usrp2 - #if not $interface.eval and not $mac_addr.eval + #if not $interface() and not $mac_addr() usrp2.sink_$(type.fcn)() -#elif not $mac_addr.eval +#elif not $mac_addr() usrp2.sink_$(type.fcn)($interface) #else usrp2.sink_$(type.fcn)($interface, $mac_addr) diff --git a/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml b/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml index 8b8ae324..54bea7a4 100644 --- a/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml +++ b/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml @@ -8,9 +8,9 @@ USRP2 Source usrp2_source_xxxx from gnuradio import usrp2 - #if not $interface.eval and not $mac_addr.eval + #if not $interface() and not $mac_addr() usrp2.source_$(type.fcn)() -#elif not $mac_addr.eval +#elif not $mac_addr() usrp2.source_$(type.fcn)($interface) #else usrp2.source_$(type.fcn)($interface, $mac_addr) diff --git a/grc/data/platforms/python/blocks/usrp_dual_source_x.xml b/grc/data/platforms/python/blocks/usrp_dual_source_x.xml index 823850b5..cb75fcea 100644 --- a/grc/data/platforms/python/blocks/usrp_dual_source_x.xml +++ b/grc/data/platforms/python/blocks/usrp_dual_source_x.xml @@ -8,8 +8,8 @@ USRP Dual Source usrp_dual_source_x from grc_gnuradio import usrp as grc_usrp - grc_usrp.dual_source_$(type.fcn)(which=$which, rx_ant_a='$rx_ant_a', rx_ant_b='$rx_ant_b') -#if $format.eval + grc_usrp.dual_source_$(type.fcn)(which=$which, rx_ant_a=$rx_ant_a, rx_ant_b=$rx_ant_b) +#if $format() self.$(id).set_format(width=$format.width, shift=$format.shift) #end if self.$(id).set_decim_rate($decimation) @@ -42,7 +42,7 @@ self.$(id).set_gain_b($gain_b) format enum - #if $format.eval then '' else 'part'# + #if $format() then '' else 'part'# RX Antenna A rx_ant_a - enum + RXA + string RX Antenna B rx_ant_b - enum + RXA + string