[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 05/43: digital: bug fixed in chunks_to_symb
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 05/43: digital: bug fixed in chunks_to_symbols that the callback functiion set_symbol_table didn't work with additonal qa_tests |
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 cc13ec5be58e1d18211649ddab98ca21d8c2ba3d
Author: fengzhe29888 <address@hidden>
Date: Wed Apr 1 03:34:19 2015 -0400
digital: bug fixed in chunks_to_symbols that the callback functiion
set_symbol_table didn't work with additonal qa_tests
---
gr-digital/grc/digital_chunks_to_symbols.xml | 1 +
.../gnuradio/digital/chunks_to_symbols_XX.h.t | 1 +
gr-digital/lib/chunks_to_symbols_XX_impl.cc.t | 2 +-
gr-digital/lib/chunks_to_symbols_XX_impl.h.t | 2 +-
gr-digital/python/digital/qa_chunks_to_symbols.py | 33 ++++++++++++++++++++++
5 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/gr-digital/grc/digital_chunks_to_symbols.xml
b/gr-digital/grc/digital_chunks_to_symbols.xml
index 494be27..9c6f952 100644
--- a/gr-digital/grc/digital_chunks_to_symbols.xml
+++ b/gr-digital/grc/digital_chunks_to_symbols.xml
@@ -9,6 +9,7 @@
<key>digital_chunks_to_symbols_xx</key>
<import>from gnuradio import digital</import>
<make>digital.chunks_to_symbols_$(in_type.fcn)$(out_type.fcn)($symbol_table,
$dimension)</make>
+ <callback>set_symbol_table($symbol_table)</callback>
<param>
<name>Input Type</name>
<key>in_type</key>
diff --git a/gr-digital/include/gnuradio/digital/chunks_to_symbols_XX.h.t
b/gr-digital/include/gnuradio/digital/chunks_to_symbols_XX.h.t
index c6f2060..6683ea9 100644
--- a/gr-digital/include/gnuradio/digital/chunks_to_symbols_XX.h.t
+++ b/gr-digital/include/gnuradio/digital/chunks_to_symbols_XX.h.t
@@ -68,6 +68,7 @@ namespace gr {
virtual int D() const = 0;
virtual std::vector<@O_TYPE@> symbol_table() const = 0;
+ virtual void set_symbol_table(const std::vector<@O_TYPE@> &symbol_table)
=0;
};
} /* namespace digital */
diff --git a/gr-digital/lib/chunks_to_symbols_XX_impl.cc.t
b/gr-digital/lib/chunks_to_symbols_XX_impl.cc.t
index fd334b9..b08bdde 100644
--- a/gr-digital/lib/chunks_to_symbols_XX_impl.cc.t
+++ b/gr-digital/lib/chunks_to_symbols_XX_impl.cc.t
@@ -87,7 +87,7 @@ namespace gr {
void
- @IMPL_NAME@::set_symbol_table(std::vector<@O_TYPE@> &symbol_table)
+ @IMPL_NAME@::set_symbol_table(const std::vector<@O_TYPE@> &symbol_table)
{
d_symbol_table.resize(0);
for (unsigned int i=0; i<symbol_table.size(); i++) {
diff --git a/gr-digital/lib/chunks_to_symbols_XX_impl.h.t
b/gr-digital/lib/chunks_to_symbols_XX_impl.h.t
index 031bb69..e0857bf 100644
--- a/gr-digital/lib/chunks_to_symbols_XX_impl.h.t
+++ b/gr-digital/lib/chunks_to_symbols_XX_impl.h.t
@@ -45,7 +45,7 @@ namespace gr {
void set_vector_from_pmt(std::vector<gr_complex> &symbol_table,
pmt::pmt_t &symbol_table_pmt);
void handle_set_symbol_table(pmt::pmt_t symbol_table_pmt);
- void set_symbol_table(std::vector<@O_TYPE@> &symbol_table);
+ void set_symbol_table(const std::vector<@O_TYPE@> &symbol_table);
int D() const { return d_D; }
std::vector<@O_TYPE@> symbol_table() const { return d_symbol_table; }
diff --git a/gr-digital/python/digital/qa_chunks_to_symbols.py
b/gr-digital/python/digital/qa_chunks_to_symbols.py
index d6a9566..0d80f71 100755
--- a/gr-digital/python/digital/qa_chunks_to_symbols.py
+++ b/gr-digital/python/digital/qa_chunks_to_symbols.py
@@ -136,6 +136,39 @@ class test_chunks_to_symbols(gr_unittest.TestCase):
actual_result = dst.data()
self.assertEqual(expected_result, actual_result)
+
+ def test_sf_callback(self):
+ constA = [-3, -1, 1, 3]
+ constB = [12, -12, 6, -6]
+ src_data = (0, 1, 2, 3, 3, 2, 1, 0)
+ expected_result=(12, -12, 6, -6, -6, 6, -12, 12)
+
+ src = blocks.vector_source_s(src_data, False, 1, "")
+ op = digital.chunks_to_symbols_sf(constA)
+ op.set_symbol_table(constB)
+ dst = blocks.vector_sink_f()
+ self.tb.connect(src, op)
+ self.tb.connect(op, dst)
+ self.tb.run()
+ actual_result = dst.data()
+ self.assertEqual(expected_result, actual_result)
+
+ def test_sc_callback(self):
+ constA = [-3.0+1j, -1.0-1j, 1.0+1j, 3-1j]
+ constB = [12.0+1j, -12.0-1j, 6.0+1j, -6-1j]
+ src_data = (0, 1, 2, 3, 3, 2, 1, 0)
+ expected_result=(12.0+1j, -12.0-1j, 6.0+1j, -6-1j, -6-1j, 6+1j,
-12-1j, 12+1j)
+
+ src = blocks.vector_source_s(src_data, False, 1, "")
+ op = digital.chunks_to_symbols_sc(constA)
+ op.set_symbol_table(constB)
+ dst = blocks.vector_sink_c()
+ self.tb.connect(src, op)
+ self.tb.connect(op, dst)
+ self.tb.run()
+ actual_result = dst.data()
+ self.assertEqual(expected_result, actual_result)
+
def test_sf_tag(self):
constA = [-3.0, -1.0, 1.0, 3]
constB = [12.0, -12.0, 6.0, -6]
- [Commit-gnuradio] [gnuradio] 13/43: fec: ldpc GRC compat cleanup, (continued)
- [Commit-gnuradio] [gnuradio] 13/43: fec: ldpc GRC compat cleanup, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 36/43: Merge remote-tracking branch 'fengzhe/chunks_to_symbols_update', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 25/43: grc: set permissions for generated files, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 08/43: fec: adding ldpc encoder and decoder, initial compile working, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 23/43: grc: make use of GRC_HIER_PATH at runtime, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 33/43: Merge remote-tracking branch 'saikwolf/hier_buff_tweak', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 24/43: grc: use 'import' for grc-generated hier_blocks (#763), git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 02/43: gnuradio-runtime: updated hier_block2 and hier_block_detail to allow for propagation of min/max output buffer to all blocks within the hier, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 21/43: grc: Default button in save dialog is now 'save' instead of 'close without saving', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 37/43: Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 05/43: digital: bug fixed in chunks_to_symbols that the callback functiion set_symbol_table didn't work with additonal qa_tests,
git <=
- [Commit-gnuradio] [gnuradio] 32/43: Merge branch 'maint', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 09/43: fec: adding objects needed to run LDPC along with example ALIST file, now imports and instantiates happily, git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 41/43: qtgui: use QPen::setWidthF for non-integer values., git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 39/43: dtv: move "static const" variables from header / class into the main code. The original code is not necessary to have in the class, and causes issues when compiling using c++11 compliance., git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 43/43: Merge remote-tracking branch 'michaelld/fixes_for_std_complex', git, 2015/04/02
- [Commit-gnuradio] [gnuradio] 38/43: dtv: redo c++0x complaint std::complex to be c++11 compliant; works on OSX with GCC (4.2 and 4.8, using listdc++) and Clang (LLVM 3.4 and 3.6, using libc++), with and without -std=c++11., git, 2015/04/02