[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 12/16: qtgui: protect PDU handling waterfal
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 12/16: qtgui: protect PDU handling waterfall port for wrong data type. |
Date: |
Tue, 21 Jul 2015 19:27:52 +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 75e5faa73a3ec79a499cf027d68ae0b3cbb6cd6d
Author: Tom Rondeau <address@hidden>
Date: Mon Jul 20 17:30:03 2015 -0400
qtgui: protect PDU handling waterfall port for wrong data type.
---
gr-qtgui/lib/waterfall_sink_c_impl.cc | 15 +++++++++++----
gr-qtgui/lib/waterfall_sink_c_impl.h | 4 ++--
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.cc
b/gr-qtgui/lib/waterfall_sink_c_impl.cc
index 268b013..870b291 100644
--- a/gr-qtgui/lib/waterfall_sink_c_impl.cc
+++ b/gr-qtgui/lib/waterfall_sink_c_impl.cc
@@ -78,10 +78,10 @@ namespace gr {
boost::bind(&waterfall_sink_c_impl::handle_set_freq,
this, _1));
- // setup such samples pdu port
+ // setup PDU handling input port
message_port_register_in(pmt::mp("pdus"));
set_msg_handler(pmt::mp("pdus"),
- boost::bind(&waterfall_sink_c_impl::handle_such_samples,
this, _1));
+ boost::bind(&waterfall_sink_c_impl::handle_pdus, this,
_1));
d_main_gui = NULL;
@@ -553,7 +553,7 @@ namespace gr {
}
void
- waterfall_sink_c_impl::handle_such_samples(pmt::pmt_t msg)
+ waterfall_sink_c_impl::handle_pdus(pmt::pmt_t msg)
{
int j = 0;
size_t len = 0;
@@ -571,7 +571,14 @@ namespace gr {
gr::high_res_timer_type ref_start = (uint64_t)start *
(double)(1.0/d_bandwidth) * 1000000;
- const gr_complex *in = (const gr_complex*)
pmt::c32vector_elements(samples, len);
+ const gr_complex *in;
+ if(pmt::is_c32vector(samples)) {
+ in = (const gr_complex*)pmt::c32vector_elements(samples, len);
+ }
+ else {
+ throw std::runtime_error("waterfall sink: unknown data type of
samples; must be complex.");
+ }
+
int stride = (len - d_fftsize)/199;
set_time_per_fft(1.0/d_bandwidth * stride);
diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.h
b/gr-qtgui/lib/waterfall_sink_c_impl.h
index c243799..5251dfc 100644
--- a/gr-qtgui/lib/waterfall_sink_c_impl.h
+++ b/gr-qtgui/lib/waterfall_sink_c_impl.h
@@ -75,8 +75,8 @@ namespace gr {
// The message is a PMT pair (intern('freq'), double(frequency)).
void handle_set_freq(pmt::pmt_t msg);
- // Handles message input port for displaying such samples pdus.
- void handle_such_samples(pmt::pmt_t msg);
+ // Handles message input port for displaying PDU samples.
+ void handle_pdus(pmt::pmt_t msg);
public:
waterfall_sink_c_impl(int size, int wintype,
- [Commit-gnuradio] [gnuradio] branch master updated (55d8f48 -> cc973de), git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 05/16: fec: extended encoder now appends unpack_k_bits(8) block after encoder to satisfy get_output_conversion() = unpack behaviour, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 02/16: fec: some initial refactoring for ber_bf, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 03/16: fec: fixed QA for ber_bf., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 04/16: fec: code clean-up for block 'ber_bf'., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 08/16: fec: added tests for extended_encoder input/output conversion., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 15/16: Merge remote-tracking branch 'fewu/crc32_unpack', git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 01/16: updates to waterfall for suchsamples, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 10/16: Merge remote-tracking branch 'namccart/master' into master_waterfall_pdu, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 07/16: digital: added an option to the crc32_bb block that adds the unpacked CRC to the bit stream, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 12/16: qtgui: protect PDU handling waterfall port for wrong data type.,
git <=
- [Commit-gnuradio] [gnuradio] 09/16: Merge remote-tracking branch 'jdemel/fec/fix-extended_encoder', git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 16/16: Merge branch 'maint', git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 11/16: qtgui: waterfall PDU handling, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 13/16: qtgui: pdu handler for float waterfall plot., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 14/16: qtgui: waterfall plots, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 06/16: digital: whitespace fixes, git, 2015/07/21