summaryrefslogtreecommitdiff
path: root/grc
diff options
context:
space:
mode:
Diffstat (limited to 'grc')
-rw-r--r--grc/blocks/options.xml17
-rw-r--r--grc/python/flow_graph.tmpl16
2 files changed, 33 insertions, 0 deletions
diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml
index b27ea900c..1cf0b7707 100644
--- a/grc/blocks/options.xml
+++ b/grc/blocks/options.xml
@@ -125,6 +125,19 @@ else: self.stop(); self.wait()</callback>
</option>
</param>
<param>
+ <name>Max Number of Output</name>
+ <key>max_nouts</key>
+ <value>0</value>
+ <type>int</type>
+ <hide>#if $generate_options() == 'hb'
+all#slurp
+#elif $max_nouts()
+none#slurp
+#else
+part#slurp
+#end if</hide>
+ </param>
+ <param>
<name>Realtime Scheduling</name>
<key>realtime_scheduling</key>
<value></value>
@@ -169,5 +182,9 @@ For example, an id of my_block will generate the file my_block.py and class my_b
The category parameter determines the placement of the block in the block selection window. \
The category only applies when creating hier blocks. \
To put hier blocks into the root category, enter / for the category.
+
+The Max Number of Output is the maximum number of output items allowed for any block \
+in the flowgraph; to disable this set the max_nouts equal to 0.\
+Use this to adjust the maximum latency a flowgraph can exhibit.
</doc>
</block>
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index 0878be4ba..17feb01f6 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -244,12 +244,20 @@ if __name__ == '__main__':
#end if
#if $generate_options == 'wx_gui'
tb = $(class_name)($(', '.join($params_eq_list)))
+ #if $flow_graph.get_option('max_nouts')
+ tb.Run($flow_graph.get_option('run'), $flow_graph.get_option('max_nouts'))
+ #else
tb.Run($flow_graph.get_option('run'))
+ #end if
#elif $generate_options == 'qt_gui'
qapp = Qt.QApplication(sys.argv)
tb = $(class_name)($(', '.join($params_eq_list)))
#if $flow_graph.get_option('run')
+ #if $flow_graph.get_option('max_nouts')
+ tb.start($flow_graph.get_option('max_nouts'))
+ #else
tb.start()
+ #end if
#end if
tb.show()
qapp.exec_()
@@ -258,11 +266,19 @@ if __name__ == '__main__':
tb = $(class_name)($(', '.join($params_eq_list)))
#set $run_options = $flow_graph.get_option('run_options')
#if $run_options == 'prompt'
+ #if $flow_graph.get_option('max_nouts')
+ tb.start($flow_graph.get_option('max_nouts'))
+ #else
tb.start()
+ #end if
raw_input('Press Enter to quit: ')
tb.stop()
#elif $run_options == 'run'
+ #if $flow_graph.get_option('max_nouts')
+ tb.run($flow_graph.get_option('max_nouts'))
+ #else
tb.run()
+ #end if
#end if
#end if
#end if