summaryrefslogtreecommitdiff
path: root/grc/python
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2014-05-08 21:54:52 -0400
committerTom Rondeau <tom@trondeau.com>2014-05-17 17:45:14 -0400
commitee5df93249556975143aa35e564312856cf89a1f (patch)
treee4926b36fcd4a8e292544dab593a03147e1781c0 /grc/python
parent9a4494904c77c8516c90f2c2a18518065fe36375 (diff)
grc: fixes bug with controlport monitors where true/false enable parameter is not respected.
Diffstat (limited to 'grc/python')
-rw-r--r--grc/python/Generator.py8
-rw-r--r--grc/python/flow_graph.tmpl6
2 files changed, 9 insertions, 5 deletions
diff --git a/grc/python/Generator.py b/grc/python/Generator.py
index 9bafeb0683..45958ba19b 100644
--- a/grc/python/Generator.py
+++ b/grc/python/Generator.py
@@ -35,7 +35,7 @@ class Generator(object):
"""
Initialize the generator object.
Determine the file to generate.
-
+
Args:
flow_graph: the flow graph object
file_path: the path to write the file to
@@ -74,7 +74,7 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
def get_popen(self):
"""
Execute this python flow graph.
-
+
Returns:
a popen object
"""
@@ -99,7 +99,7 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
def __str__(self):
"""
Convert the flow graph to python code.
-
+
Returns:
a string of python code
"""
@@ -147,7 +147,7 @@ Add a Misc->Throttle block to your flow graph to avoid CPU congestion.''')
'flow_graph': self._flow_graph,
'variables': variables,
'parameters': parameters,
- 'monitors': monitors,
+ 'monitors': monitors,
'blocks': blocks,
'connections': connections,
'messages': messages,
diff --git a/grc/python/flow_graph.tmpl b/grc/python/flow_graph.tmpl
index 4cd7cc082f..30a991eeda 100644
--- a/grc/python/flow_graph.tmpl
+++ b/grc/python/flow_graph.tmpl
@@ -334,7 +334,11 @@ if __name__ == '__main__':
tb.wait()
qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
#for $m in $monitors
- (tb.$m.get_id()).start()
+ if $m.has_param('en'):
+ if $m.get_param('en').get_value():
+ (tb.$m.get_id()).start()
+ else:
+ sys.stderr.write("Monitor '{0}' does not have an enable ('en') parameter.".format("tb.$m.get_id()"))
#end for
qapp.exec_()
tb = None #to clean up Qt widgets