[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/22: Add vector support to abs block. Rem
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/22: Add vector support to abs block. Remove unused num_inputs from xml. |
Date: |
Wed, 24 Sep 2014 22:07:37 +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 74404b60a2f96442318b8954c88d56a8d95555ce
Author: jwl <address@hidden>
Date: Sun Sep 7 20:03:56 2014 -0400
Add vector support to abs block. Remove unused num_inputs from xml.
---
gr-blocks/grc/blocks_abs_xx.xml | 19 +++++++++----------
gr-blocks/include/gnuradio/blocks/abs_XX.h.t | 2 +-
gr-blocks/lib/abs_XX_impl.cc.t | 13 +++++++------
gr-blocks/lib/abs_XX_impl.h.t | 5 ++++-
4 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/gr-blocks/grc/blocks_abs_xx.xml b/gr-blocks/grc/blocks_abs_xx.xml
index 65ef97d..7729871 100644
--- a/gr-blocks/grc/blocks_abs_xx.xml
+++ b/gr-blocks/grc/blocks_abs_xx.xml
@@ -8,7 +8,13 @@
<name>Abs</name>
<key>blocks_abs_xx</key>
<import>from gnuradio import blocks</import>
- <make>blocks.abs_$(type.fcn)()</make>
+ <make>blocks.abs_$(type.fcn)($vlen)</make>
+ <param>
+ <name>Vec Length</name>
+ <key>vlen</key>
+ <value>1</value>
+ <type>int</type>
+ </param>
<param>
<name>IO Type</name>
<key>type</key>
@@ -29,21 +35,14 @@
<opt>fcn:ff</opt>
</option>
</param>
- <param>
- <name>Num Inputs</name>
- <key>num_inputs</key>
- <value>1</value>
- <type>int</type>
- </param>
- <check>$num_inputs >= 1</check>
<sink>
<name>in</name>
<type>$type</type>
- <nports>$num_inputs</nports>
+ <vlen>$vlen</vlen>
</sink>
<source>
<name>out</name>
<type>$type</type>
- <nports>$num_inputs</nports>
+ <vlen>$vlen</vlen>
</source>
</block>
diff --git a/gr-blocks/include/gnuradio/blocks/abs_XX.h.t
b/gr-blocks/include/gnuradio/blocks/abs_XX.h.t
index f8688ed..5417162 100644
--- a/gr-blocks/include/gnuradio/blocks/abs_XX.h.t
+++ b/gr-blocks/include/gnuradio/blocks/abs_XX.h.t
@@ -49,7 +49,7 @@ namespace gr {
/*!
* \brief Create an instance of @NAME@
*/
- static sptr make();
+ static sptr make(size_t vlen=1);
};
} /* namespace blocks */
diff --git a/gr-blocks/lib/abs_XX_impl.cc.t b/gr-blocks/lib/abs_XX_impl.cc.t
index 6bb9f14..195d8df 100644
--- a/gr-blocks/lib/abs_XX_impl.cc.t
+++ b/gr-blocks/lib/abs_XX_impl.cc.t
@@ -32,15 +32,16 @@
namespace gr {
namespace blocks {
- @NAME@::sptr @NAME@::make()
+ @NAME@::sptr @NAME@::make(size_t vlen)
{
- return gnuradio::get_initial_sptr(new @NAME_IMPL@());
+ return gnuradio::get_initial_sptr(new @NAME_IMPL@(vlen));
}
- @NAME_IMPL@::@NAME_IMPL@()
+ @NAME_IMPL@::@NAME_IMPL@(size_t vlen)
: sync_block ("@NAME@",
- io_signature::make (1, 1, sizeof (@I_TYPE@)),
- io_signature::make (1, 1, sizeof (@O_TYPE@)))
+ io_signature::make (1, 1, sizeof (@I_TYPE@)*vlen),
+ io_signature::make (1, 1, sizeof (@O_TYPE@)*vlen)),
+ d_vlen(vlen)
{
}
@@ -52,7 +53,7 @@ namespace gr {
@I_TYPE@ *iptr = (@I_TYPE@ *) input_items[0];
@O_TYPE@ *optr = (@O_TYPE@ *) output_items[0];
- for(int i=0; i<noutput_items; i++) {
+ for(size_t i=0; i<noutput_items*d_vlen; i++) {
@I_TYPE@ val = iptr[i];
optr[i] = ((val < ((@I_TYPE@)0)) ? -val : val);
}
diff --git a/gr-blocks/lib/abs_XX_impl.h.t b/gr-blocks/lib/abs_XX_impl.h.t
index b31ef5f..fa96c84 100644
--- a/gr-blocks/lib/abs_XX_impl.h.t
+++ b/gr-blocks/lib/abs_XX_impl.h.t
@@ -32,8 +32,11 @@ namespace gr {
class BLOCKS_API @NAME_IMPL@ : public @NAME@
{
+ private:
+ size_t d_vlen;
+
public:
- @NAME_IMPL@();
+ @NAME_IMPL@(size_t vlen);
int work(int noutput_items,
gr_vector_const_void_star &input_items,
- [Commit-gnuradio] [gnuradio] branch master updated (6e12074 -> fd0955f), git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 04/22: volk: add feature for json results export, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 03/22: Fix CMake abuse for assembly (.s) files, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 02/22: blocks: make tagged stream to pdu output optional, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 08/22: Fix prune_tags, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 01/22: Add vector support to abs block. Remove unused num_inputs from xml.,
git <=
- [Commit-gnuradio] [gnuradio] 05/22: blocks: Added callback to vector source GRC bindings, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 07/22: Fix(?) prune_tags: needs verification, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 15/22: digital: clock recovery fix relative limit, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 21/22: Merge branch 'master' of git.gnuradio.org:gnuradio, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 13/22: fec: turning off some debug output., git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 10/22: Formatting fix-ups, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 19/22: digital: applying same fix of the complex M&M clock recovery block as the float version., git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 14/22: blocks: deinterleaver will process more than one block at a time for significant speed improvements., git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 06/22: tags_wip, git, 2014/09/24
- [Commit-gnuradio] [gnuradio] 22/22: Merge branch 'maint', git, 2014/09/24