summaryrefslogtreecommitdiff
path: root/gr-qtgui/lib/HistogramDisplayPlot.cc
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2015-10-27 14:53:04 -0400
committerTom Rondeau <tom@trondeau.com>2015-10-29 16:21:03 -0400
commiteadb401e3d630f7b0e2e103f2323b4cce6d2f8fb (patch)
treec0dc8b5a5d7af45c04fc99c1c9e5dc926498351c /gr-qtgui/lib/HistogramDisplayPlot.cc
parentbea941449edcb709f02f95c9f7cf1a47cd9d2ae8 (diff)
qtgui: histogram plotter supports PDU message plotting.
Diffstat (limited to 'gr-qtgui/lib/HistogramDisplayPlot.cc')
-rw-r--r--gr-qtgui/lib/HistogramDisplayPlot.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/gr-qtgui/lib/HistogramDisplayPlot.cc b/gr-qtgui/lib/HistogramDisplayPlot.cc
index 0124cc73f2..9b24295a8a 100644
--- a/gr-qtgui/lib/HistogramDisplayPlot.cc
+++ b/gr-qtgui/lib/HistogramDisplayPlot.cc
@@ -228,16 +228,17 @@ HistogramDisplayPlot::plotNewData(const std::vector<double*> dataPoints,
// If autoscalex has been clicked, clear the data for the new
// bin widths and reset the x-axis.
if(d_autoscalex_state) {
- for(int n = 0; n < d_nplots; n++)
- memset(d_ydata[n], 0, d_bins*sizeof(double));
+ clear();
_resetXAxisPoints(d_xmin, d_xmax);
d_autoscalex_state = false;
}
+ if(!d_accum) {
+ clear();
+ }
+
int index;
for(int n = 0; n < d_nplots; n++) {
- if(!d_accum)
- memset(d_ydata[n], 0, d_bins*sizeof(double));
for(int64_t point = 0; point < numDataPoints; point++) {
index = boost::math::iround(1e-20 + (dataPoints[n][point] - d_left)/d_width);
if((index >= 0) && (index < d_bins))
@@ -481,4 +482,15 @@ HistogramDisplayPlot::setNumBins(int bins)
}
}
+
+void
+HistogramDisplayPlot::clear()
+{
+ if(!d_stop) {
+ for(int n = 0; n < d_nplots; n++) {
+ memset(d_ydata[n], 0, d_bins*sizeof(double));
+ }
+ }
+}
+
#endif /* HISTOGRAM_DISPLAY_PLOT_C */