summaryrefslogtreecommitdiff
path: root/grc/python/Port.py
diff options
context:
space:
mode:
authorNicholas McCarthy <namccart@gmail.com>2013-07-07 18:08:20 -0400
committerJohnathan Corgan <johnathan@corganlabs.com>2013-07-08 07:19:33 -0700
commitcd99526b5d1c8b1130ac1ba87e21f96c621b1bdc (patch)
tree12836648bf75868b17b04a2c3ead9c1b6fa2d4c5 /grc/python/Port.py
parent2dc1b6f2ed0cabd2bccbcc58487e93be4295df84 (diff)
grc: add bus ports
Bus ports allow ganging together of block input or output ports into a single display item for connection to other bus ports.
Diffstat (limited to 'grc/python/Port.py')
-rw-r--r--grc/python/Port.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/grc/python/Port.py b/grc/python/Port.py
index d4afa6cf77..8ebf5c7b05 100644
--- a/grc/python/Port.py
+++ b/grc/python/Port.py
@@ -110,7 +110,8 @@ class Port(_Port, _GUIPort):
self._nports = n.find('nports') or ''
self._vlen = n.find('vlen') or ''
self._optional = bool(n.find('optional'))
-
+
+
def get_types(self): return Constants.TYPE_TO_SIZEOF.keys()
def is_type_empty(self): return not self._n['type']
@@ -174,6 +175,9 @@ class Port(_Port, _GUIPort):
try: return int(self.get_parent().get_parent().evaluate(vlen))
except: return 1
+
+
+
def get_nports(self):
"""
Get the number of ports.
@@ -191,6 +195,8 @@ class Port(_Port, _GUIPort):
if 0 < nports: return nports
except: return 1
+
+
def get_optional(self): return bool(self._optional)
def get_color(self):