summaryrefslogtreecommitdiff
path: root/grc/python/FlowGraph.py
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-03-01 13:19:00 -0500
committerTom Rondeau <trondeau@vt.edu>2013-03-01 13:19:00 -0500
commitce211603ff8821b50f7c9ebc3931498c6f2bd374 (patch)
treedd8b92841ef4cd0728aa1156b105e7173286627b /grc/python/FlowGraph.py
parent6121d0b12bcb308586b5888b6c7e82832f692e5c (diff)
parent4c164f4cbb7fc9284bec147809b078d0a8ed9f88 (diff)
Merge branch 'master' into gr_log
Conflicts: cmake/Modules/GrMiscUtils.cmake docs/doxygen/other/main_page.dox gnuradio-core/gnuradio-core.conf.in gnuradio-core/src/lib/swig/CMakeLists.txt gr-digital/lib/CMakeLists.txt gr-howto-write-a-block/CMakeLists.txt gr-qtgui/lib/CMakeLists.txt gr-video-sdl/src/CMakeLists.txt
Diffstat (limited to 'grc/python/FlowGraph.py')
-rw-r--r--grc/python/FlowGraph.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/grc/python/FlowGraph.py b/grc/python/FlowGraph.py
index 89a169355b..376c2e337f 100644
--- a/grc/python/FlowGraph.py
+++ b/grc/python/FlowGraph.py
@@ -58,12 +58,15 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
'in': self.get_pad_sources(),
'out': self.get_pad_sinks(),
}[direction]
+ # we only want stream ports
+ sorted_pads = filter(lambda b: b.get_param('type').get_evaluated() != 'message', sorted_pads);
#load io signature
return [{
'label': str(pad.get_param('label').get_evaluated()),
'type': str(pad.get_param('type').get_evaluated()),
'vlen': str(pad.get_param('vlen').get_evaluated()),
'size': pad.get_param('type').get_opt('size'),
+ 'optional': bool(pad.get_param('optional').get_evaluated()),
} for pad in sorted_pads]
def get_pad_sources(self):
@@ -82,6 +85,14 @@ class FlowGraph(_FlowGraph, _GUIFlowGraph):
pads = filter(lambda b: b.get_key() == 'pad_sink', self.get_enabled_blocks())
return sorted(pads, lambda x, y: cmp(x.get_id(), y.get_id()))
+ def get_msg_pad_sources(self):
+ ps = self.get_pad_sources();
+ return filter(lambda b: b.get_param('type').get_evaluated() == 'message', ps);
+
+ def get_msg_pad_sinks(self):
+ ps = self.get_pad_sinks();
+ return filter(lambda b: b.get_param('type').get_evaluated() == 'message', ps);
+
def get_imports(self):
"""
Get a set of all import statments in this flow graph namespace.