diff options
Diffstat (limited to 'grc/python')
-rw-r--r-- | grc/python/Param.py | 29 | ||||
-rw-r--r-- | grc/python/Port.py | 9 | ||||
-rw-r--r-- | grc/python/flow_graph.tmpl | 4 |
3 files changed, 26 insertions, 16 deletions
diff --git a/grc/python/Param.py b/grc/python/Param.py index 2ca1d0ec0..dd18d1c44 100644 --- a/grc/python/Param.py +++ b/grc/python/Param.py @@ -83,21 +83,30 @@ COMPLEX_TYPES = tuple(COMPLEX_TYPES + REAL_TYPES + INT_TYPES) REAL_TYPES = tuple(REAL_TYPES + INT_TYPES) INT_TYPES = tuple(INT_TYPES) +##possible param types +TYPES = [ + 'raw', 'enum', + 'complex', 'real', 'int', + 'complex_vector', 'real_vector', 'int_vector', + 'hex', 'string', 'bool', + 'file_open', 'file_save', + 'id', 'stream_id', + 'grid_pos', 'notebook', + 'import', +] + class Param(_Param): _init = False _hostage_cells = list() - ##possible param types - TYPES = _Param.TYPES + [ - 'complex', 'real', 'int', - 'complex_vector', 'real_vector', 'int_vector', - 'hex', 'string', 'bool', - 'file_open', 'file_save', - 'id', 'stream_id', - 'grid_pos', 'notebook', - 'import', - ] + def __init__(self, block, n, **kwargs): + _Param.__init__( + self, + block=block, + n=n, + types=TYPES, + ) def __repr__(self): """ diff --git a/grc/python/Port.py b/grc/python/Port.py index d6c622c46..3214d937a 100644 --- a/grc/python/Port.py +++ b/grc/python/Port.py @@ -49,12 +49,12 @@ def _get_source_from_virtual_source_port(vsp, traversed=[]): ) except: raise Exception, 'Could not resolve source for virtual source port %s'%vsp -class Port(_Port): +##possible port types +TYPES = ['complex', 'float', 'int', 'short', 'byte', 'msg', ''] - ##possible port types - TYPES = ['complex', 'float', 'int', 'short', 'byte', 'msg'] +class Port(_Port): - def __init__(self, block, n, dir): + def __init__(self, block, n, dir, **kwargs): """ Make a new port from nested data. @param block the parent element @@ -75,6 +75,7 @@ class Port(_Port): block=block, n=n, dir=dir, + types=TYPES, ) self._nports = n.find('nports') or '' self._vlen = n.find('vlen') or '' diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl index bd12e82e9..dce4037d5 100644 --- a/grc/python/flow_graph.tmpl +++ b/grc/python/flow_graph.tmpl @@ -171,11 +171,11 @@ self.$port.get_parent().get_id()#slurp #set $source = $con.get_source() #set $sink = $con.get_sink() ##resolve virtual sources to the actual sources - #if $source.is_virtual_source() + #if $source.get_parent().is_virtual_source() #set $source = $source.resolve_virtual_source() #end if ##do not generate connections with virtual sinks - #if not $sink.is_virtual_sink() + #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 |