[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 02/02: qtgui: fixes a problem with the numb
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 02/02: qtgui: fixes a problem with the number sink when fed NaN or +/-inf. |
Date: |
Sat, 26 Jul 2014 16:21:05 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch maint
in repository gnuradio.
commit ad3d36772d659ca1656e00bf89ecd5c02db582bc
Author: Tom Rondeau <address@hidden>
Date: Sat Jul 26 12:07:56 2014 -0400
qtgui: fixes a problem with the number sink when fed NaN or +/-inf.
Addresses issue #704.
---
gr-qtgui/lib/number_sink_impl.cc | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/gr-qtgui/lib/number_sink_impl.cc b/gr-qtgui/lib/number_sink_impl.cc
index 1be2653..2c31b60 100644
--- a/gr-qtgui/lib/number_sink_impl.cc
+++ b/gr-qtgui/lib/number_sink_impl.cc
@@ -296,7 +296,8 @@ namespace gr {
for(int n = 0; n < d_nconnections; n++) {
float *in = (float*)input_items[n];
for(int i = 0; i < noutput_items; i++) {
- d_avg_value[n] = d_iir[n].filter(in[i]);
+ if(std::isfinite(in[i]))
+ d_avg_value[n] = d_iir[n].filter(in[i]);
}
}
}
@@ -310,8 +311,11 @@ namespace gr {
d[n] = d_avg_value[n];
}
else {
- for(int n = 0; n < d_nconnections; n++)
- d[n] = ((float*)input_items[n])[0];
+ for(int n = 0; n < d_nconnections; n++) {
+ float x = ((float*)input_items[n])[0];
+ if(std::isfinite(x))
+ d[n] = x;
+ }
}
d_qApplication->postEvent(d_main_gui,
new NumberUpdateEvent(d));