X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=grc%2Fpython%2Fflow_graph.tmpl;h=dce4037d58a4a9cde77cf99ca7bd10120f81b279;hb=a08c659c122f24947421adf38e7260642a67381a;hp=924a280c4548cdd71d0d1b182d262f7dc4b45bcc;hpb=6d327a3ad5205a0cacb82578f32ae7ef00eeb111;p=debian%2Fgnuradio diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index 924a280c..dce4037d 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -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,35 +168,15 @@ 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() + ##resolve virtual sources to the actual sources + #if $source.get_parent().is_virtual_source() + #set $source = $source.resolve_virtual_source() #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())) + ##do not generate connections with virtual sinks + #if not $sink.get_parent().is_virtual_sink() + self.connect(($make_port_name($source), $source.get_key()), ($make_port_name($sink), $sink.get_key())) #end if #end for