summaryrefslogtreecommitdiff
path: root/gr-qtgui/lib/TimeDomainDisplayPlot.cc
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2013-11-07 12:28:01 -0500
committerTom Rondeau <tom@trondeau.com>2013-11-07 12:28:01 -0500
commitd800bc32c3d93364e0c34ff60f01f97b64ec30f4 (patch)
tree6c8529ea67c897da8bfe4edb7deba1de95154aed /gr-qtgui/lib/TimeDomainDisplayPlot.cc
parent73d26d6c7129cf2f84ca8b37896e2ecf8c8f3973 (diff)
qtgui: improved handling of qtgui time plotting. Simpler work function. Triggering now handled better, including better delay functionality.
Diffstat (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.cc')
-rw-r--r--gr-qtgui/lib/TimeDomainDisplayPlot.cc22
1 files changed, 20 insertions, 2 deletions
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
index 052aaf8cf7..adc6baa4a9 100644
--- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc
+++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
@@ -255,6 +255,12 @@ TimeDomainDisplayPlot::plotNewData(const std::vector<double*> dataPoints,
std::vector<gr::tag_t>::const_iterator t;
for(t = tag->begin(); t != tag->end(); t++) {
uint64_t offset = (*t).offset;
+
+ // Ignore tag if its offset is outside our plottable vector.
+ if(offset >= (uint64_t)d_numPoints) {
+ continue;
+ }
+
double sample_offset = double(offset)/d_sample_rate;
std::stringstream s;
@@ -265,8 +271,20 @@ TimeDomainDisplayPlot::plotNewData(const std::vector<double*> dataPoints,
// real and imaginary parts and put the tag on that one.
int which = i;
if(cmplx) {
- if(fabs(d_ydata[i][offset]) < fabs(d_ydata[i+1][offset]))
- which = i+1;
+ bool show0 = d_plot_curve[i]->isVisible();
+ bool show1 = d_plot_curve[i+1]->isVisible();
+
+ // If we are showing both streams, select the inptu stream
+ // with the larger value
+ if(show0 && show1) {
+ if(fabs(d_ydata[i][offset]) < fabs(d_ydata[i+1][offset]))
+ which = i+1;
+ }
+ else {
+ // If show0, we keep which = i; otherwise, use i+1.
+ if(show1)
+ which = i+1;
+ }
}
double yval = d_ydata[which][offset];