summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-blocks/lib/tags_strobe_impl.cc2
-rw-r--r--gr-blocks/lib/vector_sink_X_impl.cc.t17
-rw-r--r--gr-blocks/lib/vector_sink_X_impl.h.t6
-rw-r--r--gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.cc2
-rw-r--r--gr-qtgui/grc/qtgui_time_sink_x.xml2
-rw-r--r--gr-qtgui/lib/TimeDomainDisplayPlot.cc8
-rw-r--r--gr-qtgui/lib/time_sink_c_impl.cc3
-rw-r--r--gr-qtgui/lib/time_sink_f_impl.cc3
-rw-r--r--gr-uhd/grc/gen_uhd_usrp_blocks.py4
9 files changed, 41 insertions, 6 deletions
diff --git a/gr-blocks/lib/tags_strobe_impl.cc b/gr-blocks/lib/tags_strobe_impl.cc
index ddae7fe21f..f821cefccd 100644
--- a/gr-blocks/lib/tags_strobe_impl.cc
+++ b/gr-blocks/lib/tags_strobe_impl.cc
@@ -60,6 +60,7 @@ namespace gr {
set_value(value);
set_key(key);
set_nsamps(nsamps);
+ d_offset = 0;
}
tags_strobe_impl::~tags_strobe_impl()
@@ -82,7 +83,6 @@ namespace gr {
tags_strobe_impl::set_nsamps(uint64_t nsamps)
{
d_nsamps = nsamps;
- d_offset = 0;
}
int
diff --git a/gr-blocks/lib/vector_sink_X_impl.cc.t b/gr-blocks/lib/vector_sink_X_impl.cc.t
index 62c6d17dc7..3155c0cb67 100644
--- a/gr-blocks/lib/vector_sink_X_impl.cc.t
+++ b/gr-blocks/lib/vector_sink_X_impl.cc.t
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2008,2010,2013 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2010,2013,2017 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -28,6 +28,7 @@
#include <@NAME_IMPL@.h>
#include <gnuradio/io_signature.h>
+#include <gnuradio/thread/thread.h>
#include <algorithm>
#include <iostream>
@@ -55,15 +56,26 @@ namespace gr {
std::vector<@TYPE@>
@NAME_IMPL@::data() const
{
+ gr::thread::scoped_lock guard(d_data_mutex);
return d_data;
}
std::vector<tag_t>
@NAME_IMPL@::tags() const
{
+ gr::thread::scoped_lock guard(d_data_mutex);
return d_tags;
}
+
+ void
+ @NAME_IMPL@::reset()
+ {
+ gr::thread::scoped_lock guard(d_data_mutex);
+ d_tags.clear();
+ d_data.clear();
+ }
+
int
@NAME_IMPL@::work(int noutput_items,
gr_vector_const_void_star &input_items,
@@ -71,6 +83,9 @@ namespace gr {
{
@TYPE@ *iptr = (@TYPE@*)input_items[0];
+ // can't touch this (as long as work() is working, the accessors shall not
+ // read the data
+ gr::thread::scoped_lock guard(d_data_mutex);
for(int i = 0; i < noutput_items * d_vlen; i++)
d_data.push_back (iptr[i]);
std::vector<tag_t> tags;
diff --git a/gr-blocks/lib/vector_sink_X_impl.h.t b/gr-blocks/lib/vector_sink_X_impl.h.t
index 86f0e8773c..bf4811dfde 100644
--- a/gr-blocks/lib/vector_sink_X_impl.h.t
+++ b/gr-blocks/lib/vector_sink_X_impl.h.t
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2008,2009,2013 Free Software Foundation, Inc.
+ * Copyright 2004,2008,2009,2013,2017 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -26,6 +26,7 @@
#define @GUARD_NAME_IMPL@
#include <gnuradio/blocks/@NAME@.h>
+#include <gnuradio/thread/thread.h>
namespace gr {
namespace blocks {
@@ -35,13 +36,14 @@ namespace gr {
private:
std::vector<@TYPE@> d_data;
std::vector<tag_t> d_tags;
+ mutable gr::thread::mutex d_data_mutex; // protects internal data access.
int d_vlen;
public:
@NAME_IMPL@(int vlen);
~@NAME_IMPL@();
- void reset() { d_data.clear(); d_tags.clear(); }
+ void reset();
std::vector<@TYPE@> data() const;
std::vector<tag_t> tags() const;
diff --git a/gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.cc b/gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.cc
index 06a1f12c3e..b2b529c0a5 100644
--- a/gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.cc
+++ b/gr-dtv/lib/catv/catv_reed_solomon_enc_bb_impl.cc
@@ -116,7 +116,7 @@ namespace gr {
output[i] = message[i];
}
- output[127] = gf_poly_eval(output, 128, gf_exp[6]);
+ output[127] = gf_poly_eval(output, 127, gf_exp[6]);
}
void
diff --git a/gr-qtgui/grc/qtgui_time_sink_x.xml b/gr-qtgui/grc/qtgui_time_sink_x.xml
index 505b61736f..d4347950ea 100644
--- a/gr-qtgui/grc/qtgui_time_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_time_sink_x.xml
@@ -931,6 +931,8 @@ $(gui_hint()($win))</make>
<hide>#if ((int($nconnections()) >= 10 or ($type() == "complex" and int($nconnections()) >= 5)) and not $type.t == "message") then 'part' else 'all'#</hide>
</param>
+ <check>$nconnections &lt;= #if $type() == "complex" then 5 else 10#</check>
+
<sink>
<name>in</name>
<type>$type.t</type>
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
index 51a1989a9a..e1e8482369 100644
--- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc
+++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
@@ -170,8 +170,14 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots, QWidget* parent)
colors << QColor(Qt::blue) << QColor(Qt::red) << QColor(Qt::green)
<< QColor(Qt::black) << QColor(Qt::cyan) << QColor(Qt::magenta)
<< QColor(Qt::yellow) << QColor(Qt::gray) << QColor(Qt::darkRed)
+ << QColor(Qt::darkGreen) << QColor(Qt::darkBlue) << QColor(Qt::darkGray)
+ // cycle through all colors again to increase time_sink_f input limit
+ // from 12 to 24, otherwise you get a segfault
+ << QColor(Qt::blue) << QColor(Qt::red) << QColor(Qt::green)
+ << QColor(Qt::black) << QColor(Qt::cyan) << QColor(Qt::magenta)
+ << QColor(Qt::yellow) << QColor(Qt::gray) << QColor(Qt::darkRed)
<< QColor(Qt::darkGreen) << QColor(Qt::darkBlue) << QColor(Qt::darkGray);
-
+
// Setup dataPoints and plot vectors
// Automatically deleted when parent is deleted
for(int i = 0; i < d_nplots; i++) {
diff --git a/gr-qtgui/lib/time_sink_c_impl.cc b/gr-qtgui/lib/time_sink_c_impl.cc
index a6b1afc3f9..b23a5468fc 100644
--- a/gr-qtgui/lib/time_sink_c_impl.cc
+++ b/gr-qtgui/lib/time_sink_c_impl.cc
@@ -55,6 +55,9 @@ namespace gr {
d_size(size), d_buffer_size(2*size), d_samp_rate(samp_rate), d_name(name),
d_nconnections(2*nconnections), d_parent(parent)
{
+ if(nconnections > 12)
+ throw std::runtime_error("time_sink_c only supports up to 12 inputs");
+
// Required now for Qt; argc must be greater than 0 and argv
// must have at least one valid character. Must be valid through
// life of the qApplication:
diff --git a/gr-qtgui/lib/time_sink_f_impl.cc b/gr-qtgui/lib/time_sink_f_impl.cc
index 2b3527702d..2b39b5536c 100644
--- a/gr-qtgui/lib/time_sink_f_impl.cc
+++ b/gr-qtgui/lib/time_sink_f_impl.cc
@@ -57,6 +57,9 @@ namespace gr {
d_size(size), d_buffer_size(2*size), d_samp_rate(samp_rate), d_name(name),
d_nconnections(nconnections), d_parent(parent)
{
+ if(nconnections > 24)
+ throw std::runtime_error("time_sink_f only supports up to 24 inputs");
+
// Required now for Qt; argc must be greater than 0 and argv
// must have at least one valid character. Must be valid through
// life of the qApplication:
diff --git a/gr-uhd/grc/gen_uhd_usrp_blocks.py b/gr-uhd/grc/gen_uhd_usrp_blocks.py
index 8d16c4e936..1bba490a23 100644
--- a/gr-uhd/grc/gen_uhd_usrp_blocks.py
+++ b/gr-uhd/grc/gen_uhd_usrp_blocks.py
@@ -517,6 +517,10 @@ PARAMS_TMPL = """ <param>
<name>RX2</name>
<key>RX2</key>
</option>
+ <option>
+ <name>RX1</name>
+ <key>RX1</key>
+ </option>
#end if
<tab>RF Options</tab>
</param>