[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 07/14: blocks: add vector output option par
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 07/14: blocks: add vector output option param to complex_to_interleaved_short to match interleaved_short_to_complex |
Date: |
Fri, 9 May 2014 22:28:43 +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 eb4602a727bcb9874ebd7666438fb3eebb244e8b
Author: Tim O'Shea <address@hidden>
Date: Thu May 8 09:32:53 2014 -0400
blocks: add vector output option param to complex_to_interleaved_short to
match interleaved_short_to_complex
---
gr-blocks/grc/blocks_complex_to_interleaved_short.xml | 19 ++++++++++++++++++-
.../gnuradio/blocks/complex_to_interleaved_short.h | 2 +-
gr-blocks/lib/complex_to_interleaved_short_impl.cc | 18 ++++++++++--------
gr-blocks/lib/complex_to_interleaved_short_impl.h | 4 +++-
4 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/gr-blocks/grc/blocks_complex_to_interleaved_short.xml
b/gr-blocks/grc/blocks_complex_to_interleaved_short.xml
index 43b55f3..7f69d6b 100644
--- a/gr-blocks/grc/blocks_complex_to_interleaved_short.xml
+++ b/gr-blocks/grc/blocks_complex_to_interleaved_short.xml
@@ -8,7 +8,23 @@
<name>Complex To IShort</name>
<key>blocks_complex_to_interleaved_short</key>
<import>from gnuradio import blocks</import>
- <make>blocks.complex_to_interleaved_short()</make>
+ <make>blocks.complex_to_interleaved_short($vector_output)</make>
+ <param>
+ <name>Vector Output</name>
+ <key>vector_output</key>
+ <value>False</value>
+ <type>enum</type>
+ <option>
+ <name>No</name>
+ <key>False</key>
+ <opt>vlen:1</opt>
+ </option>
+ <option>
+ <name>Yes</name>
+ <key>True</key>
+ <opt>vlen:2</opt>
+ </option>
+ </param>
<sink>
<name>in</name>
<type>complex</type>
@@ -16,5 +32,6 @@
<source>
<name>out</name>
<type>short</type>
+ <vlen>$vector_output.vlen</vlen>
</source>
</block>
diff --git a/gr-blocks/include/gnuradio/blocks/complex_to_interleaved_short.h
b/gr-blocks/include/gnuradio/blocks/complex_to_interleaved_short.h
index 69b88e5..d68482c 100644
--- a/gr-blocks/include/gnuradio/blocks/complex_to_interleaved_short.h
+++ b/gr-blocks/include/gnuradio/blocks/complex_to_interleaved_short.h
@@ -51,7 +51,7 @@ namespace gr {
/*!
* Build a complex to interleaved shorts block.
*/
- static sptr make();
+ static sptr make(bool vector=false);
};
} /* namespace blocks */
diff --git a/gr-blocks/lib/complex_to_interleaved_short_impl.cc
b/gr-blocks/lib/complex_to_interleaved_short_impl.cc
index 8714636..7b8ac90 100644
--- a/gr-blocks/lib/complex_to_interleaved_short_impl.cc
+++ b/gr-blocks/lib/complex_to_interleaved_short_impl.cc
@@ -30,16 +30,17 @@
namespace gr {
namespace blocks {
- complex_to_interleaved_short::sptr complex_to_interleaved_short::make()
+ complex_to_interleaved_short::sptr complex_to_interleaved_short::make(bool
vector)
{
- return gnuradio::get_initial_sptr(new
complex_to_interleaved_short_impl());
+ return gnuradio::get_initial_sptr(new
complex_to_interleaved_short_impl(vector));
}
- complex_to_interleaved_short_impl::complex_to_interleaved_short_impl()
+ complex_to_interleaved_short_impl::complex_to_interleaved_short_impl(bool
vector)
: sync_interpolator("complex_to_interleaved_short",
io_signature::make (1, 1, sizeof(gr_complex)),
- io_signature::make (1, 1, sizeof(short)),
- 2)
+ io_signature::make (1, 1,
vector?2*sizeof(short):sizeof(short)),
+ vector?1:2),
+ d_vector(vector)
{
}
@@ -51,9 +52,10 @@ namespace gr {
const gr_complex *in = (const gr_complex *) input_items[0];
short *out = (short *) output_items[0];
- for (int i = 0; i < noutput_items/2; i++){
- *out++ = (short) lrintf(in[i].real()); // FIXME saturate?
- *out++ = (short) lrintf(in[i].imag());
+ int npairs = (d_vector?noutput_items:noutput_items/2);
+ for (int i = 0; i < npairs; i++){
+ *out++ = (short) lrintf(in[i].real()); // FIXME saturate?
+ *out++ = (short) lrintf(in[i].imag());
}
return noutput_items;
diff --git a/gr-blocks/lib/complex_to_interleaved_short_impl.h
b/gr-blocks/lib/complex_to_interleaved_short_impl.h
index 7bcea95..d166c56 100644
--- a/gr-blocks/lib/complex_to_interleaved_short_impl.h
+++ b/gr-blocks/lib/complex_to_interleaved_short_impl.h
@@ -30,8 +30,10 @@ namespace gr {
class BLOCKS_API complex_to_interleaved_short_impl : public
complex_to_interleaved_short
{
+ private:
+ bool d_vector;
public:
- complex_to_interleaved_short_impl();
+ complex_to_interleaved_short_impl(bool vector);
int work(int noutput_items,
gr_vector_const_void_star &input_items,
- [Commit-gnuradio] [gnuradio] 06/14: gr-filter: Add a convenience freq_xlating_fft_filter block, (continued)
- [Commit-gnuradio] [gnuradio] 06/14: gr-filter: Add a convenience freq_xlating_fft_filter block, git, 2014/05/09
- [Commit-gnuradio] [gnuradio] 11/14: Merge remote-tracking branch 'smunaut/fft-filter', git, 2014/05/09
- [Commit-gnuradio] [gnuradio] 08/14: Merge remote-tracking branch 'osh/typo_fix', git, 2014/05/09
- [Commit-gnuradio] [gnuradio] 13/14: Merge branch 'maint', git, 2014/05/09
- [Commit-gnuradio] [gnuradio] 14/14: Merge remote-tracking branch 'tom/cmake_ice_libs', git, 2014/05/09
- [Commit-gnuradio] [gnuradio] 05/14: cmake: fixing up FindICE to handle more possible install cases., git, 2014/05/09
- [Commit-gnuradio] [gnuradio] 01/14: cmake: better setup for finding QWT; otherwise, it can be forced to incorrectly "find" non-existent QWT libs., git, 2014/05/09
- [Commit-gnuradio] [gnuradio] 09/14: gr-digital: update the HDLC blocks., git, 2014/05/09
- [Commit-gnuradio] [gnuradio] 10/14: Merge branch 'hdlc_update', git, 2014/05/09
- [Commit-gnuradio] [gnuradio] 12/14: Merge remote-tracking branch 'osh/cpx_to_ishort_vector', git, 2014/05/09
- [Commit-gnuradio] [gnuradio] 07/14: blocks: add vector output option param to complex_to_interleaved_short to match interleaved_short_to_complex,
git <=
- [Commit-gnuradio] [gnuradio] 02/14: pmt: adding pmt::dict_update(dict1, dict2) function for merging dictionaries, git, 2014/05/09
- [Commit-gnuradio] [gnuradio] 03/14: runtime: ieieieieieieieieieieieieieieieieieieieieieeieiieieieiieieieieieieieieieiieiieieiie, git, 2014/05/09