summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/Modules/GrBoost.cmake46
-rw-r--r--cmake/Packaging/Fedora-18.cmake12
-rw-r--r--gnuradio-core/src/lib/io/gr_file_source.cc11
-rw-r--r--gnuradio-core/src/lib/io/gr_message_debug.cc11
-rw-r--r--gnuradio-core/src/lib/io/gr_message_debug.h13
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block_registry.h1
-rwxr-xr-xgnuradio-core/src/python/gnuradio/gr/qa_pdu.py2
-rw-r--r--gr-analog/include/analog/CMakeLists.txt3
-rw-r--r--gr-analog/lib/ctcss_squelch_ff_impl.cc7
-rw-r--r--gr-analog/swig/CMakeLists.txt2
-rw-r--r--gr-blocks/lib/file_source_impl.cc9
-rw-r--r--gr-blocks/swig/CMakeLists.txt2
-rw-r--r--gr-filter/include/filter/CMakeLists.txt2
-rw-r--r--gr-filter/lib/pfb_synthesizer_ccf_impl.cc52
-rw-r--r--gr-filter/swig/CMakeLists.txt2
-rw-r--r--gr-howto-write-a-block/docs/doxygen/doxyxml/doxyindex.py103
-rw-r--r--gr-howto-write-a-block/docs/doxygen/swig_doc.py159
-rwxr-xr-xgr-uhd/examples/python/usrp_nbfm_ptt.py2
-rw-r--r--grc/blocks/gr_message_debug.xml2
-rw-r--r--grc/blocks/gr_pdu_to_tagged_stream.xml6
-rw-r--r--grc/blocks/gr_tagged_stream_to_pdu.xml6
-rw-r--r--grc/python/extract_docs.py8
-rw-r--r--gruel/src/include/gruel/thread.h2
23 files changed, 330 insertions, 133 deletions
diff --git a/cmake/Modules/GrBoost.cmake b/cmake/Modules/GrBoost.cmake
index 23bea41ad..01378df66 100644
--- a/cmake/Modules/GrBoost.cmake
+++ b/cmake/Modules/GrBoost.cmake
@@ -34,11 +34,13 @@ set(BOOST_REQUIRED_COMPONENTS
thread
)
-if(UNIX AND EXISTS "/usr/lib64")
+if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
-endif(UNIX AND EXISTS "/usr/lib64")
+endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
if(MSVC)
+ set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} chrono)
+
if (NOT DEFINED BOOST_ALL_DYN_LINK)
set(BOOST_ALL_DYN_LINK TRUE)
endif()
@@ -50,14 +52,48 @@ if(MSVC)
endif(BOOST_ALL_DYN_LINK)
endif(MSVC)
-# Boost 1.52 disabled, see https://svn.boost.org/trac/boost/ticket/7669
+find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
+
+# This does not allow us to disable specific versions. It is used
+# internally by cmake to know the formation newer versions. As newer
+# Boost version beyond what is shown here are produced, we must extend
+# this list. To disable Boost versions, see below.
set(Boost_ADDITIONAL_VERSIONS
"1.35.0" "1.35" "1.36.0" "1.36" "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39"
"1.40.0" "1.40" "1.41.0" "1.41" "1.42.0" "1.42" "1.43.0" "1.43" "1.44.0" "1.44"
"1.45.0" "1.45" "1.46.0" "1.46" "1.47.0" "1.47" "1.48.0" "1.48" "1.49.0" "1.49"
- "1.50.0" "1.50" "1.51.0" "1.51" "1.53.0" "1.53" "1.54.0" "1.54"
+ "1.50.0" "1.50" "1.51.0" "1.51" "1.52.0" "1.52" "1.53.0" "1.53" "1.54.0" "1.54"
"1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
)
-find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
+
+# Boost 1.52 disabled, see https://svn.boost.org/trac/boost/ticket/7669
+# Similar problems with Boost 1.46 and 1.47.
+
+OPTION(ENABLE_BAD_BOOST "Enable known bad versions of Boost" OFF)
+if(ENABLE_BAD_BOOST)
+ MESSAGE(STATUS "Enabling use of known bad versions of Boost.")
+endif(ENABLE_BAD_BOOST)
+
+# For any unsuitable Boost version, add the version number below in
+# the following format: XXYYZZ
+# Where:
+# XX is the major version ('10' for version 1)
+# YY is the minor version number ('46' for 1.46)
+# ZZ is the patcher version number (typically just '00')
+set(Boost_NOGO_VERSIONS
+ 104600 104700 105200
+ )
+
+foreach(ver ${Boost_NOGO_VERSIONS})
+ if(${Boost_VERSION} EQUAL ${ver})
+ if(NOT ENABLE_BAD_BOOST)
+ MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Disabling.")
+ set(Boost_FOUND FALSE)
+ else(NOT ENABLE_BAD_BOOST)
+ MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Continuing anyway.")
+ set(Boost_FOUND TRUE)
+ endif(NOT ENABLE_BAD_BOOST)
+ endif(${Boost_VERSION} EQUAL ${ver})
+endforeach(ver)
diff --git a/cmake/Packaging/Fedora-18.cmake b/cmake/Packaging/Fedora-18.cmake
new file mode 100644
index 000000000..2e9e78ee1
--- /dev/null
+++ b/cmake/Packaging/Fedora-18.cmake
@@ -0,0 +1,12 @@
+SET(PACKAGE_DEPENDS_GRUEL_RUNTIME "boost-python" "glibc")
+SET(PACKAGE_DEPENDS_GRUEL_PYTHON "python")
+SET(PACKAGE_DEPENDS_CORE_RUNTIME "fftw-libs")
+SET(PACKAGE_DEPENDS_QTGUI_RUNTIME "qt" "qwt")
+SET(PACKAGE_DEPENDS_QTGUI_PYTHON "PyQt4" "PyQwt")
+SET(PACKAGE_DEPENDS_GRC "python" "numpy" "gtk2" "python-lxml" "python-cheetah")
+SET(PACKAGE_DEPENDS_WXGUI "wxGTK" "python" "numpy")
+SET(PACKAGE_DEPENDS_VIDEO_SDL_RUNTIME "SDL")
+SET(PACKAGE_DEPENDS_UHD_RUNTIME "uhd")
+SET(PACKAGE_DEPENDS_AUDIO_RUNTIME "pulseaudio" "alsa-lib" "jack-audio-connection-kit")
+SET(PACKAGE_DEPENDS_WAVELET_RUNTIME "gsl")
+SET(PACKAGE_DEPENDS_WAVELET_PYTHON "python" "numpy")
diff --git a/gnuradio-core/src/lib/io/gr_file_source.cc b/gnuradio-core/src/lib/io/gr_file_source.cc
index 09f3986cd..6da7abac2 100644
--- a/gnuradio-core/src/lib/io/gr_file_source.cc
+++ b/gnuradio-core/src/lib/io/gr_file_source.cc
@@ -24,6 +24,7 @@
#include "config.h"
#endif
+#include <gruel/thread.h>
#include <gr_file_source.h>
#include <gr_io_signature.h>
#include <cstdio>
@@ -89,7 +90,7 @@ gr_file_source::work (int noutput_items,
if(d_fp == NULL)
throw std::runtime_error("work with file not open");
- boost::mutex::scoped_lock lock(fp_mutex); // hold for the rest of this function
+ gruel::scoped_lock lock(fp_mutex); // hold for the rest of this function
while (size) {
i = fread(o, d_itemsize, size, (FILE *) d_fp);
@@ -129,7 +130,7 @@ bool
gr_file_source::seek (long seek_point, int whence)
{
// obtain exclusive access for duration of this function
- boost::mutex::scoped_lock lock(fp_mutex);
+ gruel::scoped_lock lock(fp_mutex);
return fseek((FILE *) d_fp, seek_point * d_itemsize, whence) == 0;
}
@@ -137,7 +138,7 @@ void
gr_file_source::open(const char *filename, bool repeat)
{
// obtain exclusive access for duration of this function
- boost::mutex::scoped_lock lock(fp_mutex);
+ gruel::scoped_lock lock(fp_mutex);
int fd;
@@ -166,7 +167,7 @@ void
gr_file_source::close()
{
// obtain exclusive access for duration of this function
- boost::mutex::scoped_lock lock(fp_mutex);
+ gruel::scoped_lock lock(fp_mutex);
if(d_new_fp != NULL) {
fclose(d_new_fp);
@@ -179,7 +180,7 @@ void
gr_file_source::do_update()
{
if(d_updated) {
- boost::mutex::scoped_lock lock(fp_mutex); // hold while in scope
+ gruel::scoped_lock lock(fp_mutex); // hold while in scope
if(d_fp)
fclose(d_fp);
diff --git a/gnuradio-core/src/lib/io/gr_message_debug.cc b/gnuradio-core/src/lib/io/gr_message_debug.cc
index 27f4c65fd..9eb1bb639 100644
--- a/gnuradio-core/src/lib/io/gr_message_debug.cc
+++ b/gnuradio-core/src/lib/io/gr_message_debug.cc
@@ -59,10 +59,10 @@ gr_message_debug::store(pmt::pmt_t msg)
}
void
-gr_message_debug::print_verbose(pmt::pmt_t msg)
+gr_message_debug::print_pdu(pmt::pmt_t pdu)
{
- pmt::pmt_t meta = pmt::pmt_car(msg);
- pmt::pmt_t vector = pmt::pmt_cdr(msg);
+ pmt::pmt_t meta = pmt::pmt_car(pdu);
+ pmt::pmt_t vector = pmt::pmt_cdr(pdu);
std::cout << "* MESSAGE DEBUG PRINT PDU VERBOSE *\n";
pmt::pmt_print(meta);
size_t len = pmt::pmt_length(vector);
@@ -71,7 +71,7 @@ gr_message_debug::print_verbose(pmt::pmt_t msg)
size_t offset(0);
const uint8_t* d = (const uint8_t*) pmt_uniform_vector_elements(vector, offset);
for(size_t i=0; i<len; i+=16){
- printf("%04x: ", i);
+ printf("%04x: ", ((unsigned int)i));
for(size_t j=i; j<std::min(i+16,len); j++){
printf("%02x ",d[j] );
}
@@ -110,6 +110,9 @@ gr_message_debug::gr_message_debug()
message_port_register_in(pmt::mp("store"));
set_msg_handler(pmt::mp("store"), boost::bind(&gr_message_debug::store, this, _1));
+
+ message_port_register_in(pmt::mp("print_pdu"));
+ set_msg_handler(pmt::mp("print_pdu"), boost::bind(&gr_message_debug::print_pdu, this, _1));
}
gr_message_debug::~gr_message_debug()
diff --git a/gnuradio-core/src/lib/io/gr_message_debug.h b/gnuradio-core/src/lib/io/gr_message_debug.h
index 6e6e5103c..f1374e806 100644
--- a/gnuradio-core/src/lib/io/gr_message_debug.h
+++ b/gnuradio-core/src/lib/io/gr_message_debug.h
@@ -55,7 +55,18 @@ class GR_CORE_API gr_message_debug : public gr_block
* \param msg A pmt message passed from the scheduler's message handling.
*/
void print(pmt::pmt_t msg);
- void print_verbose(pmt::pmt_t msg);
+
+ /*!
+ * \brief PDU formatted messages received in this port are printed to stdout.
+ *
+ * This port receives messages from the scheduler's message handling
+ * mechanism and prints it to stdout. This message handler function
+ * is only meant to be used by the scheduler to handle messages
+ * posted to port 'print'.
+ *
+ * \param pdu A PDU message passed from the scheduler's message handling.
+ */
+ void print_pdu(pmt::pmt_t pdu);
/*!
* \brief Messages received in this port are stored in a vector.
diff --git a/gnuradio-core/src/lib/runtime/gr_block_registry.h b/gnuradio-core/src/lib/runtime/gr_block_registry.h
index 6a2d939e5..3a9d9868f 100644
--- a/gnuradio-core/src/lib/runtime/gr_block_registry.h
+++ b/gnuradio-core/src/lib/runtime/gr_block_registry.h
@@ -2,6 +2,7 @@
#define GR_BLOCK_REGISTRY_H
#include <map>
+#include <gr_basic_block.h>
#ifndef GR_BASIC_BLOCK_H
class gr_basic_block;
diff --git a/gnuradio-core/src/python/gnuradio/gr/qa_pdu.py b/gnuradio-core/src/python/gnuradio/gr/qa_pdu.py
index 572d8b186..c1110c10b 100755
--- a/gnuradio-core/src/python/gnuradio/gr/qa_pdu.py
+++ b/gnuradio-core/src/python/gnuradio/gr/qa_pdu.py
@@ -46,7 +46,7 @@ class test_pdu(gr_unittest.TestCase):
# Test that the right number of ports exist.
pi = dbg.message_ports_in()
po = dbg.message_ports_out()
- self.assertEqual(pmt.pmt_length(pi), 2)
+ self.assertEqual(pmt.pmt_length(pi), 3)
self.assertEqual(pmt.pmt_length(po), 0)
pi = snk3.message_ports_in()
diff --git a/gr-analog/include/analog/CMakeLists.txt b/gr-analog/include/analog/CMakeLists.txt
index 4de94a88b..b113dacc4 100644
--- a/gr-analog/include/analog/CMakeLists.txt
+++ b/gr-analog/include/analog/CMakeLists.txt
@@ -75,11 +75,12 @@ add_custom_target(analog_generated_includes DEPENDS
# Install header files
########################################################################
install(FILES
- ${analog_generated_includes}
+ ${generated_includes}
api.h
cpm.h
agc.h
agc2.h
+ noise_type.h
squelch_base_ff.h
agc_cc.h
agc_ff.h
diff --git a/gr-analog/lib/ctcss_squelch_ff_impl.cc b/gr-analog/lib/ctcss_squelch_ff_impl.cc
index db49b4f6e..60cd94fdb 100644
--- a/gr-analog/lib/ctcss_squelch_ff_impl.cc
+++ b/gr-analog/lib/ctcss_squelch_ff_impl.cc
@@ -115,11 +115,12 @@ namespace gr {
d_goertzel_c.input(in);
d_goertzel_r.input(in);
+ float rounder = 100000;
float d_out_l, d_out_c, d_out_r;
if(d_goertzel_c.ready()) {
- d_out_l = abs(d_goertzel_l.output());
- d_out_c = abs(d_goertzel_c.output());
- d_out_r = abs(d_goertzel_r.output());
+ d_out_l = floor(rounder*abs(d_goertzel_l.output()))/rounder;
+ d_out_c = floor(rounder*abs(d_goertzel_c.output()))/rounder;
+ d_out_r = floor(rounder*abs(d_goertzel_r.output()))/rounder;
//printf("d_out_l=%f d_out_c=%f d_out_r=%f\n", d_out_l, d_out_c, d_out_r);
d_mute = (d_out_c < d_level || d_out_c < d_out_l || d_out_c < d_out_r);
diff --git a/gr-analog/swig/CMakeLists.txt b/gr-analog/swig/CMakeLists.txt
index 9ed82e267..4391e5e09 100644
--- a/gr-analog/swig/CMakeLists.txt
+++ b/gr-analog/swig/CMakeLists.txt
@@ -33,7 +33,7 @@ set(GR_SWIG_INCLUDE_DIRS
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/analog_swig_doc.i)
set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../lib)
-
+set(GR_SWIG_TARGET_DEPS analog_generated_includes)
set(GR_SWIG_LIBRARIES gnuradio-analog gnuradio-filter)
GR_SWIG_MAKE(analog_swig analog_swig.i)
diff --git a/gr-blocks/lib/file_source_impl.cc b/gr-blocks/lib/file_source_impl.cc
index ed1f50c43..dcbd04210 100644
--- a/gr-blocks/lib/file_source_impl.cc
+++ b/gr-blocks/lib/file_source_impl.cc
@@ -24,6 +24,7 @@
#include "config.h"
#endif
+#include <gruel/thread.h>
#include "file_source_impl.h"
#include <gr_io_signature.h>
#include <cstdio>
@@ -84,7 +85,7 @@ namespace gr {
file_source_impl::open(const char *filename, bool repeat)
{
// obtain exclusive access for duration of this function
- boost::mutex::scoped_lock lock(fp_mutex);
+ gruel::scoped_lock lock(fp_mutex);
int fd;
@@ -113,7 +114,7 @@ namespace gr {
file_source_impl::close()
{
// obtain exclusive access for duration of this function
- boost::mutex::scoped_lock lock(fp_mutex);
+ gruel::scoped_lock lock(fp_mutex);
if(d_new_fp != NULL) {
fclose(d_new_fp);
@@ -126,7 +127,7 @@ namespace gr {
file_source_impl::do_update()
{
if(d_updated) {
- boost::mutex::scoped_lock lock(fp_mutex); // hold while in scope
+ gruel::scoped_lock lock(fp_mutex); // hold while in scope
if(d_fp)
fclose(d_fp);
@@ -150,7 +151,7 @@ namespace gr {
if(d_fp == NULL)
throw std::runtime_error("work with file not open");
- boost::mutex::scoped_lock lock(fp_mutex); // hold for the rest of this function
+ gruel::scoped_lock lock(fp_mutex); // hold for the rest of this function
while(size) {
i = fread(o, d_itemsize, size, (FILE*)d_fp);
diff --git a/gr-blocks/swig/CMakeLists.txt b/gr-blocks/swig/CMakeLists.txt
index aa5c7bf55..84ab5b660 100644
--- a/gr-blocks/swig/CMakeLists.txt
+++ b/gr-blocks/swig/CMakeLists.txt
@@ -33,7 +33,7 @@ set(GR_SWIG_INCLUDE_DIRS
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/blocks_swig_doc.i)
set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../lib)
-
+set(GR_SWIG_TARGET_DEPS blocks_generated_includes)
set(GR_SWIG_LIBRARIES gnuradio-blocks)
GR_SWIG_MAKE(blocks_swig blocks_swig.i)
diff --git a/gr-filter/include/filter/CMakeLists.txt b/gr-filter/include/filter/CMakeLists.txt
index c6bf109cd..4c126fcbd 100644
--- a/gr-filter/include/filter/CMakeLists.txt
+++ b/gr-filter/include/filter/CMakeLists.txt
@@ -77,6 +77,7 @@ add_custom_target(filter_generated_includes DEPENDS
# Install header files
########################################################################
install(FILES
+ ${generated_includes}
api.h
firdes.h
fir_filter.h
@@ -89,7 +90,6 @@ install(FILES
pm_remez.h
polyphase_filterbank.h
single_pole_iir.h
- ${generated_includes}
adaptive_fir_ccc.h
adaptive_fir_ccf.h
dc_blocker_cc.h
diff --git a/gr-filter/lib/pfb_synthesizer_ccf_impl.cc b/gr-filter/lib/pfb_synthesizer_ccf_impl.cc
index 9dd519d57..f89b48b12 100644
--- a/gr-filter/lib/pfb_synthesizer_ccf_impl.cc
+++ b/gr-filter/lib/pfb_synthesizer_ccf_impl.cc
@@ -47,8 +47,8 @@ namespace gr {
: gr_sync_interpolator("pfb_synthesizer_ccf",
gr_make_io_signature(1, numchans, sizeof(gr_complex)),
gr_make_io_signature(1, 1, sizeof(gr_complex)),
- numchans),
- d_updated (false), d_numchans(numchans), d_state(0)
+ (twox ? numchans/2 : numchans)),
+ d_updated(false), d_numchans(numchans), d_state(0)
{
// set up 2x multiplier; if twox==True, set to 2, otherwise to 1
d_twox = (twox ? 2 : 1);
@@ -56,12 +56,12 @@ namespace gr {
throw std::invalid_argument("pfb_synthesizer_ccf: number of channels must be even for 2x oversampling.\n");
}
- d_filters = std::vector<kernel::fir_filter_with_buffer_ccf*>(d_twox*d_numchans);
- d_channel_map.resize(d_twox*d_numchans);
+ d_filters = std::vector<kernel::fir_filter_with_buffer_ccf*>(d_numchans);
+ d_channel_map.resize(d_numchans);
// Create a FIR filter for each channel and zero out the taps
- std::vector<float> vtaps(0, d_twox*d_numchans);
- for(unsigned int i = 0; i < d_twox*d_numchans; i++) {
+ std::vector<float> vtaps(0, d_numchans);
+ for(unsigned int i = 0; i < d_numchans; i++) {
d_filters[i] = new kernel::fir_filter_with_buffer_ccf(vtaps);
d_channel_map[i] = i;
}
@@ -70,15 +70,15 @@ namespace gr {
set_taps(taps);
// Create the IFFT to handle the input channel rotations
- d_fft = new fft::fft_complex(d_twox*d_numchans, false);
- memset(d_fft->get_inbuf(), 0, d_twox*d_numchans*sizeof(gr_complex));
+ d_fft = new fft::fft_complex(d_numchans, false);
+ memset(d_fft->get_inbuf(), 0, d_numchans*sizeof(gr_complex));
set_output_multiple(d_numchans);
}
pfb_synthesizer_ccf_impl::~pfb_synthesizer_ccf_impl()
{
- for(unsigned int i = 0; i < d_twox*d_numchans; i++) {
+ for(unsigned int i = 0; i < d_numchans; i++) {
delete d_filters[i];
}
}
@@ -137,11 +137,11 @@ namespace gr {
unsigned int i,j;
int state = 0;
- unsigned int ntaps = taps.size();
+ unsigned int ntaps = 2*taps.size();
d_taps_per_filter = (unsigned int)ceil((double)ntaps/(double)d_numchans);
// Create d_numchan vectors to store each channel's taps
- d_taps.resize(d_twox*d_numchans);
+ d_taps.resize(d_numchans);
// Make a vector of the taps plus fill it out with 0's to fill
// each polyphase filter with exactly d_taps_per_filter
@@ -152,29 +152,30 @@ namespace gr {
}
// Partition the filter
- for(i = 0; i < d_numchans; i++) {
+ unsigned int halfchans = d_numchans/2;
+ for(i = 0; i < halfchans; i++) {
// Each channel uses all d_taps_per_filter with 0's if not enough taps to fill out
d_taps[i] = std::vector<float>(d_taps_per_filter, 0);
- d_taps[d_numchans+i] = std::vector<float>(d_taps_per_filter, 0);
+ d_taps[halfchans+i] = std::vector<float>(d_taps_per_filter, 0);
state = 0;
for(j = 0; j < d_taps_per_filter; j++) {
// add taps to channels in reverse order
// Zero out every other tap
if(state == 0) {
- d_taps[i][j] = tmp_taps[i + j*d_numchans];
- d_taps[d_numchans + i][j] = 0;
+ d_taps[i][j] = tmp_taps[i + j*halfchans];
+ d_taps[halfchans + i][j] = 0;
state = 1;
}
else {
d_taps[i][j] = 0;
- d_taps[d_numchans + i][j] = tmp_taps[i + j*d_numchans];
+ d_taps[halfchans + i][j] = tmp_taps[i + j*halfchans];
state = 0;
}
}
// Build a filter for each channel and add it's taps to it
d_filters[i]->set_taps(d_taps[i]);
- d_filters[d_numchans + i]->set_taps(d_taps[d_numchans + i]);
+ d_filters[halfchans + i]->set_taps(d_taps[halfchans + i]);
}
}
@@ -182,7 +183,7 @@ namespace gr {
pfb_synthesizer_ccf_impl::print_taps()
{
unsigned int i, j;
- for(i = 0; i < d_twox*d_numchans; i++) {
+ for(i = 0; i < d_numchans; i++) {
printf("filter[%d]: [", i);
for(j = 0; j < d_taps_per_filter; j++) {
printf(" %.4e", d_taps[i][j]);
@@ -204,13 +205,13 @@ namespace gr {
if(map.size() > 0) {
unsigned int max = (unsigned int)*std::max_element(map.begin(), map.end());
- if(max >= d_twox*d_numchans) {
+ if(max >= d_numchans) {
throw std::invalid_argument("gr_pfb_synthesizer_ccf::set_channel_map: map range out of bounds.\n");
}
d_channel_map = map;
// Zero out fft buffer so that unused channels are always 0
- memset(d_fft->get_inbuf(), 0,d_twox*d_numchans*sizeof(gr_complex));
+ memset(d_fft->get_inbuf(), 0, d_numchans*sizeof(gr_complex));
}
}
@@ -258,7 +259,8 @@ namespace gr {
// Algorithm for oversampling by 2x
else {
- for(n = 0; n < noutput_items/d_numchans; n++) {
+ unsigned int halfchans = d_numchans/2;
+ for(n = 0; n < noutput_items/halfchans; n++) {
for(i = 0; i < ninputs; i++) {
in = (gr_complex*)input_items[i];
d_fft->get_inbuf()[d_channel_map[i]] = in[n];
@@ -270,13 +272,13 @@ namespace gr {
// Output is sum of two filters, but the input buffer to the filters must be circularly
// shifted by numchans every time through, done by using d_state to determine which IFFT
// buffer position to pull from.
- for(i = 0; i < d_numchans; i++) {
- out[i] = d_filters[i]->filter(d_fft->get_outbuf()[d_state*d_numchans+i]);
- out[i] += d_filters[d_numchans+i]->filter(d_fft->get_outbuf()[(d_state^1)*d_numchans+i]);
+ for(i = 0; i < halfchans; i++) {
+ out[i] = d_filters[i]->filter(d_fft->get_outbuf()[d_state*halfchans+i]);
+ out[i] += d_filters[halfchans+i]->filter(d_fft->get_outbuf()[(d_state^1)*halfchans+i]);
}
d_state ^= 1;
- out += d_numchans;
+ out += halfchans;
}
}
diff --git a/gr-filter/swig/CMakeLists.txt b/gr-filter/swig/CMakeLists.txt
index 50c5bca6d..ea8c010e0 100644
--- a/gr-filter/swig/CMakeLists.txt
+++ b/gr-filter/swig/CMakeLists.txt
@@ -35,7 +35,7 @@ set(GR_SWIG_INCLUDE_DIRS
# FIXME: rename to filter_swig_doc.i when gnuradio-core is updated
set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/gr_filter_swig_doc.i)
set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../lib)
-
+set(GR_SWIG_TARGET_DEPS filter_generated_includes)
set(GR_SWIG_LIBRARIES gnuradio-filter gnuradio-fft)
GR_SWIG_MAKE(filter_swig filter_swig.i)
diff --git a/gr-howto-write-a-block/docs/doxygen/doxyxml/doxyindex.py b/gr-howto-write-a-block/docs/doxygen/doxyxml/doxyindex.py
index 0132ab86f..304109a8e 100644
--- a/gr-howto-write-a-block/docs/doxygen/doxyxml/doxyindex.py
+++ b/gr-howto-write-a-block/docs/doxygen/doxyxml/doxyindex.py
@@ -1,23 +1,23 @@
#
# Copyright 2010 Free Software Foundation, Inc.
-#
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
"""
Classes providing more user-friendly interfaces to the doxygen xml
docs than the generated classes provide.
@@ -40,7 +40,7 @@ class DoxyIndex(Base):
if self._parsed:
return
super(DoxyIndex, self)._parse()
- self._root = index.parse(os.path.join(self._xml_path, 'index.xml'))
+ self._root = index.parse(os.path.join(self._xml_path, 'index.xml'))
for mem in self._root.compound:
converted = self.convert_mem(mem)
# For files we want the contents to be accessible directly
@@ -78,7 +78,24 @@ class DoxyCompMem(Base):
bd = description(getattr(parse_data, 'briefdescription', None))
dd = description(getattr(parse_data, 'detaileddescription', None))
self._data['brief_description'] = bd
- self._data['detailed_description'] = dd
+ self._data['detailed_description'] = dd
+
+ def set_parameters(self, data):
+ vs = [ddc.value for ddc in data.detaileddescription.content_]
+ pls = []
+ for v in vs:
+ if hasattr(v, 'parameterlist'):
+ pls += v.parameterlist
+ pis = []
+ for pl in pls:
+ pis += pl.parameteritem
+ dpis = []
+ for pi in pis:
+ dpi = DoxyParameterItem(pi)
+ dpi._parse()
+ dpis.append(dpi)
+ self._data['params'] = dpis
+
class DoxyCompound(DoxyCompMem):
pass
@@ -86,7 +103,6 @@ class DoxyCompound(DoxyCompMem):
class DoxyMember(DoxyCompMem):
pass
-
class DoxyFunction(DoxyMember):
__module__ = "gnuradio.utils.doxyxml"
@@ -98,10 +114,13 @@ class DoxyFunction(DoxyMember):
return
super(DoxyFunction, self)._parse()
self.set_descriptions(self._parse_data)
- self._data['params'] = []
- prms = self._parse_data.param
- for prm in prms:
- self._data['params'].append(DoxyParam(prm))
+ self.set_parameters(self._parse_data)
+ if not self._data['params']:
+ # If the params weren't set by a comment then just grab the names.
+ self._data['params'] = []
+ prms = self._parse_data.param
+ for prm in prms:
+ self._data['params'].append(DoxyParam(prm))
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
@@ -111,7 +130,7 @@ Base.mem_classes.append(DoxyFunction)
class DoxyParam(DoxyMember):
-
+
__module__ = "gnuradio.utils.doxyxml"
def _parse(self):
@@ -121,16 +140,46 @@ class DoxyParam(DoxyMember):
self.set_descriptions(self._parse_data)
self._data['declname'] = self._parse_data.declname
+ @property
+ def description(self):
+ descriptions = []
+ if self.brief_description:
+ descriptions.append(self.brief_description)
+ if self.detailed_description:
+ descriptions.append(self.detailed_description)
+ return '\n\n'.join(descriptions)
+
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
- declname = property(lambda self: self.data()['declname'])
+ name = property(lambda self: self.data()['declname'])
-class DoxyClass(DoxyCompound):
+class DoxyParameterItem(DoxyMember):
+ """A different representation of a parameter in Doxygen."""
+
+ def _parse(self):
+ if self._parsed:
+ return
+ super(DoxyParameterItem, self)._parse()
+ names = []
+ for nl in self._parse_data.parameternamelist:
+ for pn in nl.parametername:
+ names.append(description(pn))
+ # Just take first name
+ self._data['name'] = names[0]
+ # Get description
+ pd = description(self._parse_data.get_parameterdescription())
+ self._data['description'] = pd
+
+ description = property(lambda self: self.data()['description'])
+ name = property(lambda self: self.data()['name'])
+
+class DoxyClass(DoxyCompound):
+
__module__ = "gnuradio.utils.doxyxml"
kind = 'class'
-
+
def _parse(self):
if self._parsed:
return
@@ -139,22 +188,24 @@ class DoxyClass(DoxyCompound):
if self._error:
return
self.set_descriptions(self._retrieved_data.compounddef)
+ self.set_parameters(self._retrieved_data.compounddef)
# Sectiondef.kind tells about whether private or public.
# We just ignore this for now.
self.process_memberdefs()
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
+ params = property(lambda self: self.data()['params'])
Base.mem_classes.append(DoxyClass)
-
+
class DoxyFile(DoxyCompound):
-
+
__module__ = "gnuradio.utils.doxyxml"
kind = 'file'
-
+
def _parse(self):
if self._parsed:
return
@@ -164,7 +215,7 @@ class DoxyFile(DoxyCompound):
if self._error:
return
self.process_memberdefs()
-
+
brief_description = property(lambda self: self.data()['brief_description'])
detailed_description = property(lambda self: self.data()['detailed_description'])
@@ -172,16 +223,16 @@ Base.mem_classes.append(DoxyFile)
class DoxyNamespace(DoxyCompound):
-
+
__module__ = "gnuradio.utils.doxyxml"
kind = 'namespace'
-
+
Base.mem_classes.append(DoxyNamespace)
class DoxyGroup(DoxyCompound):
-
+
__module__ = "gnuradio.utils.doxyxml"
kind = 'group'
@@ -209,7 +260,7 @@ class DoxyGroup(DoxyCompound):
self.process_memberdefs()
title = property(lambda self: self.data()['title'])
-
+
Base.mem_classes.append(DoxyGroup)
@@ -224,7 +275,7 @@ Base.mem_classes.append(DoxyFriend)
class DoxyOther(Base):
-
+
__module__ = "gnuradio.utils.doxyxml"
kinds = set(['variable', 'struct', 'union', 'define', 'typedef', 'enum', 'dir', 'page'])
@@ -232,6 +283,6 @@ class DoxyOther(Base):
@classmethod
def can_parse(cls, obj):
return obj.kind in cls.kinds
-
+
Base.mem_classes.append(DoxyOther)
diff --git a/gr-howto-write-a-block/docs/doxygen/swig_doc.py b/gr-howto-write-a-block/docs/doxygen/swig_doc.py
index 4e1ce2e47..f24608b3e 100644
--- a/gr-howto-write-a-block/docs/doxygen/swig_doc.py
+++ b/gr-howto-write-a-block/docs/doxygen/swig_doc.py
@@ -1,23 +1,23 @@
#
-# Copyright 2010,2011 Free Software Foundation, Inc.
-#
+# Copyright 2010-2012 Free Software Foundation, Inc.
+#
# This file is part of GNU Radio
-#
+#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
-#
+#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-#
+#
"""
Creates the swig_doc.i SWIG interface file.
Execute using: python swig_doc.py xml_path outputfilename
@@ -27,13 +27,10 @@ python docstrings.
"""
-import sys
-
-try:
- from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile, base
-except ImportError:
- from gnuradio.doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile, base
+import sys, time
+from doxyxml import DoxyIndex, DoxyClass, DoxyFriend, DoxyFunction, DoxyFile
+from doxyxml import DoxyOther, base
def py_name(name):
bits = name.split('_')
@@ -56,8 +53,29 @@ class Block(object):
# Check for a parsing error.
if item.error():
return False
- return item.has_member(make_name(item.name()), DoxyFriend)
-
+ friendname = make_name(item.name())
+ is_a_block = item.has_member(friendname, DoxyFriend)
+ # But now sometimes the make function isn't a friend so check again.
+ if not is_a_block:
+ is_a_block = di.has_member(friendname, DoxyFunction)
+ return is_a_block
+
+class Block2(object):
+ """
+ Checks if doxyxml produced objects correspond to a new style
+ gnuradio block.
+ """
+
+ @classmethod
+ def includes(cls, item):
+ if not isinstance(item, DoxyClass):
+ return False
+ # Check for a parsing error.
+ if item.error():
+ return False
+ is_a_block2 = item.has_member('make', DoxyFunction) and item.has_member('sptr', DoxyOther)
+ return is_a_block2
+
def utoascii(text):
"""
@@ -82,13 +100,19 @@ def combine_descriptions(obj):
if dd:
description.append(dd)
return utoascii('\n\n'.join(description)).strip()
-
+
+def format_params(parameteritems):
+ output = ['Args:']
+ template = ' {0} : {1}'
+ for pi in parameteritems:
+ output.append(template.format(pi.name, pi.description))
+ return '\n'.join(output)
entry_templ = '%feature("docstring") {name} "{docstring}"'
-def make_entry(obj, name=None, templ="{description}", description=None):
+def make_entry(obj, name=None, templ="{description}", description=None, params=[]):
"""
Create a docstring entry for a swig interface file.
-
+
obj - a doxyxml object from which documentation will be extracted.
name - the name of the C object (defaults to obj.name())
templ - an optional template for the docstring containing only one
@@ -102,6 +126,9 @@ def make_entry(obj, name=None, templ="{description}", description=None):
return ''
if description is None:
description = combine_descriptions(obj)
+ if params:
+ description += '\n\n'
+ description += utoascii(format_params(params))
docstring = templ.format(description=description)
if not docstring:
return ''
@@ -121,27 +148,31 @@ def make_func_entry(func, name=None, description=None, params=None):
used as the description instead of extracting it from func.
params - a parameter list that overrides using func.params.
"""
- if params is None:
- params = func.params
- params = [prm.declname for prm in params]
- if params:
- sig = "Params: (%s)" % ", ".join(params)
- else:
- sig = "Params: (NONE)"
- templ = "{description}\n\n" + sig
- return make_entry(func, name=name, templ=utoascii(templ),
- description=description)
-
-
-def make_class_entry(klass, description=None):
+ #if params is None:
+ # params = func.params
+ #params = [prm.declname for prm in params]
+ #if params:
+ # sig = "Params: (%s)" % ", ".join(params)
+ #else:
+ # sig = "Params: (NONE)"
+ #templ = "{description}\n\n" + sig
+ #return make_entry(func, name=name, templ=utoascii(templ),
+ # description=description)
+ return make_entry(func, name=name, description=description, params=params)
+
+
+def make_class_entry(klass, description=None, ignored_methods=[], params=None):
"""
Create a class docstring for a swig interface file.
"""
+ if params is None:
+ params = klass.params
output = []
- output.append(make_entry(klass, description=description))
+ output.append(make_entry(klass, description=description, params=params))
for func in klass.in_category(DoxyFunction):
- name = klass.name() + '::' + func.name()
- output.append(make_func_entry(func, name=name))
+ if func.name() not in ignored_methods:
+ name = klass.name() + '::' + func.name()
+ output.append(make_func_entry(func, name=name))
return "\n\n".join(output)
@@ -175,18 +206,38 @@ def make_block_entry(di, block):
# the make function.
output = []
output.append(make_class_entry(block, description=super_description))
- creator = block.get_member(block.name(), DoxyFunction)
output.append(make_func_entry(make_func, description=super_description,
- params=creator.params))
+ params=block.params))
return "\n\n".join(output)
+def make_block2_entry(di, block):
+ """
+ Create class and function docstrings of a new style gnuradio block for a
+ swig interface file.
+ """
+ descriptions = []
+ # For new style blocks all the relevant documentation should be
+ # associated with the 'make' method.
+ make_func = block.get_member('make', DoxyFunction)
+ description = combine_descriptions(make_func)
+ # Associate the combined description with the class and
+ # the make function.
+ output = []
+ #output.append(make_class_entry(
+ # block, description=description,
+ # ignored_methods=['make'], params=make_func.params))
+ makename = block.name() + '::make'
+ output.append(make_func_entry(
+ make_func, name=makename, description=description,
+ params=make_func.params))
+ return "\n\n".join(output)
def make_swig_interface_file(di, swigdocfilename, custom_output=None):
-
+
output = ["""
/*
* This file was automatically generated using swig_doc.py.
- *
+ *
* Any changes to it will be lost next time it is regenerated.
*/
"""]
@@ -196,32 +247,52 @@ def make_swig_interface_file(di, swigdocfilename, custom_output=None):
# Create docstrings for the blocks.
blocks = di.in_category(Block)
+ blocks2 = di.in_category(Block2)
+
make_funcs = set([])
for block in blocks:
try:
make_func = di.get_member(make_name(block.name()), DoxyFunction)
- make_funcs.add(make_func.name())
- output.append(make_block_entry(di, block))
+ # Don't want to risk writing to output twice.
+ if make_func.name() not in make_funcs:
+ make_funcs.add(make_func.name())
+ output.append(make_block_entry(di, block))
+ except block.ParsingError:
+ sys.stderr.write('Parsing error for block {0}\n'.format(block.name()))
+ raise
+
+ for block in blocks2:
+ try:
+ make_func = block.get_member('make', DoxyFunction)
+ make_func_name = block.name() +'::make'
+ # Don't want to risk writing to output twice.
+ if make_func_name not in make_funcs:
+ make_funcs.add(make_func_name)
+ output.append(make_block2_entry(di, block))
except block.ParsingError:
- print('Parsing error for block %s' % block.name())
+ sys.stderr.write('Parsing error for block {0}\n'.format(block.name()))
+ raise
# Create docstrings for functions
# Don't include the make functions since they have already been dealt with.
- funcs = [f for f in di.in_category(DoxyFunction) if f.name() not in make_funcs]
+ funcs = [f for f in di.in_category(DoxyFunction)
+ if f.name() not in make_funcs and not f.name().startswith('std::')]
for f in funcs:
try:
output.append(make_func_entry(f))
except f.ParsingError:
- print('Parsing error for function %s' % f.name())
+ sys.stderr.write('Parsing error for function {0}\n'.format(f.name()))
# Create docstrings for classes
block_names = [block.name() for block in blocks]
- klasses = [k for k in di.in_category(DoxyClass) if k.name() not in block_names]
+ block_names += [block.name() for block in blocks2]
+ klasses = [k for k in di.in_category(DoxyClass)
+ if k.name() not in block_names and not k.name().startswith('std::')]
for k in klasses:
try:
output.append(make_class_entry(k))
except k.ParsingError:
- print('Parsing error for class %s' % k.name())
+ sys.stderr.write('Parsing error for class {0}\n'.format(k.name()))
# Docstrings are not created for anything that is not a function or a class.
# If this excludes anything important please add it here.
diff --git a/gr-uhd/examples/python/usrp_nbfm_ptt.py b/gr-uhd/examples/python/usrp_nbfm_ptt.py
index 8d26e656e..cf992a5f2 100755
--- a/gr-uhd/examples/python/usrp_nbfm_ptt.py
+++ b/gr-uhd/examples/python/usrp_nbfm_ptt.py
@@ -369,7 +369,7 @@ class transmit_path(gr.hier_block2):
# ////////////////////////////////////////////////////////////////////////
class receive_path(gr.hier_block2):
- def __init__(self, args, gain, audio_output):
+ def __init__(self, args, spec, antenna, gain, audio_output):
gr.hier_block2.__init__(self, "receive_path",
gr.io_signature(0, 0, 0), # Input signature
gr.io_signature(0, 0, 0)) # Output signature
diff --git a/grc/blocks/gr_message_debug.xml b/grc/blocks/gr_message_debug.xml
index 4d73fbd9c..964f95756 100644
--- a/grc/blocks/gr_message_debug.xml
+++ b/grc/blocks/gr_message_debug.xml
@@ -20,7 +20,7 @@
<optional>1</optional>
</sink>
<sink>
- <name>print_pdu_verbose</name>
+ <name>print_pdu</name>
<type>message</type>
<optional>1</optional>
</sink>
diff --git a/grc/blocks/gr_pdu_to_tagged_stream.xml b/grc/blocks/gr_pdu_to_tagged_stream.xml
index fc1c4d16a..6d2fea97e 100644
--- a/grc/blocks/gr_pdu_to_tagged_stream.xml
+++ b/grc/blocks/gr_pdu_to_tagged_stream.xml
@@ -16,17 +16,17 @@
<option>
<name>Byte</name>
<key>byte</key>
- <opt>tv:gr.BYTE</opt>
+ <opt>tv:gr.pdu_byte</opt>
</option>
<option>
<name>Complex</name>
<key>complex</key>
- <opt>tv:gr.COMPLEX</opt>
+ <opt>tv:gr.pdu_complex</opt>
</option>
<option>
<name>Float</name>
<key>float</key>
- <opt>tv:gr.FLOAT</opt>
+ <opt>tv:gr.pdu_float</opt>
</option>
</param>
<sink>
diff --git a/grc/blocks/gr_tagged_stream_to_pdu.xml b/grc/blocks/gr_tagged_stream_to_pdu.xml
index e70a01608..e2f754c9e 100644
--- a/grc/blocks/gr_tagged_stream_to_pdu.xml
+++ b/grc/blocks/gr_tagged_stream_to_pdu.xml
@@ -16,17 +16,17 @@
<option>
<name>Byte</name>
<key>byte</key>
- <opt>tv:gr.BYTE</opt>
+ <opt>tv:gr.pdu_byte</opt>
</option>
<option>
<name>Complex</name>
<key>complex</key>
- <opt>tv:gr.COMPLEX</opt>
+ <opt>tv:gr.pdu_complex</opt>
</option>
<option>
<name>Float</name>
<key>float</key>
- <opt>tv:gr.FLOAT</opt>
+ <opt>tv:gr.pdu_float</opt>
</option>
</param>
<sink>
diff --git a/grc/python/extract_docs.py b/grc/python/extract_docs.py
index a7e945c37..33c404362 100644
--- a/grc/python/extract_docs.py
+++ b/grc/python/extract_docs.py
@@ -31,7 +31,13 @@ def _extract(key):
module_name, constructor_name = key.split('_', 1)
module = __import__('gnuradio.'+module_name)
module = getattr(module, module_name)
- except: return ''
+ except ImportError:
+ try:
+ module_name, constructor_name = key.split('_', 1)
+ module = __import__(module_name)
+ except: return ''
+ except:
+ return ''
pattern = constructor_name.replace('_', '_*').replace('x', '\w')
pattern_matcher = re.compile('^%s\w*$'%pattern)
matches = filter(lambda x: pattern_matcher.match(x), dir(module))
diff --git a/gruel/src/include/gruel/thread.h b/gruel/src/include/gruel/thread.h
index 63143c8b4..c0b54b0a4 100644
--- a/gruel/src/include/gruel/thread.h
+++ b/gruel/src/include/gruel/thread.h
@@ -31,7 +31,7 @@ namespace gruel {
typedef boost::thread thread;
typedef boost::mutex mutex;
- typedef boost::mutex::scoped_lock scoped_lock;
+ typedef boost::unique_lock<boost::mutex> scoped_lock;
typedef boost::condition_variable condition_variable;
} /* namespace gruel */