diff options
author | Tom Rondeau <tom@trondeau.com> | 2015-10-28 12:21:51 -0400 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2015-10-29 16:21:04 -0400 |
commit | 2a59946b26d5bcadc0aa66879870f49511816086 (patch) | |
tree | 0823bdd61e81eb9b85a03c57920a4fe265e55906 /gr-qtgui/lib/histogram_sink_f_impl.cc | |
parent | e3e79e2762468c5c5e679544eae59c68271492dd (diff) |
qtgui: moving to only allow either streaming or message modes.
Having both stream and message ports available at the same time will
likely cause confusion and problems when trying to plot both.
Hides some parameters that have no effect on the operation of the sink
in this mode.
Also: histogram fixed to support accumulate in message mode.
Diffstat (limited to 'gr-qtgui/lib/histogram_sink_f_impl.cc')
-rw-r--r-- | gr-qtgui/lib/histogram_sink_f_impl.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gr-qtgui/lib/histogram_sink_f_impl.cc b/gr-qtgui/lib/histogram_sink_f_impl.cc index 7569c6ae83..0ac494d751 100644 --- a/gr-qtgui/lib/histogram_sink_f_impl.cc +++ b/gr-qtgui/lib/histogram_sink_f_impl.cc @@ -70,8 +70,8 @@ namespace gr { d_index = 0; // setup PDU handling input port - message_port_register_in(pmt::mp("pdus")); - set_msg_handler(pmt::mp("pdus"), + message_port_register_in(pmt::mp("in")); + set_msg_handler(pmt::mp("in"), boost::bind(&histogram_sink_f_impl::handle_pdus, this, _1)); // +1 for the PDU buffer @@ -477,10 +477,12 @@ namespace gr { npoints_resize(); // Clear the histogram - d_qApplication->postEvent(d_main_gui, new HistogramClearEvent()); + if(!d_main_gui->getAccumulate()) { + d_qApplication->postEvent(d_main_gui, new HistogramClearEvent()); - // Set to accumulate over length of the current PDU - d_qApplication->postEvent(d_main_gui, new HistogramSetAccumulator(true)); + // Set to accumulate over length of the current PDU + d_qApplication->postEvent(d_main_gui, new HistogramSetAccumulator(true)); + } float nplots_f = static_cast<float>(len) / static_cast<float>(d_size); int nplots = static_cast<int>(ceilf(nplots_f)); @@ -495,8 +497,10 @@ namespace gr { idx += size; } - // Turn accumulation off - d_qApplication->postEvent(d_main_gui, new HistogramSetAccumulator(false)); + if(!d_main_gui->getAccumulate()) { + // Turn accumulation off + d_qApplication->postEvent(d_main_gui, new HistogramSetAccumulator(false)); + } } } |