diff options
author | Josh Blum | 2009-12-03 10:42:49 -0500 |
---|---|---|
committer | Josh Blum | 2009-12-03 10:42:49 -0500 |
commit | a4a1ada03e5da936d90a5d6e3bd31943a5ad9513 (patch) | |
tree | 3d7fa1541042b14d7068e92ba7d798b1bfaaca0f /grc/python/flow_graph.tmpl | |
parent | a198e5134b00a1d5b98b5447aafd3cdba8508609 (diff) | |
download | gnuradio-a4a1ada03e5da936d90a5d6e3bd31943a5ad9513.tar.gz gnuradio-a4a1ada03e5da936d90a5d6e3bd31943a5ad9513.tar.bz2 gnuradio-a4a1ada03e5da936d90a5d6e3bd31943a5ad9513.zip |
Allow for multiple io pads per hier flow graph.
Each io pad can have a different io signature.
Uses the iosignaturev for hier implementation.
Backwards compadible with exception:
Pad blocks that used multiple ports must be replaced with multiple pad blocks
as the new pad io blocks only support one port per block.
Diffstat (limited to 'grc/python/flow_graph.tmpl')
-rw-r--r-- | grc/python/flow_graph.tmpl | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index ab764006c..a1a9308aa 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -65,15 +65,25 @@ class $(class_name)(gr.top_block): def __init__($param_str): gr.top_block.__init__(self, "$title") #elif $generate_options == 'hb' - #set $in_sig = $flow_graph.get_input_signature() - #set $out_sig = $flow_graph.get_output_signature() + #set $in_sigs = $flow_graph.get_input_signaturev() + #set $out_sigs = $flow_graph.get_output_signaturev() class $(class_name)(gr.hier_block2): +#def make_io_sig($io_sigs) + #set $size_strs = ['%s*%s'%(io_sig['size'], io_sig['vlen']) for io_sig in $io_sigs] + #if len($io_sigs) == 0 +gr.io_signature(0, 0, 0)#slurp + #elif len($io_sigs) == 1 +gr.io_signature(1, 1, $size_strs[0])#slurp + #else +gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))])#slurp + #end if +#end def def __init__($param_str): gr.hier_block2.__init__( self, "$title", - gr.io_signature($in_sig.nports, $in_sig.nports, $in_sig.size*$in_sig.vlen), - gr.io_signature($out_sig.nports, $out_sig.nports, $out_sig.size*$out_sig.vlen), + $make_io_sig($in_sigs), + $make_io_sig($out_sigs), ) #end if ######################################################## |