[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 02/05: qtgui: fixes issue #767.
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 02/05: qtgui: fixes issue #767. |
Date: |
Sun, 29 Mar 2015 01:19:01 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit fce06576a937bf16f12b012e2739e07ad8860f67
Author: Tom Rondeau <address@hidden>
Date: Mon Mar 23 14:36:51 2015 -0700
qtgui: fixes issue #767.
If FFT Size is set to 2048 and the half-width is selected for the
float graph type, then this would cause the x-axis display to show
-fs/2 to +fs/2 instead of the correct 0 to +fs/2. The problem was the
default numpoints was 1024, so with half 2048, the resetting of the
x-axis call was never hitting. Setting to 0 to force updates during
the first display.
Also puts protections around the allowable FFT sizes.
---
gr-qtgui/lib/FrequencyDisplayPlot.cc | 3 +--
gr-qtgui/lib/freq_sink_c_impl.cc | 5 ++++-
gr-qtgui/lib/freq_sink_f_impl.cc | 5 ++++-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.cc
b/gr-qtgui/lib/FrequencyDisplayPlot.cc
index 41050ed..384ec8d 100644
--- a/gr-qtgui/lib/FrequencyDisplayPlot.cc
+++ b/gr-qtgui/lib/FrequencyDisplayPlot.cc
@@ -90,7 +90,7 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(int nplots,
QWidget* parent)
d_start_frequency = -1;
d_stop_frequency = 1;
- d_numPoints = 1024;
+ d_numPoints = 0;
d_min_fft_data = new double[d_numPoints];
d_max_fft_data = new double[d_numPoints];
d_xdata = new double[d_numPoints];
@@ -287,7 +287,6 @@ FrequencyDisplayPlot::setFrequencyRange(const double
centerfreq,
else
startFreq = (centerfreq - bandwidth/2.0f) / units;
-
d_xdata_multiplier = units;
bool reset = false;
diff --git a/gr-qtgui/lib/freq_sink_c_impl.cc b/gr-qtgui/lib/freq_sink_c_impl.cc
index fa8e38d..adc1f76 100644
--- a/gr-qtgui/lib/freq_sink_c_impl.cc
+++ b/gr-qtgui/lib/freq_sink_c_impl.cc
@@ -198,7 +198,10 @@ namespace gr {
void
freq_sink_c_impl::set_fft_size(const int fftsize)
{
- d_main_gui->setFFTSize(fftsize);
+ if((fftsize > 16) && (fftsize < 16384))
+ d_main_gui->setFFTSize(fftsize);
+ else
+ throw std::runtime_error("freq_sink: FFT size must be > 16 and <
16384.");
}
int
diff --git a/gr-qtgui/lib/freq_sink_f_impl.cc b/gr-qtgui/lib/freq_sink_f_impl.cc
index 1df915b..1e01208 100644
--- a/gr-qtgui/lib/freq_sink_f_impl.cc
+++ b/gr-qtgui/lib/freq_sink_f_impl.cc
@@ -197,7 +197,10 @@ namespace gr {
void
freq_sink_f_impl::set_fft_size(const int fftsize)
{
- d_main_gui->setFFTSize(fftsize);
+ if((fftsize > 16) && (fftsize < 16384))
+ d_main_gui->setFFTSize(fftsize);
+ else
+ throw std::runtime_error("freq_sink: FFT size must be > 16 and <
16384.");
}
int