[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r3879 - gnuradio/branches/developers/trondeau/flowgrap
From: |
trondeau |
Subject: |
[Commit-gnuradio] r3879 - gnuradio/branches/developers/trondeau/flowgraph_test/gnuradio-core/src/python/gnuradio/gr |
Date: |
Fri, 27 Oct 2006 14:27:41 -0600 (MDT) |
Author: trondeau
Date: 2006-10-27 14:27:41 -0600 (Fri, 27 Oct 2006)
New Revision: 3879
Modified:
gnuradio/branches/developers/trondeau/flowgraph_test/gnuradio-core/src/python/gnuradio/gr/flow_graph.py
gnuradio/branches/developers/trondeau/flowgraph_test/gnuradio-core/src/python/gnuradio/gr/scheduler.py
Log:
added pause/unpause capabilities to flow graph and scheduler
Modified:
gnuradio/branches/developers/trondeau/flowgraph_test/gnuradio-core/src/python/gnuradio/gr/flow_graph.py
===================================================================
---
gnuradio/branches/developers/trondeau/flowgraph_test/gnuradio-core/src/python/gnuradio/gr/flow_graph.py
2006-10-27 20:26:54 UTC (rev 3878)
+++
gnuradio/branches/developers/trondeau/flowgraph_test/gnuradio-core/src/python/gnuradio/gr/flow_graph.py
2006-10-27 20:27:41 UTC (rev 3879)
@@ -97,7 +97,24 @@
if self.scheduler:
self.scheduler.stop ()
self.scheduler = None
-
+
+ # Pause a specific flow graph or all flow graphs with no argument
+ def pause(self, whichone=None):
+ if self.scheduler:
+ self.scheduler.pause(whichone)
+
+ # Unpause a specific flow graph or all flow graphs with no argument
+ def unpause(self, whichone=None):
+ if self.scheduler:
+ self.scheduler.unpause(whichone)
+
+ # Test if a flow graph is paused; if testing all paused, returns false if
any is not
+ def is_paused(self, whichone=None):
+ if self.scheduler:
+ return self.scheduler.is_paused(whichone)
+ else:
+ return False
+
def wait (self):
'''waits for scheduler to stop'''
if self.scheduler:
Modified:
gnuradio/branches/developers/trondeau/flowgraph_test/gnuradio-core/src/python/gnuradio/gr/scheduler.py
===================================================================
---
gnuradio/branches/developers/trondeau/flowgraph_test/gnuradio-core/src/python/gnuradio/gr/scheduler.py
2006-10-27 20:26:54 UTC (rev 3878)
+++
gnuradio/branches/developers/trondeau/flowgraph_test/gnuradio-core/src/python/gnuradio/gr/scheduler.py
2006-10-27 20:27:41 UTC (rev 3879)
@@ -68,3 +68,26 @@
thread.join(timeout)
if not thread.isAlive():
break
+
+ def pause(self, whichone=None):
+ if whichone is None:
+ for (sts, thread) in self.state:
+ sts.pause()
+ else:
+ self.state[whichone][0].pause()
+
+ def unpause(self, whichone=None):
+ if whichone is None:
+ for (sts, thread) in self.state:
+ sts.unpause()
+ else:
+ self.state[whichone][0].unpause()
+
+ def is_paused(self, whichone=None):
+ if whichone is None:
+ for (sts, thread) in self.state:
+ if not sts.is_paused():
+ return False
+ return True
+ else:
+ return self.state[whichone][0].is_paused()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r3879 - gnuradio/branches/developers/trondeau/flowgraph_test/gnuradio-core/src/python/gnuradio/gr,
trondeau <=