commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 02/06: blocks: throttle resets the timer st


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/06: blocks: throttle resets the timer state when the topblock starts each block, including during a lock/unlock restart.
Date: Wed, 1 Oct 2014 15:49:25 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

trondeau pushed a commit to branch master
in repository gnuradio.

commit 4ecfc89678f69692ca9197f047b9ab245136c8f4
Author: Tom Rondeau <address@hidden>
Date:   Tue Sep 30 21:27:14 2014 -0400

    blocks: throttle resets the timer state when the topblock starts each 
block, including during a lock/unlock restart.
    
    Addresses issue #649.
---
 gr-blocks/lib/throttle_impl.cc | 8 ++++++++
 gr-blocks/lib/throttle_impl.h  | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/gr-blocks/lib/throttle_impl.cc b/gr-blocks/lib/throttle_impl.cc
index f46dece..7c24f80 100644
--- a/gr-blocks/lib/throttle_impl.cc
+++ b/gr-blocks/lib/throttle_impl.cc
@@ -57,6 +57,14 @@ namespace gr {
     {
     }
 
+    bool
+    throttle_impl::start()
+    {
+      d_start = boost::get_system_time();
+      d_total_samples = 0;
+      return block::start();
+    }
+
     void
     throttle_impl::set_sample_rate(double rate)
     {
diff --git a/gr-blocks/lib/throttle_impl.h b/gr-blocks/lib/throttle_impl.h
index c5e43d7..6afacbb 100644
--- a/gr-blocks/lib/throttle_impl.h
+++ b/gr-blocks/lib/throttle_impl.h
@@ -41,6 +41,9 @@ namespace gr {
       throttle_impl(size_t itemsize, double samples_per_sec, bool 
ignore_tags=true);
       ~throttle_impl();
 
+      // Overloading gr::block::start to reset timer
+      bool start();
+
       void setup_rpc();
 
       void set_sample_rate(double rate);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]