commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 19/43: gnuradio-runtime: added logger to fl


From: git
Subject: [Commit-gnuradio] [gnuradio] 19/43: gnuradio-runtime: added logger to flat_flowgraph and print out a warning for when the max_output_buffer isn't set to the requested value
Date: Thu, 2 Apr 2015 19:15:51 +0000 (UTC)

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

jcorgan pushed a commit to branch master
in repository gnuradio.

commit a15fe0ebdf444e4ff7c060b72950cd98c7f3ec8a
Author: Bill Clark <address@hidden>
Date:   Wed Apr 1 20:53:17 2015 -0400

    gnuradio-runtime: added logger to flat_flowgraph and print out a warning 
for when the max_output_buffer isn't set to the requested value
---
 gnuradio-runtime/lib/flat_flowgraph.cc | 8 ++++++++
 gnuradio-runtime/lib/flat_flowgraph.h  | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/gnuradio-runtime/lib/flat_flowgraph.cc 
b/gnuradio-runtime/lib/flat_flowgraph.cc
index 9e5964c..b580238 100644
--- a/gnuradio-runtime/lib/flat_flowgraph.cc
+++ b/gnuradio-runtime/lib/flat_flowgraph.cc
@@ -50,6 +50,7 @@ namespace gr {
 
   flat_flowgraph::flat_flowgraph()
   {
+    configure_default_loggers(d_logger, d_debug_logger, "flat_flowgraph");
   }
 
   flat_flowgraph::~flat_flowgraph()
@@ -107,6 +108,13 @@ namespace gr {
       detail->set_output(i, buffer);
 
       // Update the block's max_output_buffer based on what was actually 
allocated.
+      if((grblock->max_output_buffer(i) != buffer->bufsize()) && 
(grblock->max_output_buffer(i) != -1))
+        GR_LOG_WARN(d_logger, boost::format("Block (%1%) max output buffer set 
to %2% instead of requested %3%") \
+                      % grblock->alias() % buffer->bufsize() % 
grblock->max_output_buffer(i));
+        //std::cout << ">>> Warning: Block (" << grblock->alias()
+        //          << ") max output buffer set to " << buffer->bufsize()
+        //          << " instead of requested " << 
grblock->max_output_buffer(i)
+        //          << std::endl;
       grblock->set_max_output_buffer(i, buffer->bufsize());
     }
 
diff --git a/gnuradio-runtime/lib/flat_flowgraph.h 
b/gnuradio-runtime/lib/flat_flowgraph.h
index 6c299ee..fad1427 100644
--- a/gnuradio-runtime/lib/flat_flowgraph.h
+++ b/gnuradio-runtime/lib/flat_flowgraph.h
@@ -26,6 +26,7 @@
 #include <gnuradio/api.h>
 #include <gnuradio/flowgraph.h>
 #include <gnuradio/block.h>
+#include <gnuradio/logger.h>
 
 namespace gr {
 
@@ -89,6 +90,9 @@ namespace gr {
      * start and restarts.
      */
     void setup_buffer_alignment(block_sptr block);
+
+    gr::logger_ptr d_logger;
+    gr::logger_ptr d_debug_logger;
   };
 
 } /* namespace gr */



reply via email to

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