[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 04/43: gnuradio-runtime: added the individu
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 04/43: gnuradio-runtime: added the individual port assignments to the hier_block2 max/min_output_buffer size; if output ports have different size assignments only the block directly connected to the output port is changed otherwise every block within the hier is set to that output buffer size; therefore single output hier blocks will always set every block within to the output buffer size |
Date: |
Thu, 2 Apr 2015 19:15:49 +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 34275a2c3e18c5738ccf02f4c3119efdacd00ae8
Author: Bill Clark <address@hidden>
Date: Tue Mar 31 21:28:30 2015 -0400
gnuradio-runtime: added the individual port assignments to the hier_block2
max/min_output_buffer size; if output ports have different size assignments
only the block directly connected to the output port is changed otherwise every
block within the hier is set to that output buffer size; therefore single
output hier blocks will always set every block within to the output buffer size
---
gnuradio-runtime/include/gnuradio/hier_block2.h | 10 +++++++
gnuradio-runtime/lib/hier_block2.cc | 18 +++++++++++++
gnuradio-runtime/lib/hier_block2_detail.cc | 35 +++++++++++++++++++++++++
gnuradio-runtime/swig/hier_block2.i | 2 ++
4 files changed, 65 insertions(+)
diff --git a/gnuradio-runtime/include/gnuradio/hier_block2.h
b/gnuradio-runtime/include/gnuradio/hier_block2.h
index e547d2f..9a3f113 100644
--- a/gnuradio-runtime/include/gnuradio/hier_block2.h
+++ b/gnuradio-runtime/include/gnuradio/hier_block2.h
@@ -185,6 +185,11 @@ namespace gr {
void set_max_output_buffer(long max_output_buffer);
/*!
+ * \brief Sets max buffer size on output port \p port.
+ */
+ void set_max_output_buffer(int port, long max_output_buffer);
+
+ /*!
* \brief Returns min buffer size on output port \p i.
*/
long min_output_buffer(size_t i=0);
@@ -194,6 +199,11 @@ namespace gr {
*/
void set_min_output_buffer(long min_output_buffer);
+ /*!
+ * \brief Sets min buffer size on output port \p port.
+ */
+ void set_min_output_buffer(int port, long min_output_buffer);
+
// This is a public method for ease of code organization, but should be
// ignored by the user.
diff --git a/gnuradio-runtime/lib/hier_block2.cc
b/gnuradio-runtime/lib/hier_block2.cc
index 5793e1c..130b2a1 100644
--- a/gnuradio-runtime/lib/hier_block2.cc
+++ b/gnuradio-runtime/lib/hier_block2.cc
@@ -203,6 +203,15 @@ namespace gr {
d_max_output_buffer[idx] = max_output_buffer;
}
}
+
+ void
+ hier_block2::set_max_output_buffer(int port, long max_output_buffer)
+ {
+ if((size_t)port >= d_max_output_buffer.size())
+ throw std::invalid_argument("hier_block2::max_output_buffer: port out of
range.");
+ else
+ d_max_output_buffer[port] = max_output_buffer;
+ }
long
hier_block2::min_output_buffer(size_t i=0)
@@ -223,6 +232,15 @@ namespace gr {
d_min_output_buffer[idx] = min_output_buffer;
}
}
+
+ void
+ hier_block2::set_min_output_buffer(int port, long min_output_buffer)
+ {
+ if((size_t)port >= d_min_output_buffer.size())
+ throw std::invalid_argument("hier_block2::min_output_buffer: port out of
range.");
+ else
+ d_min_output_buffer[port] = min_output_buffer;
+ }
bool
hier_block2::set_all_min_output_buffer(void)
diff --git a/gnuradio-runtime/lib/hier_block2_detail.cc
b/gnuradio-runtime/lib/hier_block2_detail.cc
index 7210dca..249fccf 100644
--- a/gnuradio-runtime/lib/hier_block2_detail.cc
+++ b/gnuradio-runtime/lib/hier_block2_detail.cc
@@ -685,6 +685,41 @@ namespace gr {
<< " is not connected internally";
throw std::runtime_error(msg.str());
}
+ // TODO: Update buffers of just these output blocks
+ if(!set_all_min_buff){
+ min_buff = d_owner->min_output_buffer(i);
+ if(min_buff != -1){
+ block_sptr bb = boost::dynamic_pointer_cast<block>(blk);
+ if(bb != 0){
+ int bb_src_port = d_outputs[i].port();
+ bb->set_min_output_buffer(bb_src_port, min_buff);
+ }
+ else{
+ hier_block2_sptr hh =
boost::dynamic_pointer_cast<hier_block2>(blk);
+ if(hh != 0){
+ int hh_src_port = d_outputs[i].port();
+ hh->set_min_output_buffer(hh_src_port, min_buff);
+ }
+ }
+ }
+ }
+ if(!set_all_max_buff){
+ max_buff = d_owner->max_output_buffer(i);
+ if(max_buff != -1){
+ block_sptr bb = boost::dynamic_pointer_cast<block>(blk);
+ if(bb != 0){
+ int bb_src_port = d_outputs[i].port();
+ bb->set_max_output_buffer(bb_src_port, max_buff);
+ }
+ else{
+ hier_block2_sptr hh =
boost::dynamic_pointer_cast<hier_block2>(blk);
+ if(hh != 0){
+ int hh_src_port = d_outputs[i].port();
+ hh->set_max_output_buffer(hh_src_port, max_buff);
+ }
+ }
+ }
+ }
tmp.push_back(blk);
}
sort(tmp.begin(), tmp.end());
diff --git a/gnuradio-runtime/swig/hier_block2.i
b/gnuradio-runtime/swig/hier_block2.i
index fbe44dc..d2a33b4 100644
--- a/gnuradio-runtime/swig/hier_block2.i
+++ b/gnuradio-runtime/swig/hier_block2.i
@@ -94,8 +94,10 @@ namespace gr {
// Methods to manage block's min/max buffer sizes.
long max_output_buffer(int i);
void set_max_output_buffer(long max_output_buffer);
+ void set_max_output_buffer(int port, long max_output_buffer);
long min_output_buffer(int i);
void set_min_output_buffer(long min_output_buffer);
+ void set_min_output_buffer(int port, long min_output_buffer);
gr::hier_block2_sptr to_hier_block2(); // Needed for Python type coercion
};
- [Commit-gnuradio] [gnuradio] branch master updated (7fe6115 -> 3061e47), git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 16/43: fec: LDPC async decoder now running, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 04/43: gnuradio-runtime: added the individual port assignments to the hier_block2 max/min_output_buffer size; if output ports have different size assignments only the block directly connected to the output port is changed otherwise every block within the hier is set to that output buffer size; therefore single output hier blocks will always set every block within to the output buffer size,
git <=
- [Commit-gnuradio] [gnuradio] 17/43: gnuradio-runtume: hier_block2 output buffer lengths - clean up of debug output, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 26/43: grc: no shebang for hier blocks; use python2, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 15/43: fec: ldpc encoder now working in async encoder interface, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 06/43: gnuradio-runtime: (option 1) The hier block can now take a generic min/max output buffer length and assign it to every block within the hier (assumes all output buffers have the same min/max values set); (option 2) sets only the blocks connected to hier output ports and does not set the other internal blocks (requires that each port has different values); for single port output hier blocks only option 1 is possible., git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 07/43: gnuradio-runtime: non-helpful debug outputs removed from hier_block2 and hier_block2_detail, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 27/43: grc: optional thread-safe setters in generated code (#748), git, 2015/04/02
- [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, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 28/43: grc: don't try to open missing files, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 01/43: gnuradio-runtime: trying to see if this will handle the output buffer size of hier blocks; trying to find the proper casting methods, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 10/43: fec: cleaning up LDPC warnings, git, 2015/04/02