removed repurposing of pads
authorJosh Blum <josh@joshknows.com>
Wed, 26 Aug 2009 06:42:18 +0000 (23:42 -0700)
committerJosh Blum <josh@joshknows.com>
Wed, 26 Aug 2009 06:42:18 +0000 (23:42 -0700)
grc/blocks/pad_sink.xml
grc/blocks/pad_source.xml
grc/python/flow_graph.tmpl

index 999de315dbb166f7b057459d375be982e6a8401e..734526793fae96b1c1ef890faf61feeab0c3167b 100644 (file)
@@ -8,20 +8,6 @@
        <name>Pad Sink</name>
        <key>pad_sink</key>
        <make></make>
-       <param>
-               <name>Mode</name>
-               <key>mode</key>
-               <value>hb</value>
-               <type>enum</type>
-               <option>
-                       <name>Hierarchical</name>
-                       <key>hb</key>
-               </option>
-               <option>
-                       <name>Continuation</name>
-                       <key>cont</key>
-               </option>
-       </param>
        <param>
                <name>Num Inputs</name>
                <key>nports</key>
                <nports>$nports</nports>
        </sink>
        <doc>
-Continuation Mode:
-The inputs of this block can be aliased by one or more pad source blocks.
-
-Hierarchical Mode:
 The inputs of this block will become the outputs to this flow graph when it is instantiated as a hierarchical block. \
 Limit one sink pad block per flow graph.
        </doc>
index 26491adb3986b16455e3ae07b0eac7f3b43263b2..f44d9623879d77b1c35026b82eeddf745bdc3b3c 100644 (file)
@@ -8,20 +8,6 @@
        <name>Pad Source</name>
        <key>pad_source</key>
        <make></make>
-       <param>
-               <name>Mode</name>
-               <key>mode</key>
-               <value>hb</value>
-               <type>enum</type>
-               <option>
-                       <name>Hierarchical</name>
-                       <key>hb</key>
-               </option>
-               <option>
-                       <name>Continuation</name>
-                       <key>cont</key>
-               </option>
-       </param>
        <param>
                <name>Num Outputs</name>
                <key>nports</key>
                <value>1</value>
                <type>int</type>
        </param>
-       <param>
-               <name>Pad Sink ID</name>
-               <key>pad_sink_id</key>
-               <value>pad_sink_0</value>
-               <type>string</type>
-               <hide>#if $mode() == 'cont' then 'none' else 'all'#</hide>
-       </param>
        <check>$vlen &gt; 0</check>
        <check>0 &lt; $nports</check>
        <source>
                <nports>$nports</nports>
        </source>
        <doc>
-Continuation Mode:
-The outputs of this block will alias the inputs of the pad sink specified by "pad sink id".
-
-Hierarchical Mode:
 The outputs of this block will become the inputs to this flow graph when it is instantiated as a hierarchical block. \
 Limit one source pad block per flow graph. \
 The "pad sink id" will be ignored in this mode.
index 924a280c4548cdd71d0d1b182d262f7dc4b45bcc..5e5844052f491b58c7c4184a33fe3b12db23bd89 100644 (file)
@@ -154,6 +154,13 @@ class $(class_name)(gr.hier_block2):
 ##     The port name should be the id of the parent block.
 ##     However, port names for IO pads should be self.
 ########################################################
+#def make_port_name($port)
+       #if $port.get_parent().get_key().startswith('pad_')
+self#slurp
+       #else
+self.$port.get_parent().get_id()#slurp
+       #end if
+#end def
 #if $connections
 
                $DIVIDER
@@ -161,36 +168,9 @@ class $(class_name)(gr.hier_block2):
                $DIVIDER
 #end if
 #for $con in $connections
-       ####################################################################
-       ## Logic to extract source and sink
-       ##   Special resolution logic for pad source in continuation mode
-       ####################################################################
        #set $source = $con.get_source()
        #set $sink = $con.get_sink()
-       #if $source.get_parent().get_key() == 'pad_source' and $source.get_parent().get_param('mode').get_value() == 'cont'
-               #set $pad_sink_id = $source.get_parent().get_param('pad_sink_id').get_evaluated()
-               #set $pad_sink = filter(lambda b: b.get_id() == pad_sink_id, $blocks)[0]
-               #set $source = $pad_sink.get_sink($source.get_key()).get_connections()[0].get_source()
-       #end if
-       ####################################################################
-       ## Logic to extract source and sink names
-       ####################################################################
-       #if $source.get_parent().get_key() == 'pad_source'
-               #set $source_name = 'self'
-       #else
-               #set $source_name = 'self.' + $source.get_parent().get_id()
-       #end if
-       #if $sink.get_parent().get_key() == 'pad_sink'
-               #set $sink_name = 'self'
-       #else
-               #set $sink_name = 'self.' + $sink.get_parent().get_id()
-       #end if
-       ####################################################################
-       ## Dont make a connection for continuation pad sinks!!!
-       ####################################################################
-       #if not ($sink.get_parent().get_key() == 'pad_sink' and $sink.get_parent().get_param('mode').get_value() == 'cont')
-               self.connect(($source_name, $source.get_key()), ($sink_name, $sink.get_key()))
-       #end if
+               self.connect(($make_port_name($source), $source.get_key()), ($make_port_name($sink), $sink.get_key()))
 #end for
 
 ########################################################