summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjcorgan2009-02-17 16:57:00 +0000
committerjcorgan2009-02-17 16:57:00 +0000
commit1fd57936765fd19c51842ce2bfec41abb9146eaf (patch)
tree874c631d44ff4cc38f2d599c7d1367f2ec2a2005
parent603d50a90cc7a9eb91c8d6178cfef238986a650f (diff)
downloadgnuradio-1fd57936765fd19c51842ce2bfec41abb9146eaf.tar.gz
gnuradio-1fd57936765fd19c51842ce2bfec41abb9146eaf.tar.bz2
gnuradio-1fd57936765fd19c51842ce2bfec41abb9146eaf.zip
Added ability to determine if flowgraph is running
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10451 221aa14e-8319-0410-a670-987f0aec2ac5
-rw-r--r--gnuradio-core/src/lib/runtime/gr_top_block.cc6
-rw-r--r--gnuradio-core/src/lib/runtime/gr_top_block.h5
-rw-r--r--gnuradio-core/src/lib/runtime/gr_top_block.i1
-rw-r--r--gnuradio-core/src/lib/runtime/gr_top_block_impl.cc6
-rw-r--r--gnuradio-core/src/lib/runtime/gr_top_block_impl.h3
5 files changed, 21 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.cc b/gnuradio-core/src/lib/runtime/gr_top_block.cc
index 09e46dfbb..3fa324257 100644
--- a/gnuradio-core/src/lib/runtime/gr_top_block.cc
+++ b/gnuradio-core/src/lib/runtime/gr_top_block.cc
@@ -78,6 +78,12 @@ gr_top_block::run()
wait();
}
+bool
+gr_top_block::is_running()
+{
+ return d_impl->is_running();
+}
+
void
gr_top_block::lock()
{
diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.h b/gnuradio-core/src/lib/runtime/gr_top_block.h
index b47ec019c..415bb21f2 100644
--- a/gnuradio-core/src/lib/runtime/gr_top_block.h
+++ b/gnuradio-core/src/lib/runtime/gr_top_block.h
@@ -78,6 +78,11 @@ public:
void wait();
/*!
+ * Is the flowgraph running?
+ */
+ bool is_running();
+
+ /*!
* Lock a flowgraph in preparation for reconfiguration. When an equal
* number of calls to lock() and unlock() have occurred, the flowgraph
* will be restarted automatically.
diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.i b/gnuradio-core/src/lib/runtime/gr_top_block.i
index 670e5b5e5..b5ced3cda 100644
--- a/gnuradio-core/src/lib/runtime/gr_top_block.i
+++ b/gnuradio-core/src/lib/runtime/gr_top_block.i
@@ -44,6 +44,7 @@ public:
void stop();
void wait();
void run();
+ bool is_running();
void lock();
void unlock() throw (std::runtime_error);
void dump();
diff --git a/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc b/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc
index 50d480d00..97b19adad 100644
--- a/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc
+++ b/gnuradio-core/src/lib/runtime/gr_top_block_impl.cc
@@ -87,6 +87,12 @@ gr_top_block_impl::~gr_top_block_impl()
d_owner = 0;
}
+bool
+gr_top_block_impl::is_running()
+{
+ return (d_state != IDLE);
+}
+
void
gr_top_block_impl::start()
{
diff --git a/gnuradio-core/src/lib/runtime/gr_top_block_impl.h b/gnuradio-core/src/lib/runtime/gr_top_block_impl.h
index 35fb44ef9..794c4bc0d 100644
--- a/gnuradio-core/src/lib/runtime/gr_top_block_impl.h
+++ b/gnuradio-core/src/lib/runtime/gr_top_block_impl.h
@@ -60,6 +60,9 @@ public:
// Dump the flowgraph to stdout
void dump();
+
+ // Has flowgraph been started?
+ bool is_running();
protected: