summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim O'Shea <tim.oshea753@gmail.com>2013-11-07 01:09:15 -0500
committerTim O'Shea <tim.oshea753@gmail.com>2013-11-07 01:10:46 -0500
commit173b9fc9785cc2f8d11bbd965ca56e05e4e4e3e0 (patch)
tree0dcde0301e8a9a37326d45fd2784cac08890a1e4
parentd9168b34dbc1aeeda7077ede8c9534fabb1e7518 (diff)
grc: adding ability to manipulate set_max_output_buffer based on block properties (please use caution when using this, realize there are a number of other constraints that will ultimately lead to the chosen buffer size)
-rw-r--r--grc/base/Block.py10
-rw-r--r--grc/python/flow_graph.tmpl3
2 files changed, 13 insertions, 0 deletions
diff --git a/grc/base/Block.py b/grc/base/Block.py
index 970cf516fe..668675c685 100644
--- a/grc/base/Block.py
+++ b/grc/base/Block.py
@@ -154,6 +154,16 @@ class Block(Element):
'value': '0'
})
))
+ self.get_params().append(self.get_parent().get_parent().Param(
+ block=self,
+ n=odict({'name': 'Max Output Buffer',
+ 'key': 'maxoutbuf',
+ 'type': 'int',
+ 'hide': 'part',
+ 'value': '0'
+ })
+ ))
+
def back_ofthe_bus(self, portlist):
portlist.sort(key=lambda a: a.get_type() == 'bus');
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index 5daf80f685..cf13317d1d 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -167,6 +167,9 @@ gr.io_signaturev($(len($io_sigs)), $(len($io_sigs)), [$(', '.join($size_strs))])
#if (len($blk.get_sources())>0) and $blk.has_param('minoutbuf') and (int($blk.get_param('minoutbuf').get_evaluated()) > 0)
(self.$blk.get_id()).set_min_output_buffer($blk.get_param('minoutbuf').get_evaluated())
#end if
+ #if (len($blk.get_sources())>0) and $blk.has_param('maxoutbuf') and (int($blk.get_param('maxoutbuf').get_evaluated()) > 0)
+ (self.$blk.get_id()).set_max_output_buffer($blk.get_param('maxoutbuf').get_evaluated())
+ #end if
#end if
#end for
########################################################