diff options
author | Josh Blum | 2009-08-26 11:23:23 -0700 |
---|---|---|
committer | Josh Blum | 2009-08-26 11:23:23 -0700 |
commit | 854bed10dfb61e9f9feab5259a75e809941089ab (patch) | |
tree | 76397b4eb8c85b11cb831b6c2e3dd877f48276d4 /grc/python | |
parent | 62abad680b43218bbacf03c19d35c068973de4b9 (diff) | |
download | gnuradio-854bed10dfb61e9f9feab5259a75e809941089ab.tar.gz gnuradio-854bed10dfb61e9f9feab5259a75e809941089ab.tar.bz2 gnuradio-854bed10dfb61e9f9feab5259a75e809941089ab.zip |
Added virtual sink and logic to clone port.
Tweaks to the base validation routines.
Validate twice in the update until rewrite functions are implemented.
Diffstat (limited to 'grc/python')
-rw-r--r-- | grc/python/Port.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/grc/python/Port.py b/grc/python/Port.py index f71c5fa35..bfbac7237 100644 --- a/grc/python/Port.py +++ b/grc/python/Port.py @@ -57,11 +57,25 @@ class Port(_Port): except AssertionError: self.add_error_message('Port is not connected.') try: assert self.is_source() or len(self.get_enabled_connections()) <= 1 except AssertionError: self.add_error_message('Port has too many connections.') + ################################################################ + # message port logic + ################################################################ if self.get_type() == 'msg': try: assert not self.get_nports() except AssertionError: self.add_error_message('A port of type "msg" cannot have "nports" set.') try: assert self.get_vlen() == 1 except AssertionError: self.add_error_message('A port of type "msg" must have a "vlen" of 1.') + ################################################################ + # virtual sink logic + ################################################################ + if self.get_parent().get_key() == 'virtual_sink': + if self.get_enabled_connections(): #clone type and vlen + source = self.get_enabled_connections()[0].get_source() + self._type = str(source.get_type()) + self._vlen = str(source.get_vlen()) + else: #reset type and vlen + self._type = '' + self._vlen = '' def get_vlen(self): """ |