commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 02/06: blocks: allows null source/sink to o


From: git
Subject: [Commit-gnuradio] [gnuradio] 02/06: blocks: allows null source/sink to output/input multiple streams.
Date: Fri, 28 Feb 2014 16:53:15 +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 92b01e30373e6ed36d1067e2bcba661d2253f34a
Author: Tom Rondeau <address@hidden>
Date:   Wed Feb 26 14:49:15 2014 -0500

    blocks: allows null source/sink to output/input multiple streams.
    
    Updats xml files to allow this and to set bus port connection vector to 
group ports.
---
 gr-blocks/grc/blocks_null_sink.xml   | 17 +++++++++++++++++
 gr-blocks/grc/blocks_null_source.xml | 16 ++++++++++++++++
 gr-blocks/lib/null_sink_impl.cc      |  4 ++--
 gr-blocks/lib/null_source_impl.cc    |  9 ++++++---
 4 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/gr-blocks/grc/blocks_null_sink.xml 
b/gr-blocks/grc/blocks_null_sink.xml
index 2ae20e6..f2907d2 100644
--- a/gr-blocks/grc/blocks_null_sink.xml
+++ b/gr-blocks/grc/blocks_null_sink.xml
@@ -45,10 +45,27 @@
                <value>1</value>
                <type>int</type>
        </param>
+       <param>
+               <name>Num Inputs</name>
+               <key>num_inputs</key>
+               <value>1</value>
+               <type>int</type>
+       </param>
+       <param>
+               <name>Bus Connections</name>
+               <key>bus_conns</key>
+                <value>[[0,],]</value>
+               <type>raw</type>
+                <hide>part</hide>
+       </param>
+       <check>$num_inputs &gt;= 1</check>
        <check>$vlen &gt; 0</check>
        <sink>
                <name>in</name>
                <type>$type</type>
                <vlen>$vlen</vlen>
+               <nports>$num_inputs</nports>
        </sink>
+        <bus_structure_sink>$bus_conns</bus_structure_sink>
 </block>
+
diff --git a/gr-blocks/grc/blocks_null_source.xml 
b/gr-blocks/grc/blocks_null_source.xml
index 01d3905..9c109e6 100644
--- a/gr-blocks/grc/blocks_null_source.xml
+++ b/gr-blocks/grc/blocks_null_source.xml
@@ -45,10 +45,26 @@
                <value>1</value>
                <type>int</type>
        </param>
+       <param>
+               <name>Num Outputs</name>
+               <key>num_outputs</key>
+               <value>1</value>
+               <type>int</type>
+       </param>
+       <param>
+               <name>Bus Connections</name>
+               <key>bus_conns</key>
+                <value>[[0,],]</value>
+               <type>raw</type>
+                <hide>part</hide>
+       </param>
+       <check>$num_outputs &gt;= 1</check>
        <check>$vlen &gt; 0</check>
        <source>
                <name>out</name>
                <type>$type</type>
                <vlen>$vlen</vlen>
+               <nports>$num_outputs</nports>
        </source>
+        <bus_structure_source>$bus_conns</bus_structure_source>
 </block>
diff --git a/gr-blocks/lib/null_sink_impl.cc b/gr-blocks/lib/null_sink_impl.cc
index 41adeea..14dd5ef 100644
--- a/gr-blocks/lib/null_sink_impl.cc
+++ b/gr-blocks/lib/null_sink_impl.cc
@@ -39,8 +39,8 @@ namespace gr {
 
     null_sink_impl::null_sink_impl(size_t sizeof_stream_item)
       : sync_block("null_sink",
-                      io_signature::make(1, 1, sizeof_stream_item),
-                      io_signature::make(0, 0, 0))
+                   io_signature::make(1, -1, sizeof_stream_item),
+                   io_signature::make(0, 0, 0))
     {
     }
 
diff --git a/gr-blocks/lib/null_source_impl.cc 
b/gr-blocks/lib/null_source_impl.cc
index edf0104..9550dd6 100644
--- a/gr-blocks/lib/null_source_impl.cc
+++ b/gr-blocks/lib/null_source_impl.cc
@@ -41,7 +41,7 @@ namespace gr {
     null_source_impl::null_source_impl (size_t sizeof_stream_item)
       : sync_block("null_source",
                       io_signature::make(0, 0, 0),
-                      io_signature::make(1, 1, sizeof_stream_item))
+                      io_signature::make(1, -1, sizeof_stream_item))
     {
     }
 
@@ -54,8 +54,11 @@ namespace gr {
                            gr_vector_const_void_star &input_items,
                            gr_vector_void_star &output_items)
     {
-      void *optr = (void*)output_items[0];
-      memset(optr, 0, noutput_items * 
output_signature()->sizeof_stream_item(0));
+      void *optr;
+      for(size_t n = 0; n < input_items.size(); n++) {
+        optr = (void*)output_items[n];
+        memset(optr, 0, noutput_items * 
output_signature()->sizeof_stream_item(n));
+      }
       return noutput_items;
     }
 



reply via email to

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