diff options
Diffstat (limited to 'gr-qtgui/lib/FrequencyDisplayPlot.cc')
-rw-r--r-- | gr-qtgui/lib/FrequencyDisplayPlot.cc | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.cc b/gr-qtgui/lib/FrequencyDisplayPlot.cc index 8005be191b..2c7f3eff2e 100644 --- a/gr-qtgui/lib/FrequencyDisplayPlot.cc +++ b/gr-qtgui/lib/FrequencyDisplayPlot.cc @@ -27,16 +27,9 @@ #include <gnuradio/qtgui/qtgui_types.h> #include <qwt_scale_draw.h> -#include <qwt_legend.h> #include <QColor> #include <iostream> -#if QWT_VERSION < 0x060100 -#include <qwt_legend_item.h> -#else /* QWT_VERSION < 0x060100 */ -#include <qwt_legend_data.h> -#include <qwt_legend_label.h> -#endif /* QWT_VERSION < 0x060100 */ /*********************************************************************** * Widget to provide mouse pointer coordinate text @@ -95,6 +88,7 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(int nplots, QWidget* parent) d_max_fft_data = new double[d_numPoints]; d_xdata = new double[d_numPoints]; d_half_freq = false; + d_autoscale_shot = false; setAxisTitle(QwtPlot::xBottom, "Frequency (Hz)"); setAxisScaleDraw(QwtPlot::xBottom, new FreqDisplayScaleDraw(0)); @@ -222,19 +216,25 @@ FrequencyDisplayPlot::FrequencyDisplayPlot(int nplots, QWidget* parent) // Turn off min/max hold plots in legend #if QWT_VERSION < 0x060100 QWidget *w; - QwtLegend* legendDisplay = legend(); - w = legendDisplay->find(d_min_fft_plot_curve); + d_legend = legend(); + w = legend()->find(d_min_fft_plot_curve); ((QwtLegendItem*)w)->setChecked(true); - w = legendDisplay->find(d_max_fft_plot_curve); + w = legend()->find(d_max_fft_plot_curve); ((QwtLegendItem*)w)->setChecked(true); + legend()->setVisible(false); #else /* QWT_VERSION < 0x060100 */ QWidget *w; w = ((QwtLegend*)legend())->legendWidget(itemToInfo(d_min_fft_plot_curve)); ((QwtLegendLabel*)w)->setChecked(true); + ((QwtLegendLabel*)w)->setVisible(false); + w = ((QwtLegend*)legend())->legendWidget(itemToInfo(d_max_fft_plot_curve)); ((QwtLegendLabel*)w)->setChecked(true); + ((QwtLegendLabel*)w)->setVisible(false); + #endif /* QWT_VERSION < 0x060100 */ + replot(); } @@ -412,8 +412,13 @@ FrequencyDisplayPlot::plotNewData(const std::vector<double*> dataPoints, } } - if(d_autoscale_state) + if(d_autoscale_state) { _autoScale(bottom, top); + if(d_autoscale_shot) { + d_autoscale_state = false; + d_autoscale_shot = false; + } + } d_noise_floor_amplitude = noiseFloorAmplitude; d_peak_frequency = peakFrequency; @@ -470,6 +475,13 @@ FrequencyDisplayPlot::setAutoScale(bool state) } void +FrequencyDisplayPlot::setAutoScaleShot() +{ + d_autoscale_state = true; + d_autoscale_shot = true; +} + +void FrequencyDisplayPlot::setPlotPosHalf(bool half) { d_half_freq = half; |