diff options
Diffstat (limited to 'gr-qtgui/lib')
54 files changed, 54 insertions, 3490 deletions
diff --git a/gr-qtgui/lib/CMakeLists.txt b/gr-qtgui/lib/CMakeLists.txt index ff1e64ce31..fb58c8e097 100644 --- a/gr-qtgui/lib/CMakeLists.txt +++ b/gr-qtgui/lib/CMakeLists.txt @@ -20,21 +20,22 @@ ######################################################################## # Setup the QT file generations stuff ######################################################################## +set(qtgui_mod_includedir ${CMAKE_CURRENT_SOURCE_DIR}/../include/qtgui) set(qtgui_moc_hdrs - spectrumdisplayform.h - displayform.h - timedisplayform.h - timerasterdisplayform.h - freqdisplayform.h - constellationdisplayform.h - waterfalldisplayform.h - form_menus.h - DisplayPlot.h - FrequencyDisplayPlot.h - TimeDomainDisplayPlot.h - TimeRasterDisplayPlot.h - WaterfallDisplayPlot.h - ConstellationDisplayPlot.h + ${qtgui_mod_includedir}/spectrumdisplayform.h + ${qtgui_mod_includedir}/displayform.h + ${qtgui_mod_includedir}/timedisplayform.h + ${qtgui_mod_includedir}/timerasterdisplayform.h + ${qtgui_mod_includedir}/freqdisplayform.h + ${qtgui_mod_includedir}/constellationdisplayform.h + ${qtgui_mod_includedir}/waterfalldisplayform.h + ${qtgui_mod_includedir}/form_menus.h + ${qtgui_mod_includedir}/DisplayPlot.h + ${qtgui_mod_includedir}/FrequencyDisplayPlot.h + ${qtgui_mod_includedir}/TimeDomainDisplayPlot.h + ${qtgui_mod_includedir}/TimeRasterDisplayPlot.h + ${qtgui_mod_includedir}/WaterfallDisplayPlot.h + ${qtgui_mod_includedir}/ConstellationDisplayPlot.h ) QT4_WRAP_CPP(qtgui_moc_srcs ${qtgui_moc_hdrs}) QT4_WRAP_UI(qtgui_ui_hdrs spectrumdisplayform.ui) @@ -147,31 +148,3 @@ add_definitions(-DQWT_DLL) #setup QWT library linkage add_library(gnuradio-qtgui SHARED ${qtgui_srcs}) target_link_libraries(gnuradio-qtgui ${qtgui_libs}) GR_LIBRARY_FOO(gnuradio-qtgui RUNTIME_COMPONENT "qtgui_runtime" DEVEL_COMPONENT "qtgui_devel") - -######################################################################## -# Install the header files -######################################################################## -install(FILES - DisplayPlot.h - FrequencyDisplayPlot.h - TimeDomainDisplayPlot.h - TimeRasterDisplayPlot.h - timeRasterGlobalData.h - WaterfallDisplayPlot.h - waterfallGlobalData.h - ConstellationDisplayPlot.h - plot_waterfall.h - plot_raster.h - spectrumdisplayform.h - displayform.h - timedisplayform.h - timerasterdisplayform.h - freqdisplayform.h - constellationdisplayform.h - waterfalldisplayform.h - form_menus.h - SpectrumGUIClass.h - spectrumUpdateEvents.h - DESTINATION ${GR_INCLUDE_DIR}/gnuradio - COMPONENT "qtgui_devel" -) diff --git a/gr-qtgui/lib/ConstellationDisplayPlot.cc b/gr-qtgui/lib/ConstellationDisplayPlot.cc index f3951534a9..7e2f11e6d6 100644 --- a/gr-qtgui/lib/ConstellationDisplayPlot.cc +++ b/gr-qtgui/lib/ConstellationDisplayPlot.cc @@ -23,7 +23,7 @@ #ifndef CONSTELLATION_DISPLAY_PLOT_C #define CONSTELLATION_DISPLAY_PLOT_C -#include <ConstellationDisplayPlot.h> +#include <qtgui/ConstellationDisplayPlot.h> #include <qwt_scale_draw.h> #include <qwt_legend.h> diff --git a/gr-qtgui/lib/ConstellationDisplayPlot.h b/gr-qtgui/lib/ConstellationDisplayPlot.h deleted file mode 100644 index b68b01f6d8..0000000000 --- a/gr-qtgui/lib/ConstellationDisplayPlot.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008-2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef CONSTELLATION_DISPLAY_PLOT_H -#define CONSTELLATION_DISPLAY_PLOT_H - -#include <stdint.h> -#include <cstdio> -#include <vector> -#include "DisplayPlot.h" - -class ConstellationDisplayPlot : public DisplayPlot -{ - Q_OBJECT - -public: - ConstellationDisplayPlot(int nplots, QWidget*); - virtual ~ConstellationDisplayPlot(); - - void plotNewData(const std::vector<double*> realDataPoints, - const std::vector<double*> imagDataPoints, - const int64_t numDataPoints, - const double timeInterval); - - // Old method to be removed - void plotNewData(const double* realDataPoints, - const double* imagDataPoints, - const int64_t numDataPoints, - const double timeInterval); - - void replot(); - - void set_xaxis(double min, double max); - void set_yaxis(double min, double max); - void set_axis(double xmin, double xmax, - double ymin, double ymax); - void set_pen_size(int size); - -public slots: - void setAutoScale(bool state); - -private: - void _autoScale(double bottom, double top); - - std::vector<double*> _realDataPoints; - std::vector<double*> _imagDataPoints; - - int64_t _penSize; -}; - -#endif /* CONSTELLATION_DISPLAY_PLOT_H */ diff --git a/gr-qtgui/lib/DisplayPlot.cc b/gr-qtgui/lib/DisplayPlot.cc index 1c9de3d0ae..227cf9cc9e 100644 --- a/gr-qtgui/lib/DisplayPlot.cc +++ b/gr-qtgui/lib/DisplayPlot.cc @@ -20,7 +20,7 @@ * Boston, MA 02110-1301, USA. */ -#include <DisplayPlot.h> +#include <qtgui/DisplayPlot.h> #include <qwt_scale_draw.h> #include <qwt_legend.h> diff --git a/gr-qtgui/lib/DisplayPlot.h b/gr-qtgui/lib/DisplayPlot.h deleted file mode 100644 index d9ee16e087..0000000000 --- a/gr-qtgui/lib/DisplayPlot.h +++ /dev/null @@ -1,287 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008-2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef DOMAIN_DISPLAY_PLOT_H -#define DOMAIN_DISPLAY_PLOT_H - -#include <stdint.h> -#include <cstdio> -#include <vector> -#include <qwt_plot.h> -#include <qwt_painter.h> -#include <qwt_plot_canvas.h> -#include <qwt_plot_curve.h> -#include <qwt_scale_engine.h> -#include <qwt_scale_widget.h> -#include <qwt_plot_zoomer.h> -#include <qwt_plot_panner.h> -#include <qwt_plot_magnifier.h> -#include <qwt_plot_marker.h> -#include <qwt_symbol.h> -#include <qtgui/utils.h> - -#if QWT_VERSION >= 0x060000 -#include <qwt_compat.h> -#endif - -typedef QList<QColor> QColorList; -Q_DECLARE_METATYPE ( QColorList ) - -class DisplayPlot:public QwtPlot{ - Q_OBJECT - - Q_PROPERTY ( QColor line_color1 READ getLineColor1 WRITE setLineColor1 ) - Q_PROPERTY ( QColor line_color2 READ getLineColor2 WRITE setLineColor2 ) - Q_PROPERTY ( QColor line_color3 READ getLineColor3 WRITE setLineColor3 ) - Q_PROPERTY ( QColor line_color4 READ getLineColor4 WRITE setLineColor4 ) - Q_PROPERTY ( QColor line_color5 READ getLineColor5 WRITE setLineColor5 ) - Q_PROPERTY ( QColor line_color6 READ getLineColor6 WRITE setLineColor6 ) - Q_PROPERTY ( QColor line_color7 READ getLineColor7 WRITE setLineColor7 ) - Q_PROPERTY ( QColor line_color8 READ getLineColor8 WRITE setLineColor8 ) - Q_PROPERTY ( QColor line_color9 READ getLineColor9 WRITE setLineColor9 ) - - Q_PROPERTY ( int line_width1 READ getLineWidth1 WRITE setLineWidth1 ) - Q_PROPERTY ( int line_width2 READ getLineWidth2 WRITE setLineWidth2 ) - Q_PROPERTY ( int line_width3 READ getLineWidth3 WRITE setLineWidth3 ) - Q_PROPERTY ( int line_width4 READ getLineWidth4 WRITE setLineWidth4 ) - Q_PROPERTY ( int line_width5 READ getLineWidth5 WRITE setLineWidth5 ) - Q_PROPERTY ( int line_width6 READ getLineWidth6 WRITE setLineWidth6 ) - Q_PROPERTY ( int line_width7 READ getLineWidth7 WRITE setLineWidth7 ) - Q_PROPERTY ( int line_width8 READ getLineWidth8 WRITE setLineWidth8 ) - Q_PROPERTY ( int line_width9 READ getLineWidth9 WRITE setLineWidth9 ) - - Q_PROPERTY ( Qt::PenStyle line_style1 READ getLineStyle1 WRITE setLineStyle1 ) - Q_PROPERTY ( Qt::PenStyle line_style2 READ getLineStyle2 WRITE setLineStyle2 ) - Q_PROPERTY ( Qt::PenStyle line_style3 READ getLineStyle3 WRITE setLineStyle3 ) - Q_PROPERTY ( Qt::PenStyle line_style4 READ getLineStyle4 WRITE setLineStyle4 ) - Q_PROPERTY ( Qt::PenStyle line_style5 READ getLineStyle5 WRITE setLineStyle5 ) - Q_PROPERTY ( Qt::PenStyle line_style6 READ getLineStyle6 WRITE setLineStyle6 ) - Q_PROPERTY ( Qt::PenStyle line_style7 READ getLineStyle7 WRITE setLineStyle7 ) - Q_PROPERTY ( Qt::PenStyle line_style8 READ getLineStyle8 WRITE setLineStyle8 ) - Q_PROPERTY ( Qt::PenStyle line_style9 READ getLineStyle9 WRITE setLineStyle9 ) - - typedef QwtSymbol::Style QwtSymbolStyle; - - Q_ENUMS ( QwtSymbolStyle ) - Q_PROPERTY ( QwtSymbolStyle line_marker1 READ getLineMarker1 WRITE setLineMarker1 ) - Q_PROPERTY ( QwtSymbolStyle line_marker2 READ getLineMarker2 WRITE setLineMarker2 ) - Q_PROPERTY ( QwtSymbolStyle line_marker3 READ getLineMarker3 WRITE setLineMarker3 ) - Q_PROPERTY ( QwtSymbolStyle line_marker4 READ getLineMarker4 WRITE setLineMarker4 ) - Q_PROPERTY ( QwtSymbolStyle line_marker5 READ getLineMarker5 WRITE setLineMarker5 ) - Q_PROPERTY ( QwtSymbolStyle line_marker6 READ getLineMarker6 WRITE setLineMarker6 ) - Q_PROPERTY ( QwtSymbolStyle line_marker7 READ getLineMarker7 WRITE setLineMarker7 ) - Q_PROPERTY ( QwtSymbolStyle line_marker8 READ getLineMarker8 WRITE setLineMarker8 ) - Q_PROPERTY ( QwtSymbolStyle line_marker9 READ getLineMarker9 WRITE setLineMarker9 ) - - Q_PROPERTY ( int marker_alpha1 READ getMarkerAlpha1 WRITE setMarkerAlpha1 ) - Q_PROPERTY ( int marker_alpha2 READ getMarkerAlpha2 WRITE setMarkerAlpha2 ) - Q_PROPERTY ( int marker_alpha3 READ getMarkerAlpha3 WRITE setMarkerAlpha3 ) - Q_PROPERTY ( int marker_alpha4 READ getMarkerAlpha4 WRITE setMarkerAlpha4 ) - Q_PROPERTY ( int marker_alpha5 READ getMarkerAlpha5 WRITE setMarkerAlpha5 ) - Q_PROPERTY ( int marker_alpha6 READ getMarkerAlpha6 WRITE setMarkerAlpha6 ) - Q_PROPERTY ( int marker_alpha7 READ getMarkerAlpha7 WRITE setMarkerAlpha7 ) - Q_PROPERTY ( int marker_alpha8 READ getMarkerAlpha8 WRITE setMarkerAlpha8 ) - Q_PROPERTY ( int marker_alpha9 READ getMarkerAlpha9 WRITE setMarkerAlpha9 ) - - Q_PROPERTY ( QColor zoomer_color READ getZoomerColor WRITE setZoomerColor ) - Q_PROPERTY ( QColor palette_color READ getPaletteColor WRITE setPaletteColor ) - Q_PROPERTY ( int yaxis_label_font_size READ getYaxisLabelFontSize WRITE setYaxisLabelFontSize ) - Q_PROPERTY ( int xaxis_label_font_size READ getXaxisLabelFontSize WRITE setXaxisLabelFontSize ) - Q_PROPERTY ( int axes_label_font_size READ getAxesLabelFontSize WRITE setAxesLabelFontSize ) - -public: - DisplayPlot(int nplots, QWidget*); - virtual ~DisplayPlot(); - - virtual void replot() = 0; - - const QColor getLineColor1 () const; - const QColor getLineColor2 () const; - const QColor getLineColor3 () const; - const QColor getLineColor4 () const; - const QColor getLineColor5 () const; - const QColor getLineColor6 () const; - const QColor getLineColor7 () const; - const QColor getLineColor8 () const; - const QColor getLineColor9 () const; - - int getLineWidth1 () const; - int getLineWidth2 () const; - int getLineWidth3 () const; - int getLineWidth4 () const; - int getLineWidth5 () const; - int getLineWidth6 () const; - int getLineWidth7 () const; - int getLineWidth8 () const; - int getLineWidth9 () const; - - const Qt::PenStyle getLineStyle1 () const; - const Qt::PenStyle getLineStyle2 () const; - const Qt::PenStyle getLineStyle3 () const; - const Qt::PenStyle getLineStyle4 () const; - const Qt::PenStyle getLineStyle5 () const; - const Qt::PenStyle getLineStyle6 () const; - const Qt::PenStyle getLineStyle7 () const; - const Qt::PenStyle getLineStyle8 () const; - const Qt::PenStyle getLineStyle9 () const; - - const QwtSymbol::Style getLineMarker1 () const; - const QwtSymbol::Style getLineMarker2 () const; - const QwtSymbol::Style getLineMarker3 () const; - const QwtSymbol::Style getLineMarker4 () const; - const QwtSymbol::Style getLineMarker5 () const; - const QwtSymbol::Style getLineMarker6 () const; - const QwtSymbol::Style getLineMarker7 () const; - const QwtSymbol::Style getLineMarker8 () const; - const QwtSymbol::Style getLineMarker9 () const; - - int getMarkerAlpha1 () const; - int getMarkerAlpha2 () const; - int getMarkerAlpha3 () const; - int getMarkerAlpha4 () const; - int getMarkerAlpha5 () const; - int getMarkerAlpha6 () const; - int getMarkerAlpha7 () const; - int getMarkerAlpha8 () const; - int getMarkerAlpha9 () const; - - QColor getZoomerColor() const; - QColor getPaletteColor() const; - int getAxisLabelFontSize(int axisId) const; - int getYaxisLabelFontSize() const; - int getXaxisLabelFontSize() const; - int getAxesLabelFontSize() const; - - // Make sure to create your won PlotNewData method in the derived - // class: - // void PlotNewData(...); - -public slots: - void setYaxis(double min, double max); - void setXaxis(double min, double max); - void setLineLabel(int which, QString label); - QString getLineLabel(int which); - void setLineColor(int which, QColor color); - QColor getLineColor(int which) const; - void setLineWidth(int which, int width); - int getLineWidth(int which) const; - void setLineStyle(int which, Qt::PenStyle style); - const Qt::PenStyle getLineStyle(int which) const; - void setLineMarker(int which, QwtSymbol::Style marker); - const QwtSymbol::Style getLineMarker(int which) const; - void setMarkerAlpha(int which, int alpha); - int getMarkerAlpha(int which) const; - // Need a function for each curve for setting via stylesheet. - // Can't use preprocessor directives because we're inside a Q_OBJECT. - void setLineColor1 (QColor); - void setLineColor2 (QColor); - void setLineColor3 (QColor); - void setLineColor4 (QColor); - void setLineColor5 (QColor); - void setLineColor6 (QColor); - void setLineColor7 (QColor); - void setLineColor8 (QColor); - void setLineColor9 (QColor); - - void setLineWidth1 (int); - void setLineWidth2 (int); - void setLineWidth3 (int); - void setLineWidth4 (int); - void setLineWidth5 (int); - void setLineWidth6 (int); - void setLineWidth7 (int); - void setLineWidth8 (int); - void setLineWidth9 (int); - - void setLineStyle1 (Qt::PenStyle); - void setLineStyle2 (Qt::PenStyle); - void setLineStyle3 (Qt::PenStyle); - void setLineStyle4 (Qt::PenStyle); - void setLineStyle5 (Qt::PenStyle); - void setLineStyle6 (Qt::PenStyle); - void setLineStyle7 (Qt::PenStyle); - void setLineStyle8 (Qt::PenStyle); - void setLineStyle9 (Qt::PenStyle); - - void setLineMarker1 (QwtSymbol::Style); - void setLineMarker2 (QwtSymbol::Style); - void setLineMarker3 (QwtSymbol::Style); - void setLineMarker4 (QwtSymbol::Style); - void setLineMarker5 (QwtSymbol::Style); - void setLineMarker6 (QwtSymbol::Style); - void setLineMarker7 (QwtSymbol::Style); - void setLineMarker8 (QwtSymbol::Style); - void setLineMarker9 (QwtSymbol::Style); - - void setMarkerAlpha1 (int); - void setMarkerAlpha2 (int); - void setMarkerAlpha3 (int); - void setMarkerAlpha4 (int); - void setMarkerAlpha5 (int); - void setMarkerAlpha6 (int); - void setMarkerAlpha7 (int); - void setMarkerAlpha8 (int); - void setMarkerAlpha9 (int); - - void setZoomerColor(QColor c); - void setPaletteColor(QColor c); - void setAxisLabelFontSize(int axisId, int fs); - void setYaxisLabelFontSize(int fs); - void setXaxisLabelFontSize(int fs); - void setAxesLabelFontSize(int fs); - - void setStop(bool on); - - void resizeSlot(QSize *s); - - // Because of the preprocessing of slots in QT, these are not - // easily separated by the version check. Make one for each - // version until it's worked out. - void onPickerPointSelected(const QwtDoublePoint & p); - void onPickerPointSelected6(const QPointF & p); - -signals: - void plotPointSelected(const QPointF p); - -protected slots: - void legendEntryChecked(QwtPlotItem *plotItem, bool on); - -protected: - int _nplots; - std::vector<QwtPlotCurve*> _plot_curve; - - QwtPlotPanner* _panner; - QwtPlotZoomer* _zoomer; - - QwtDblClickPlotPicker *_picker; - QwtPlotMagnifier *_magnifier; - - int64_t _numPoints; - - bool _stop; - - QList<QColor> _trace_colors; - - bool _autoscale_state; -}; - -#endif /* DOMAIN_DISPLAY_PLOT_H */ diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.cc b/gr-qtgui/lib/FrequencyDisplayPlot.cc index e279155544..56e63100c7 100644 --- a/gr-qtgui/lib/FrequencyDisplayPlot.cc +++ b/gr-qtgui/lib/FrequencyDisplayPlot.cc @@ -23,9 +23,9 @@ #ifndef FREQUENCY_DISPLAY_PLOT_C #define FREQUENCY_DISPLAY_PLOT_C -#include <FrequencyDisplayPlot.h> +#include <qtgui/FrequencyDisplayPlot.h> -#include "qtgui_types.h" +#include <qtgui/qtgui_types.h> #include <qwt_scale_draw.h> #include <qwt_legend.h> #include <qwt_legend_item.h> diff --git a/gr-qtgui/lib/FrequencyDisplayPlot.h b/gr-qtgui/lib/FrequencyDisplayPlot.h deleted file mode 100644 index 22d2be0055..0000000000 --- a/gr-qtgui/lib/FrequencyDisplayPlot.h +++ /dev/null @@ -1,160 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008-2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef FREQUENCY_DISPLAY_PLOT_HPP -#define FREQUENCY_DISPLAY_PLOT_HPP - -#include <stdint.h> -#include <cstdio> -#include <vector> -#include "DisplayPlot.h" - -class FrequencyDisplayPlot: public DisplayPlot -{ - Q_OBJECT - - Q_PROPERTY ( QColor min_fft_color READ getMinFFTColor WRITE setMinFFTColor ) - Q_PROPERTY ( QColor max_fft_color READ getMaxFFTColor WRITE setMaxFFTColor ) - Q_PROPERTY ( bool min_fft_visible READ getMinFFTVisible WRITE setMinFFTVisible ) - Q_PROPERTY ( bool max_fft_visible READ getMaxFFTVisible WRITE setMaxFFTVisible ) - Q_PROPERTY ( QColor marker_lower_intensity_color READ getMarkerLowerIntensityColor WRITE setMarkerLowerIntensityColor ) - Q_PROPERTY ( bool marker_lower_intensity_visible READ getMarkerLowerIntensityVisible WRITE setMarkerLowerIntensityVisible ) - Q_PROPERTY ( QColor marker_upper_intensity_color READ getMarkerUpperIntensityColor WRITE setMarkerUpperIntensityColor ) - Q_PROPERTY ( bool marker_upper_intensity_visible READ getMarkerUpperIntensityVisible WRITE setMarkerUpperIntensityVisible ) - Q_PROPERTY ( QColor marker_peak_amplitude_color READ getMarkerPeakAmplitudeColor WRITE setMarkerPeakAmplitudeColor ) - Q_PROPERTY ( QColor marker_noise_floor_amplitude_color READ getMarkerNoiseFloorAmplitudeColor WRITE setMarkerNoiseFloorAmplitudeColor ) - Q_PROPERTY ( bool marker_noise_floor_amplitude_visible READ getMarkerNoiseFloorAmplitudeVisible WRITE setMarkerNoiseFloorAmplitudeVisible ) - Q_PROPERTY ( QColor marker_CF_color READ getMarkerCFColor WRITE setMarkerCFColor ) - -public: - FrequencyDisplayPlot(int nplots, QWidget*); - virtual ~FrequencyDisplayPlot(); - - void setFrequencyRange(const double, const double, - const double units=1000.0, - const std::string &strunits = "kHz"); - double getStartFrequency()const; - double getStopFrequency()const; - - void plotNewData(const std::vector<double*> dataPoints, - const int64_t numDataPoints, - const double noiseFloorAmplitude, const double peakFrequency, - const double peakAmplitude, const double timeInterval); - - // Old method to be removed - void plotNewData(const double* dataPoints, - const int64_t numDataPoints, - const double noiseFloorAmplitude, const double peakFrequency, - const double peakAmplitude, const double timeInterval); - - void clearMaxData(); - void clearMinData(); - - void replot(); - - void setYaxis(double min, double max); - - void setTraceColour (QColor); - void setBGColour (QColor c); - void showCFMarker (const bool); - - const bool getMaxFFTVisible() const; - const bool getMinFFTVisible() const; - const QColor getMinFFTColor() const; - const QColor getMaxFFTColor() const; - const QColor getMarkerLowerIntensityColor () const; - const bool getMarkerLowerIntensityVisible () const; - const QColor getMarkerUpperIntensityColor () const; - const bool getMarkerUpperIntensityVisible () const; - const QColor getMarkerPeakAmplitudeColor () const; - const bool getMarkerNoiseFloorAmplitudeVisible () const; - const QColor getMarkerNoiseFloorAmplitudeColor () const; - const QColor getMarkerCFColor () const; - -public slots: - void setMaxFFTVisible(const bool); - void setMinFFTVisible(const bool); - void setMinFFTColor (QColor c); - void setMaxFFTColor (QColor c); - void setMarkerLowerIntensityColor (QColor c); - void setMarkerLowerIntensityVisible (bool visible); - void setMarkerUpperIntensityColor (QColor c); - void setMarkerUpperIntensityVisible (bool visible); - void setMarkerPeakAmplitudeColor (QColor c); - void setMarkerNoiseFloorAmplitudeVisible (bool visible); - void setMarkerNoiseFloorAmplitudeColor (QColor c); - void setMarkerCFColor (QColor c); - - void setLowerIntensityLevel(const double); - void setUpperIntensityLevel(const double); - - void onPickerPointSelected(const QwtDoublePoint & p); - void onPickerPointSelected6(const QPointF & p); - - void setAutoScale(bool state); - -private: - void _resetXAxisPoints(); - void _autoScale(double bottom, double top); - - std::vector<double*> _dataPoints; - - QwtPlotCurve* _min_fft_plot_curve; - QwtPlotCurve* _max_fft_plot_curve; - QColor _min_fft_color; - bool _min_fft_visible; - QColor _max_fft_color; - bool _max_fft_visible; - QColor _marker_lower_intensity_color; - bool _marker_lower_intensity_visible; - QColor _marker_upper_intensity_color; - bool _marker_upper_intensity_visible; - QColor _marker_peak_amplitude_color; - QColor _marker_noise_floor_amplitude_color; - bool _marker_noise_floor_amplitude_visible; - QColor _marker_CF_color; - - double _startFrequency; - double _stopFrequency; - double _maxYAxis; - double _minYAxis; - - QwtPlotMarker* _lower_intensity_marker; - QwtPlotMarker* _upper_intensity_marker; - - QwtPlotMarker *_markerPeakAmplitude; - QwtPlotMarker *_markerNoiseFloorAmplitude; - QwtPlotMarker *_markerCF; - - double* _xAxisPoints; - int _xAxisMultiplier; - - double* _minFFTPoints; - double* _maxFFTPoints; - - double _peakFrequency; - double _peakAmplitude; - - double _noiseFloorAmplitude; -}; - -#endif /* FREQUENCY_DISPLAY_PLOT_HPP */ diff --git a/gr-qtgui/lib/SpectrumGUIClass.cc b/gr-qtgui/lib/SpectrumGUIClass.cc index 40c7fb02b6..328eaa9b6f 100644 --- a/gr-qtgui/lib/SpectrumGUIClass.cc +++ b/gr-qtgui/lib/SpectrumGUIClass.cc @@ -23,7 +23,7 @@ #ifndef SPECTRUM_GUI_CLASS_CPP #define SPECTRUM_GUI_CLASS_CPP -#include <SpectrumGUIClass.h> +#include <qtgui/SpectrumGUIClass.h> //Added by qt3to4: #include <QEvent> #include <QCustomEvent> diff --git a/gr-qtgui/lib/SpectrumGUIClass.h b/gr-qtgui/lib/SpectrumGUIClass.h deleted file mode 100644 index 9a2233d168..0000000000 --- a/gr-qtgui/lib/SpectrumGUIClass.h +++ /dev/null @@ -1,130 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008-2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SPECTRUM_GUI_CLASS_HPP -#define SPECTRUM_GUI_CLASS_HPP - -#include <gruel/thread.h> -#include <qwidget.h> -#include <qapplication.h> -#include <qlabel.h> -#include <qslider.h> -#include <spectrumUpdateEvents.h> - -class SpectrumDisplayForm; -#include <spectrumdisplayform.h> - -#include <cmath> - -#include <complex> -#include <vector> -#include <string> - -class SpectrumGUIClass -{ -public: - SpectrumGUIClass(const uint64_t maxDataSize, const uint64_t fftSize, - const double newCenterFrequency, - const double newStartFrequency, - const double newStopFrequency); - ~SpectrumGUIClass(); - void reset(); - - void openSpectrumWindow(QWidget*, - const bool frequency=true, const bool waterfall=true, - const bool time=true, const bool constellation=true); - void setDisplayTitle(const std::string); - - bool getWindowOpenFlag(); - void setWindowOpenFlag(const bool); - - void setFrequencyRange(const double, const double, const double); - double getStartFrequency(); - double getStopFrequency(); - double getCenterFrequency(); - - void updateWindow(const bool, const float*, - const uint64_t, const float*, - const uint64_t, const float*, - const uint64_t, - const gruel::high_res_timer_type, const bool); - - float getPowerValue(); - void setPowerValue(const float); - - int getWindowType(); - void setWindowType(const int); - - int getFFTSize(); - int getFFTSizeIndex(); - void setFFTSize(const int); - - gruel::high_res_timer_type getLastGUIUpdateTime(); - void setLastGUIUpdateTime(const gruel::high_res_timer_type); - - unsigned int getPendingGUIUpdateEvents(); - void incrementPendingGUIUpdateEvents(); - void decrementPendingGUIUpdateEvents(); - void resetPendingGUIUpdateEvents(); - - static const long MAX_FFT_SIZE; - static const long MIN_FFT_SIZE; - - QWidget* qwidget(); - - void setTimeDomainAxis(double min, double max); - void setConstellationAxis(double xmin, double xmax, - double ymin, double ymax); - void setConstellationPenSize(int size); - void setFrequencyAxis(double min, double max); - - void setUpdateTime(double t); - -protected: - -private: - - gruel::mutex d_mutex; - int64_t _dataPoints; - std::string _title; - double _centerFrequency; - double _startFrequency; - double _stopFrequency; - float _powerValue; - bool _windowOpennedFlag; - int _windowType; - int64_t _lastDataPointCount; - int _fftSize; - gruel::high_res_timer_type _lastGUIUpdateTime; - unsigned int _pendingGUIUpdateEventsCount; - int _droppedEntriesCount; - bool _fftBuffersCreatedFlag; - double _updateTime; - - SpectrumDisplayForm* _spectrumDisplayForm; - - float* _fftPoints; - double* _realTimeDomainPoints; - double* _imagTimeDomainPoints; -}; - -#endif /* SPECTRUM_GUI_CLASS_HPP */ diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc index 032da2547d..13e24c2a97 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc @@ -23,7 +23,7 @@ #ifndef TIME_DOMAIN_DISPLAY_PLOT_C #define TIME_DOMAIN_DISPLAY_PLOT_C -#include <TimeDomainDisplayPlot.h> +#include <qtgui/TimeDomainDisplayPlot.h> #include <qwt_scale_draw.h> #include <qwt_legend.h> diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.h b/gr-qtgui/lib/TimeDomainDisplayPlot.h deleted file mode 100644 index 9996f84fc3..0000000000 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008-2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef TIME_DOMAIN_DISPLAY_PLOT_H -#define TIME_DOMAIN_DISPLAY_PLOT_H - -#include <stdint.h> -#include <cstdio> -#include <vector> -#include "DisplayPlot.h" - -class TimeDomainDisplayPlot: public DisplayPlot -{ - Q_OBJECT - -public: - TimeDomainDisplayPlot(int nplots, QWidget*); - virtual ~TimeDomainDisplayPlot(); - - void plotNewData(const std::vector<double*> dataPoints, - const int64_t numDataPoints, const double timeInterval); - - void replot(); - - void stemPlot(bool en); - -public slots: - void setSampleRate(double sr, double units, - const std::string &strunits); - - void setAutoScale(bool state); - void setSemilogx(bool en); - void setSemilogy(bool en); - -private: - void _resetXAxisPoints(); - void _autoScale(double bottom, double top); - - std::vector<double*> _dataPoints; - double* _xAxisPoints; - - double _sampleRate; - - bool d_semilogx; - bool d_semilogy; -}; - -#endif /* TIME_DOMAIN_DISPLAY_PLOT_H */ diff --git a/gr-qtgui/lib/TimeRasterDisplayPlot.cc b/gr-qtgui/lib/TimeRasterDisplayPlot.cc index 48fb7f7b4a..66b38c52f2 100644 --- a/gr-qtgui/lib/TimeRasterDisplayPlot.cc +++ b/gr-qtgui/lib/TimeRasterDisplayPlot.cc @@ -23,9 +23,9 @@ #ifndef TIMERASTER_DISPLAY_PLOT_C #define TIMERASTER_DISPLAY_PLOT_C -#include <TimeRasterDisplayPlot.h> +#include <qtgui/TimeRasterDisplayPlot.h> -#include "qtgui_types.h" +#include <qtgui/qtgui_types.h> #include <qwt_color_map.h> #include <qwt_scale_draw.h> #include <qwt_legend.h> diff --git a/gr-qtgui/lib/TimeRasterDisplayPlot.h b/gr-qtgui/lib/TimeRasterDisplayPlot.h deleted file mode 100644 index e4e292a54d..0000000000 --- a/gr-qtgui/lib/TimeRasterDisplayPlot.h +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012,2013 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef TIMERASTER_DISPLAY_PLOT_H -#define TIMERASTER_DISPLAY_PLOT_H - -#include <stdint.h> -#include <cstdio> -#include <vector> -#include <qwt_plot_rasteritem.h> -#include "DisplayPlot.h" -#include "timeRasterGlobalData.h" -#include "plot_raster.h" -#include <gruel/high_res_timer.h> - -#if QWT_VERSION < 0x060000 -#include <plot_waterfall.h> -#else -#include <qwt_compat.h> -#endif - -class TimeRasterDisplayPlot: public DisplayPlot -{ - Q_OBJECT - -public: - TimeRasterDisplayPlot(int nplots, - double samp_rate, - double rows, double cols, - QWidget*); - virtual ~TimeRasterDisplayPlot(); - - void reset(); - - void setNumRows(double rows); - void setNumCols(double cols); - void setAlpha(int which, int alpha); - void setSampleRate(double samprate); - - double numRows() const; - double numCols() const; - - int getAlpha(int which); - - void setPlotDimensions(const double rows, const double cols, - const double units, const std::string &strunits); - - void plotNewData(const std::vector<double*> dataPoints, - const int64_t numDataPoints); - - void plotNewData(const double* dataPoints, - const int64_t numDataPoints); - - void setIntensityRange(const double minIntensity, - const double maxIntensity); - - void replot(void); - - int getIntensityColorMapType(int) const; - void setIntensityColorMapType(const int, const int, const QColor, const QColor); - const QColor getUserDefinedLowIntensityColor() const; - const QColor getUserDefinedHighIntensityColor() const; - - double getMinIntensity(int which) const; - double getMaxIntensity(int which) const; - -signals: - void updatedLowerIntensityLevel(const double); - void updatedUpperIntensityLevel(const double); - -private: - void _updateIntensityRangeDisplay(); - - std::vector<TimeRasterData*> d_data; - std::vector<PlotTimeRaster*> d_raster; - - double d_samp_rate; - double d_rows, d_cols; - - std::vector<int> d_color_map_type; - QColor d_low_intensity; - QColor d_high_intensity; -}; - -#endif /* TIMERASTER_DISPLAY_PLOT_H */ diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.cc b/gr-qtgui/lib/WaterfallDisplayPlot.cc index 05c89e3ecb..c1b8fd00c3 100644 --- a/gr-qtgui/lib/WaterfallDisplayPlot.cc +++ b/gr-qtgui/lib/WaterfallDisplayPlot.cc @@ -23,9 +23,9 @@ #ifndef WATERFALL_DISPLAY_PLOT_C #define WATERFALL_DISPLAY_PLOT_C -#include <WaterfallDisplayPlot.h> +#include <qtgui/WaterfallDisplayPlot.h> -#include "qtgui_types.h" +#include <qtgui/qtgui_types.h> #include <qwt_color_map.h> #include <qwt_scale_draw.h> #include <qwt_legend.h> diff --git a/gr-qtgui/lib/WaterfallDisplayPlot.h b/gr-qtgui/lib/WaterfallDisplayPlot.h deleted file mode 100644 index 6637adc594..0000000000 --- a/gr-qtgui/lib/WaterfallDisplayPlot.h +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008-2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef WATERFALL_DISPLAY_PLOT_H -#define WATERFALL_DISPLAY_PLOT_H - -#include <stdint.h> -#include <cstdio> -#include <vector> -#include <qwt_plot_spectrogram.h> -#include "DisplayPlot.h" -#include "waterfallGlobalData.h" -#include <gruel/high_res_timer.h> - -#if QWT_VERSION < 0x060000 -#include <plot_waterfall.h> -#else -#include <qwt_compat.h> -#endif - -class WaterfallDisplayPlot: public DisplayPlot -{ - Q_OBJECT - - Q_PROPERTY ( int intensity_color_map_type1 READ getIntensityColorMapType1 WRITE setIntensityColorMapType1 ) - Q_PROPERTY ( QColor low_intensity_color READ getUserDefinedLowIntensityColor WRITE setUserDefinedLowIntensityColor ) - Q_PROPERTY ( QColor high_intensity_color READ getUserDefinedHighIntensityColor WRITE setUserDefinedHighIntensityColor ) - - -public: - WaterfallDisplayPlot(int nplots, QWidget*); - virtual ~WaterfallDisplayPlot(); - - void resetAxis(); - - void setFrequencyRange(const double, const double, - const double units=1000.0, - const std::string &strunits = "kHz"); - double getStartFrequency() const; - double getStopFrequency() const; - - void plotNewData(const std::vector<double*> dataPoints, - const int64_t numDataPoints, - const double timePerFFT, - const gruel::high_res_timer_type timestamp, - const int droppedFrames); - - // to be removed - void plotNewData(const double* dataPoints, - const int64_t numDataPoints, - const double timePerFFT, - const gruel::high_res_timer_type timestamp, - const int droppedFrames); - - void setIntensityRange(const double minIntensity, const double maxIntensity); - double getMinIntensity(int which) const; - double getMaxIntensity(int which) const; - - void replot(void); - void clearData(); - - int getIntensityColorMapType(int) const; - int getIntensityColorMapType1() const; - const QColor getUserDefinedLowIntensityColor() const; - const QColor getUserDefinedHighIntensityColor() const; - - int getAlpha(int which); - void setAlpha(int which, int alpha); - -public slots: - void setIntensityColorMapType(const int, const int, const QColor, const QColor); - void setIntensityColorMapType1(int); - void setUserDefinedLowIntensityColor(QColor); - void setUserDefinedHighIntensityColor(QColor); - -signals: - void updatedLowerIntensityLevel(const double); - void updatedUpperIntensityLevel(const double); - -private: - void _updateIntensityRangeDisplay(); - - double _startFrequency; - double _stopFrequency; - int _xAxisMultiplier; - - std::vector<WaterfallData*> d_data; - -#if QWT_VERSION < 0x060000 - std::vector<PlotWaterfall*> d_spectrogram; -#else - std::vector<QwtPlotSpectrogram*> d_spectrogram; -#endif - - gruel::high_res_timer_type _lastReplot; - - std::vector<int> _intensityColorMapType; - QColor _userDefinedLowIntensityColor; - QColor _userDefinedHighIntensityColor; -}; - -#endif /* WATERFALL_DISPLAY_PLOT_H */ diff --git a/gr-qtgui/lib/const_sink_c_impl.h b/gr-qtgui/lib/const_sink_c_impl.h index 81cdb9881f..b5b0858343 100644 --- a/gr-qtgui/lib/const_sink_c_impl.h +++ b/gr-qtgui/lib/const_sink_c_impl.h @@ -26,7 +26,7 @@ #include <qtgui/const_sink_c.h> #include <gruel/high_res_timer.h> #include <gruel/thread.h> -#include <constellationdisplayform.h> +#include <qtgui/constellationdisplayform.h> namespace gr { namespace qtgui { diff --git a/gr-qtgui/lib/constellationdisplayform.cc b/gr-qtgui/lib/constellationdisplayform.cc index e3c65ec41d..bfd17b9c11 100644 --- a/gr-qtgui/lib/constellationdisplayform.cc +++ b/gr-qtgui/lib/constellationdisplayform.cc @@ -22,7 +22,7 @@ #include <cmath> #include <QMessageBox> -#include <constellationdisplayform.h> +#include <qtgui/constellationdisplayform.h> #include <iostream> ConstellationDisplayForm::ConstellationDisplayForm(int nplots, QWidget* parent) diff --git a/gr-qtgui/lib/constellationdisplayform.h b/gr-qtgui/lib/constellationdisplayform.h deleted file mode 100644 index 06a8e7ed5f..0000000000 --- a/gr-qtgui/lib/constellationdisplayform.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef CONSTELLATION_DISPLAY_FORM_H -#define CONSTELLATION_DISPLAY_FORM_H - -#include <spectrumUpdateEvents.h> -#include <ConstellationDisplayPlot.h> -#include <QtGui/QtGui> -#include <vector> - -#include "displayform.h" - -class ConstellationDisplayForm : public DisplayForm -{ - Q_OBJECT - -public: - ConstellationDisplayForm(int nplots=1, QWidget* parent = 0); - ~ConstellationDisplayForm(); - - ConstellationDisplayPlot* getPlot(); - - int getNPoints() const; - -public slots: - void customEvent(QEvent * e); - void setNPoints(const int); - - void setSampleRate(const QString &samprate); - void setYaxis(double min, double max); - void setXaxis(double min, double max); - void autoScale(bool en); - -private slots: - void newData(const QEvent*); - -private: - QIntValidator* _intValidator; - int d_npoints; -}; - -#endif /* CONSTELLATION_DISPLAY_FORM_H */ diff --git a/gr-qtgui/lib/displayform.cc b/gr-qtgui/lib/displayform.cc index 276539cdde..089d23804d 100644 --- a/gr-qtgui/lib/displayform.cc +++ b/gr-qtgui/lib/displayform.cc @@ -20,7 +20,7 @@ * Boston, MA 02110-1301, USA. */ -#include <displayform.h> +#include <qtgui/displayform.h> #include <iostream> #include <QPixmap> #include <QFileDialog> diff --git a/gr-qtgui/lib/displayform.h b/gr-qtgui/lib/displayform.h deleted file mode 100644 index 31dc757bb6..0000000000 --- a/gr-qtgui/lib/displayform.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef DISPLAY_FORM_H -#define DISPLAY_FORM_H - -#include <spectrumUpdateEvents.h> -#include <QtGui/QtGui> -#include <vector> - -#include <qwt_plot_grid.h> -#include <qwt_plot_layout.h> - -#include "DisplayPlot.h" -#include "form_menus.h" - -class DisplayForm : public QWidget -{ - Q_OBJECT - - public: - DisplayForm(int nplots=1, QWidget* parent = 0); - ~DisplayForm(); - - virtual DisplayPlot* getPlot() = 0; - void Reset(); - bool isClosed() const; - - void enableMenu(bool en=true); - -public slots: - void resizeEvent( QResizeEvent * e ); - void mousePressEvent( QMouseEvent * e); - virtual void customEvent( QEvent * e ) = 0; - - void closeEvent( QCloseEvent * e ); - - void setUpdateTime(double t); - - void setTitle(const QString &title); - void setLineLabel(int which, const QString &label); - void setLineColor(int which, const QString &color); - void setLineWidth(int which, int width); - void setLineStyle(int which, Qt::PenStyle style); - void setLineMarker(int which, QwtSymbol::Style style); - void setMarkerAlpha(int which, int alpha); - - QString title(); - QString lineLabel(int which); - QString lineColor(int which); - int lineWidth(int which); - Qt::PenStyle lineStyle(int which); - QwtSymbol::Style lineMarker(int which); - int markerAlpha(int which); - - virtual void setSampleRate(const QString &rate) = 0; - - void setStop(bool on); - void setStop(); - - void setGrid(bool on); - - void saveFigure(); - -private slots: - virtual void newData(const QEvent*) = 0; - virtual void autoScale(bool) = 0; - void updateGuiTimer(); - - void onPlotPointSelected(const QPointF p); - -signals: - void plotPointSelected(const QPointF p, int type); - -protected: - bool _isclosed; - - int _nplots; - - QGridLayout *_layout; - DisplayPlot* _displayPlot; - bool _systemSpecifiedFlag; - - QwtPlotGrid *_grid; - - bool _menu_on; - QMenu *_menu; - - QAction *_stop_act; - bool _stop_state; - QAction *_grid_act; - bool _grid_state; - - QAction *_autoscale_act; - bool _autoscale_state; - - QList<QMenu*> _lines_menu; - QList<LineTitleAction*> _line_title_act; - QList<LineColorMenu*> _line_color_menu; - QList<LineWidthMenu*> _line_width_menu; - QList<LineStyleMenu*> _line_style_menu; - QList<LineMarkerMenu*> _line_marker_menu; - QList<MarkerAlphaMenu*> _marker_alpha_menu; - - PopupMenu *_samp_rate_act; - QAction *_save_act; - - QTimer *d_displayTimer; - double d_update_time; -}; - -#endif /* DISPLAY_FORM_H */ diff --git a/gr-qtgui/lib/form_menus.h b/gr-qtgui/lib/form_menus.h deleted file mode 100644 index 63ab35ed95..0000000000 --- a/gr-qtgui/lib/form_menus.h +++ /dev/null @@ -1,1001 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef FORM_MENUS_H -#define FORM_MENUS_H - -#include <stdexcept> -#include <vector> -#include <QtGui/QtGui> -#include <qwt_symbol.h> -#include <filter/firdes.h> -#include "qtgui_types.h" - -class LineColorMenu: public QMenu -{ - Q_OBJECT - -public: - LineColorMenu(int which, QWidget *parent) - : QMenu("Line Color", parent), d_which(which) - { - d_act.push_back(new QAction("Blue", this)); - d_act.push_back(new QAction("Red", this)); - d_act.push_back(new QAction("Green", this)); - d_act.push_back(new QAction("Black", this)); - d_act.push_back(new QAction("Cyan", this)); - d_act.push_back(new QAction("Magenta", this)); - d_act.push_back(new QAction("Yellow", this)); - d_act.push_back(new QAction("Gray", this)); - d_act.push_back(new QAction("Dark Red", this)); - d_act.push_back(new QAction("Dark Green", this)); - d_act.push_back(new QAction("Dark Blue", this)); - d_act.push_back(new QAction("Dark Gray", this)); - - connect(d_act[0], SIGNAL(triggered()), this, SLOT(getBlue())); - connect(d_act[1], SIGNAL(triggered()), this, SLOT(getRed())); - connect(d_act[2], SIGNAL(triggered()), this, SLOT(getGreen())); - connect(d_act[3], SIGNAL(triggered()), this, SLOT(getBlack())); - connect(d_act[4], SIGNAL(triggered()), this, SLOT(getCyan())); - connect(d_act[5], SIGNAL(triggered()), this, SLOT(getMagenta())); - connect(d_act[6], SIGNAL(triggered()), this, SLOT(getYellow())); - connect(d_act[7], SIGNAL(triggered()), this, SLOT(getGray())); - connect(d_act[8], SIGNAL(triggered()), this, SLOT(getDarkRed())); - connect(d_act[9], SIGNAL(triggered()), this, SLOT(getDarkGreen())); - connect(d_act[10], SIGNAL(triggered()), this, SLOT(getDarkBlue())); - connect(d_act[11], SIGNAL(triggered()), this, SLOT(getDarkGray())); - - QListIterator<QAction*> i(d_act); - while(i.hasNext()) { - QAction *a = i.next(); - addAction(a); - } - } - - ~LineColorMenu() - {} - - int getNumActions() const - { - return d_act.size(); - } - - QAction * getAction(int which) - { - if(which < d_act.size()) - return d_act[which]; - else - throw std::runtime_error("LineColorMenu::getAction: which out of range.\n"); - } - -signals: - void whichTrigger(int which, const QString &name); - -public slots: - void getBlue() { emit whichTrigger(d_which, "blue"); } - void getRed() { emit whichTrigger(d_which, "red"); } - void getGreen() { emit whichTrigger(d_which, "green"); } - void getBlack() { emit whichTrigger(d_which, "black"); } - void getCyan() { emit whichTrigger(d_which, "cyan"); } - void getMagenta() { emit whichTrigger(d_which, "magenta"); } - void getYellow() { emit whichTrigger(d_which, "yellow"); } - void getGray() { emit whichTrigger(d_which, "gray"); } - void getDarkRed() { emit whichTrigger(d_which, "darkred"); } - void getDarkGreen() { emit whichTrigger(d_which, "darkgreen"); } - void getDarkBlue() { emit whichTrigger(d_which, "darkblue"); } - void getDarkGray() { emit whichTrigger(d_which, "darkgray"); } - -private: - QList<QAction *> d_act; - int d_which; -}; - - -/********************************************************************/ - - -class LineWidthMenu: public QMenu -{ - Q_OBJECT - -public: - LineWidthMenu(int which, QWidget *parent) - : QMenu("Line Width", parent), d_which(which) - { - d_act.push_back(new QAction("1", this)); - d_act.push_back(new QAction("2", this)); - d_act.push_back(new QAction("3", this)); - d_act.push_back(new QAction("4", this)); - d_act.push_back(new QAction("5", this)); - d_act.push_back(new QAction("6", this)); - d_act.push_back(new QAction("7", this)); - d_act.push_back(new QAction("8", this)); - d_act.push_back(new QAction("9", this)); - d_act.push_back(new QAction("10", this)); - - connect(d_act[0], SIGNAL(triggered()), this, SLOT(getOne())); - connect(d_act[1], SIGNAL(triggered()), this, SLOT(getTwo())); - connect(d_act[2], SIGNAL(triggered()), this, SLOT(getThree())); - connect(d_act[3], SIGNAL(triggered()), this, SLOT(getFour())); - connect(d_act[4], SIGNAL(triggered()), this, SLOT(getFive())); - connect(d_act[5], SIGNAL(triggered()), this, SLOT(getSix())); - connect(d_act[6], SIGNAL(triggered()), this, SLOT(getSeven())); - connect(d_act[7], SIGNAL(triggered()), this, SLOT(getEight())); - connect(d_act[8], SIGNAL(triggered()), this, SLOT(getNine())); - connect(d_act[9], SIGNAL(triggered()), this, SLOT(getTen())); - - QListIterator<QAction*> i(d_act); - while(i.hasNext()) { - QAction *a = i.next(); - addAction(a); - } - } - - ~LineWidthMenu() - {} - - int getNumActions() const - { - return d_act.size(); - } - - QAction * getAction(int which) - { - if(which < d_act.size()) - return d_act[which]; - else - throw std::runtime_error("LineWidthMenu::getAction: which out of range.\n"); - } - -signals: - void whichTrigger(int which, int width); - -public slots: - void getOne() { emit whichTrigger(d_which, 1); } - void getTwo() { emit whichTrigger(d_which, 2); } - void getThree() { emit whichTrigger(d_which, 3); } - void getFour() { emit whichTrigger(d_which, 4); } - void getFive() { emit whichTrigger(d_which, 5); } - void getSix() { emit whichTrigger(d_which, 6); } - void getSeven() { emit whichTrigger(d_which, 7); } - void getEight() { emit whichTrigger(d_which, 8); } - void getNine() { emit whichTrigger(d_which, 9); } - void getTen() { emit whichTrigger(d_which, 10); } - -private: - QList<QAction *> d_act; - int d_which; -}; - - -/********************************************************************/ - - -class LineStyleMenu: public QMenu -{ - Q_OBJECT - -public: - LineStyleMenu(int which, QWidget *parent) - : QMenu("Line Style", parent), d_which(which) - { - d_act.push_back(new QAction("None", this)); - d_act.push_back(new QAction("Solid", this)); - d_act.push_back(new QAction("Dash", this)); - d_act.push_back(new QAction("Dots", this)); - d_act.push_back(new QAction("Dash-Dot", this)); - d_act.push_back(new QAction("Dash-Dot-Dot", this)); - - connect(d_act[0], SIGNAL(triggered()), this, SLOT(getNone())); - connect(d_act[1], SIGNAL(triggered()), this, SLOT(getSolid())); - connect(d_act[2], SIGNAL(triggered()), this, SLOT(getDash())); - connect(d_act[3], SIGNAL(triggered()), this, SLOT(getDots())); - connect(d_act[4], SIGNAL(triggered()), this, SLOT(getDashDot())); - connect(d_act[5], SIGNAL(triggered()), this, SLOT(getDashDotDot())); - - QListIterator<QAction*> i(d_act); - while(i.hasNext()) { - QAction *a = i.next(); - addAction(a); - } - } - - ~LineStyleMenu() - {} - - int getNumActions() const - { - return d_act.size(); - } - - QAction * getAction(int which) - { - if(which < d_act.size()) - return d_act[which]; - else - throw std::runtime_error("LineStyleMenu::getAction: which out of range.\n"); - } - -signals: - void whichTrigger(int which, Qt::PenStyle); - -public slots: - void getNone() { emit whichTrigger(d_which, Qt::NoPen); } - void getSolid() { emit whichTrigger(d_which, Qt::SolidLine); } - void getDash() { emit whichTrigger(d_which, Qt::DashLine); } - void getDots() { emit whichTrigger(d_which, Qt::DotLine); } - void getDashDot() { emit whichTrigger(d_which, Qt::DashDotLine); } - void getDashDotDot() { emit whichTrigger(d_which, Qt::DashDotDotLine); } - -private: - QList<QAction *> d_act; - int d_which; -}; - - -/********************************************************************/ - - -class LineMarkerMenu: public QMenu -{ - Q_OBJECT - -public: - LineMarkerMenu(int which, QWidget *parent) - : QMenu("Line Marker", parent), d_which(which) - { - d_act.push_back(new QAction("None", this)); - d_act.push_back(new QAction("Circle", this)); - d_act.push_back(new QAction("Rectangle", this)); - d_act.push_back(new QAction("Diamond", this)); - d_act.push_back(new QAction("Triangle", this)); - d_act.push_back(new QAction("Down Triangle", this)); - d_act.push_back(new QAction("Left Triangle", this)); - d_act.push_back(new QAction("Right Triangle", this)); - d_act.push_back(new QAction("Cross", this)); - d_act.push_back(new QAction("X-Cross", this)); - d_act.push_back(new QAction("Horiz. Line", this)); - d_act.push_back(new QAction("Vert. Line", this)); - d_act.push_back(new QAction("Star 1", this)); - d_act.push_back(new QAction("Star 2", this)); - d_act.push_back(new QAction("Hexagon", this)); - - connect(d_act[0], SIGNAL(triggered()), this, SLOT(getNone())); - connect(d_act[1], SIGNAL(triggered()), this, SLOT(getCircle())); - connect(d_act[2], SIGNAL(triggered()), this, SLOT(getRect())); - connect(d_act[3], SIGNAL(triggered()), this, SLOT(getDiamond())); - connect(d_act[4], SIGNAL(triggered()), this, SLOT(getTriangle())); - connect(d_act[5], SIGNAL(triggered()), this, SLOT(getDTriangle())); - connect(d_act[6], SIGNAL(triggered()), this, SLOT(getLTriangle())); - connect(d_act[7], SIGNAL(triggered()), this, SLOT(getRTriangle())); - connect(d_act[8], SIGNAL(triggered()), this, SLOT(getCross())); - connect(d_act[9], SIGNAL(triggered()), this, SLOT(getXCross())); - connect(d_act[10], SIGNAL(triggered()), this, SLOT(getHLine())); - connect(d_act[11], SIGNAL(triggered()), this, SLOT(getVLine())); - connect(d_act[12], SIGNAL(triggered()), this, SLOT(getStar1())); - connect(d_act[13], SIGNAL(triggered()), this, SLOT(getStar2())); - connect(d_act[14], SIGNAL(triggered()), this, SLOT(getHexagon())); - - QListIterator<QAction*> i(d_act); - while(i.hasNext()) { - QAction *a = i.next(); - addAction(a); - } - } - - ~LineMarkerMenu() - {} - - int getNumActions() const - { - return d_act.size(); - } - - QAction * getAction(int which) - { - if(which < d_act.size()) - return d_act[which]; - else - throw std::runtime_error("LineMarkerMenu::getAction: which out of range.\n"); - } - -signals: - void whichTrigger(int which, QwtSymbol::Style); - -public slots: - void getNone() { emit whichTrigger(d_which, QwtSymbol::NoSymbol); } - void getCircle() { emit whichTrigger(d_which, QwtSymbol::Ellipse); } - void getRect() { emit whichTrigger(d_which, QwtSymbol::Rect); } - void getDiamond() { emit whichTrigger(d_which, QwtSymbol::Diamond); } - void getTriangle() { emit whichTrigger(d_which, QwtSymbol::Triangle); } - void getDTriangle() { emit whichTrigger(d_which, QwtSymbol::DTriangle); } - void getLTriangle() { emit whichTrigger(d_which, QwtSymbol::LTriangle); } - void getRTriangle() { emit whichTrigger(d_which, QwtSymbol::RTriangle); } - void getCross() { emit whichTrigger(d_which, QwtSymbol::Cross); } - void getXCross() { emit whichTrigger(d_which, QwtSymbol::XCross); } - void getHLine() { emit whichTrigger(d_which, QwtSymbol::HLine); } - void getVLine() { emit whichTrigger(d_which, QwtSymbol::VLine); } - void getStar1() { emit whichTrigger(d_which, QwtSymbol::Star1); } - void getStar2() { emit whichTrigger(d_which, QwtSymbol::Star2); } - void getHexagon() { emit whichTrigger(d_which, QwtSymbol::Hexagon); } - -private: - QList<QAction *> d_act; - int d_which; -}; - - -/********************************************************************/ - - -class MarkerAlphaMenu: public QMenu -{ - Q_OBJECT - -public: - MarkerAlphaMenu(int which, QWidget *parent) - : QMenu("Line Transparency", parent), d_which(which) - { - d_act.push_back(new QAction("None", this)); - d_act.push_back(new QAction("Low", this)); - d_act.push_back(new QAction("Medium", this)); - d_act.push_back(new QAction("High", this)); - d_act.push_back(new QAction("Off", this)); - - connect(d_act[0], SIGNAL(triggered()), this, SLOT(getNone())); - connect(d_act[1], SIGNAL(triggered()), this, SLOT(getLow())); - connect(d_act[2], SIGNAL(triggered()), this, SLOT(getMedium())); - connect(d_act[3], SIGNAL(triggered()), this, SLOT(getHigh())); - connect(d_act[4], SIGNAL(triggered()), this, SLOT(getOff())); - - QListIterator<QAction*> i(d_act); - while(i.hasNext()) { - QAction *a = i.next(); - addAction(a); - } - } - - ~MarkerAlphaMenu() - {} - - int getNumActions() const - { - return d_act.size(); - } - - QAction * getAction(int which) - { - if(which < d_act.size()) - return d_act[which]; - else - throw std::runtime_error("MarkerAlphaMenu::getAction: which out of range.\n"); - } - -signals: - void whichTrigger(int which, int); - -public slots: - void getNone() { emit whichTrigger(d_which, 255); } - void getLow() { emit whichTrigger(d_which, 200); } - void getMedium() { emit whichTrigger(d_which, 125); } - void getHigh() { emit whichTrigger(d_which, 50); } - void getOff() { emit whichTrigger(d_which, 0); } - -private: - QList<QAction *> d_act; - int d_which; -}; - - -/********************************************************************/ - - -class LineTitleAction: public QAction -{ - Q_OBJECT - -public: - LineTitleAction(int which, QWidget *parent) - : QAction("Line Title", parent), d_which(which) - { - d_diag = new QDialog(parent); - d_diag->setModal(true); - - d_text = new QLineEdit(); - - QGridLayout *layout = new QGridLayout(d_diag); - QPushButton *btn_ok = new QPushButton(tr("OK")); - QPushButton *btn_cancel = new QPushButton(tr("Cancel")); - - layout->addWidget(d_text, 0, 0, 1, 2); - layout->addWidget(btn_ok, 1, 0); - layout->addWidget(btn_cancel, 1, 1); - - connect(btn_ok, SIGNAL(clicked()), this, SLOT(getText())); - connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close())); - - connect(this, SIGNAL(triggered()), this, SLOT(getTextDiag())); - } - - ~LineTitleAction() - {} - -signals: - void whichTrigger(int which, const QString &text); - -public slots: - void getTextDiag() - { - d_diag->exec(); - } - -private slots: - void getText() - { - emit whichTrigger(d_which, d_text->text()); - d_diag->accept(); - } - -private: - int d_which; - - QDialog *d_diag; - QLineEdit *d_text; -}; - - -/********************************************************************/ - - -class OtherAction: public QAction -{ - Q_OBJECT - -public: - OtherAction(QWidget *parent) - : QAction("Other", parent) - { - d_diag = new QDialog(parent); - d_diag->setModal(true); - - d_text = new QLineEdit(); - - QGridLayout *layout = new QGridLayout(d_diag); - QPushButton *btn_ok = new QPushButton(tr("OK")); - QPushButton *btn_cancel = new QPushButton(tr("Cancel")); - - layout->addWidget(d_text, 0, 0, 1, 2); - layout->addWidget(btn_ok, 1, 0); - layout->addWidget(btn_cancel, 1, 1); - - connect(btn_ok, SIGNAL(clicked()), this, SLOT(getText())); - connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close())); - - connect(this, SIGNAL(triggered()), this, SLOT(getTextDiag())); - } - - ~OtherAction() - {} - -signals: - void whichTrigger(const QString &text); - -public slots: - void getTextDiag() - { - d_diag->exec(); - } - -private slots: - void getText() - { - emit whichTrigger(d_text->text()); - d_diag->accept(); - } - -private: - QDialog *d_diag; - QLineEdit *d_text; -}; - -/********************************************************************/ - - -class OtherDualAction: public QAction -{ - Q_OBJECT - -public: - OtherDualAction(QString label0, QString label1, QWidget *parent) - : QAction("Other", parent) - { - d_diag = new QDialog(parent); - d_diag->setModal(true); - - d_text0 = new QLineEdit(); - d_text1 = new QLineEdit(); - - QLabel *_label0 = new QLabel(label0); - QLabel *_label1 = new QLabel(label1); - - QGridLayout *layout = new QGridLayout(d_diag); - QPushButton *btn_ok = new QPushButton(tr("OK")); - QPushButton *btn_cancel = new QPushButton(tr("Cancel")); - - layout->addWidget(_label0, 0, 0, 1, 2); - layout->addWidget(_label1, 1, 0, 1, 2); - - layout->addWidget(d_text0, 0, 1, 1, 2); - layout->addWidget(d_text1, 1, 1, 1, 2); - layout->addWidget(btn_ok, 2, 0); - layout->addWidget(btn_cancel, 2, 1); - - connect(btn_ok, SIGNAL(clicked()), this, SLOT(getText())); - connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close())); - - connect(this, SIGNAL(triggered()), this, SLOT(getTextDiag())); - } - - ~OtherDualAction() - {} - -signals: - void whichTrigger(const QString &text0, const QString &text1); - -public slots: - void getTextDiag() - { - d_diag->exec(); - } - -private slots: - void getText() - { - emit whichTrigger(d_text0->text(), d_text1->text()); - d_diag->accept(); - } - -private: - QDialog *d_diag; - QLineEdit *d_text0; - QLineEdit *d_text1; -}; - - -/********************************************************************/ - - -class FFTSizeMenu: public QMenu -{ - Q_OBJECT - -public: - FFTSizeMenu(QWidget *parent) - : QMenu("FFT Size", parent) - { - d_act.push_back(new QAction("32", this)); - d_act.push_back(new QAction("64", this)); - d_act.push_back(new QAction("128", this)); - d_act.push_back(new QAction("256", this)); - d_act.push_back(new QAction("512", this)); - d_act.push_back(new QAction("1024", this)); - d_act.push_back(new QAction("2048", this)); - d_act.push_back(new QAction("4096", this)); - d_act.push_back(new QAction("8192", this)); - d_act.push_back(new QAction("16384", this)); - d_act.push_back(new QAction("32768", this)); - d_act.push_back(new OtherAction(this)); - - connect(d_act[0], SIGNAL(triggered()), this, SLOT(get05())); - connect(d_act[1], SIGNAL(triggered()), this, SLOT(get06())); - connect(d_act[2], SIGNAL(triggered()), this, SLOT(get07())); - connect(d_act[3], SIGNAL(triggered()), this, SLOT(get08())); - connect(d_act[4], SIGNAL(triggered()), this, SLOT(get09())); - connect(d_act[5], SIGNAL(triggered()), this, SLOT(get10())); - connect(d_act[6], SIGNAL(triggered()), this, SLOT(get11())); - connect(d_act[7], SIGNAL(triggered()), this, SLOT(get12())); - connect(d_act[8], SIGNAL(triggered()), this, SLOT(get13())); - connect(d_act[9], SIGNAL(triggered()), this, SLOT(get14())); - connect(d_act[10], SIGNAL(triggered()), this, SLOT(get15())); - connect(d_act[11], SIGNAL(whichTrigger(const QString&)), - this, SLOT(getOther(const QString&))); - - QListIterator<QAction*> i(d_act); - while(i.hasNext()) { - QAction *a = i.next(); - addAction(a); - } - } - - ~FFTSizeMenu() - {} - - int getNumActions() const - { - return d_act.size(); - } - - QAction * getAction(int which) - { - if(which < d_act.size()) - return d_act[which]; - else - throw std::runtime_error("FFTSizeMenu::getAction: which out of range.\n"); - } - - signals: - void whichTrigger(int size); - - public slots: - void get05() { emit whichTrigger(32); } - void get06() { emit whichTrigger(64); } - void get07() { emit whichTrigger(128); } - void get08() { emit whichTrigger(256); } - void get09() { emit whichTrigger(512); } - void get10() { emit whichTrigger(1024); } - void get11() { emit whichTrigger(2048); } - void get12() { emit whichTrigger(4096); } - void get13() { emit whichTrigger(8192); } - void get14() { emit whichTrigger(16384); } - void get15() { emit whichTrigger(32768); } - void getOther(const QString &str) - { - int value = str.toInt(); - emit whichTrigger(value); - } - -private: - QList<QAction *> d_act; - OtherAction *d_other; -}; - - -/********************************************************************/ - - -class FFTAverageMenu: public QMenu -{ - Q_OBJECT - -public: - FFTAverageMenu(QWidget *parent) - : QMenu("FFT Average", parent) - { - d_act.push_back(new QAction("Off", this)); - d_act.push_back(new QAction("High", this)); - d_act.push_back(new QAction("Medium", this)); - d_act.push_back(new QAction("Low", this)); - d_act.push_back(new OtherAction(this)); - - connect(d_act[0], SIGNAL(triggered()), this, SLOT(getOff())); - connect(d_act[1], SIGNAL(triggered()), this, SLOT(getHigh())); - connect(d_act[2], SIGNAL(triggered()), this, SLOT(getMedium())); - connect(d_act[3], SIGNAL(triggered()), this, SLOT(getLow())); - connect(d_act[4], SIGNAL(whichTrigger(const QString&)), - this, SLOT(getOther(const QString&))); - - QListIterator<QAction*> i(d_act); - while(i.hasNext()) { - QAction *a = i.next(); - addAction(a); - } - } - - ~FFTAverageMenu() - {} - - int getNumActions() const - { - return d_act.size(); - } - - QAction * getAction(int which) - { - if(which < d_act.size()) - return d_act[which]; - else - throw std::runtime_error("FFTSizeMenu::getAction: which out of range.\n"); - } - - signals: - void whichTrigger(float alpha); - - public slots: - void getOff() { emit whichTrigger(1.0); } - void getHigh() { emit whichTrigger(0.05); } - void getMedium() { emit whichTrigger(0.1); } - void getLow() { emit whichTrigger(0.2); } - void getOther(const QString &str) - { - float value = str.toFloat(); - emit whichTrigger(value); - } - -private: - QList<QAction *> d_act; - OtherAction *d_other; -}; - - -/********************************************************************/ - - -class FFTWindowMenu: public QMenu -{ - Q_OBJECT - -public: - FFTWindowMenu(QWidget *parent) - : QMenu("FFT Window", parent) - { - d_act.push_back(new QAction("None", this)); - d_act.push_back(new QAction("Hamming", this)); - d_act.push_back(new QAction("Hann", this)); - d_act.push_back(new QAction("Blackman", this)); - d_act.push_back(new QAction("Blackman-harris", this)); - d_act.push_back(new QAction("Rectangular", this)); - d_act.push_back(new QAction("Kaiser", this)); - - connect(d_act[0], SIGNAL(triggered()), this, SLOT(getNone())); - connect(d_act[1], SIGNAL(triggered()), this, SLOT(getHamming())); - connect(d_act[2], SIGNAL(triggered()), this, SLOT(getHann())); - connect(d_act[3], SIGNAL(triggered()), this, SLOT(getBlackman())); - connect(d_act[4], SIGNAL(triggered()), this, SLOT(getBlackmanharris())); - connect(d_act[5], SIGNAL(triggered()), this, SLOT(getRectangular())); - connect(d_act[6], SIGNAL(triggered()), this, SLOT(getKaiser())); - - QListIterator<QAction*> i(d_act); - while(i.hasNext()) { - QAction *a = i.next(); - addAction(a); - } - } - - ~FFTWindowMenu() - {} - - int getNumActions() const - { - return d_act.size(); - } - - QAction * getAction(int which) - { - if(which < d_act.size()) - return d_act[which]; - else - throw std::runtime_error("FFTWindowMenu::getAction: which out of range.\n"); - } - -signals: - void whichTrigger(const gr::filter::firdes::win_type type); - -public slots: - void getNone() { emit whichTrigger(gr::filter::firdes::WIN_NONE); } - void getHamming() { emit whichTrigger(gr::filter::firdes::WIN_HAMMING); } - void getHann() { emit whichTrigger(gr::filter::firdes::WIN_HANN); } - void getBlackman() { emit whichTrigger(gr::filter::firdes::WIN_BLACKMAN); } - void getBlackmanharris() { emit whichTrigger(gr::filter::firdes::WIN_BLACKMAN_hARRIS); } - void getRectangular() { emit whichTrigger(gr::filter::firdes::WIN_RECTANGULAR); } - void getKaiser() { emit whichTrigger(gr::filter::firdes::WIN_KAISER); } - -private: - QList<QAction *> d_act; - int d_which; -}; - - -/********************************************************************/ - - -class NPointsMenu: public QAction -{ - Q_OBJECT - -public: - NPointsMenu(QWidget *parent) - : QAction("Number of Points", parent) - { - d_diag = new QDialog(parent); - d_diag->setModal(true); - - d_text = new QLineEdit(); - - QGridLayout *layout = new QGridLayout(d_diag); - QPushButton *btn_ok = new QPushButton(tr("OK")); - QPushButton *btn_cancel = new QPushButton(tr("Cancel")); - - layout->addWidget(d_text, 0, 0, 1, 2); - layout->addWidget(btn_ok, 1, 0); - layout->addWidget(btn_cancel, 1, 1); - - connect(btn_ok, SIGNAL(clicked()), this, SLOT(getText())); - connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close())); - - connect(this, SIGNAL(triggered()), this, SLOT(getTextDiag())); - } - - ~NPointsMenu() - {} - -signals: - void whichTrigger(const int npts); - -public slots: - void getTextDiag() - { - d_diag->show(); - } - -private slots: - void getText() - { - emit whichTrigger(d_text->text().toInt()); - d_diag->accept(); - } - -private: - QDialog *d_diag; - QLineEdit *d_text; -}; - - -/********************************************************************/ - - -class ColorMapMenu: public QMenu -{ - Q_OBJECT - -public: - ColorMapMenu(int which, QWidget *parent) - : QMenu("Color Map", parent), d_which(which) - { - d_act.push_back(new QAction("Multi-Color", this)); - d_act.push_back(new QAction("White Hot", this)); - d_act.push_back(new QAction("Black Hot", this)); - d_act.push_back(new QAction("Incandescent", this)); - d_act.push_back(new QAction("Other", this)); - //d_act.push_back(new OtherDualAction("Min Intensity: ", "Max Intensity: ", this)); - - connect(d_act[0], SIGNAL(triggered()), this, SLOT(getMultiColor())); - connect(d_act[1], SIGNAL(triggered()), this, SLOT(getWhiteHot())); - connect(d_act[2], SIGNAL(triggered()), this, SLOT(getBlackHot())); - connect(d_act[3], SIGNAL(triggered()), this, SLOT(getIncandescent())); - connect(d_act[4], SIGNAL(triggered()), this, SLOT(getOther())); - - QListIterator<QAction*> i(d_act); - while(i.hasNext()) { - QAction *a = i.next(); - addAction(a); - } - - d_max_value = QColor("white"); - d_min_value = QColor("white"); - } - - ~ColorMapMenu() - {} - - int getNumActions() const - { - return d_act.size(); - } - - QAction * getAction(int which) - { - if(which < d_act.size()) - return d_act[which]; - else - throw std::runtime_error("ColorMapMenu::getAction: which out of range.\n"); - } - - signals: - void whichTrigger(int which, const int type, - const QColor &min_color=QColor(), - const QColor &max_color=QColor()); - - public slots: - void getMultiColor() { emit whichTrigger(d_which, INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR); } - void getWhiteHot() { emit whichTrigger(d_which, INTENSITY_COLOR_MAP_TYPE_WHITE_HOT); } - void getBlackHot() { emit whichTrigger(d_which, INTENSITY_COLOR_MAP_TYPE_BLACK_HOT); } - void getIncandescent() { emit whichTrigger(d_which, INTENSITY_COLOR_MAP_TYPE_INCANDESCENT); } - //void getOther(d_which, const QString &min_str, const QString &max_str) - void getOther() - { - QMessageBox::information(this, "Set low and high intensities", - "In the next windows, select the low and then the high intensity colors.", - QMessageBox::Ok); - d_min_value = QColorDialog::getColor(d_min_value, this); - d_max_value = QColorDialog::getColor(d_max_value, this); - - emit whichTrigger(d_which, INTENSITY_COLOR_MAP_TYPE_USER_DEFINED, - d_min_value, d_max_value); - } - -private: - QList<QAction *> d_act; - OtherDualAction *d_other; - QColor d_max_value, d_min_value; - int d_which; -}; - - -/********************************************************************/ - - -class PopupMenu: public QAction -{ - Q_OBJECT - -public: - PopupMenu(QString desc, QWidget *parent) - : QAction(desc, parent) - { - d_diag = new QDialog(parent); - d_diag->setModal(true); - - d_text = new QLineEdit(); - - QGridLayout *layout = new QGridLayout(d_diag); - QPushButton *btn_ok = new QPushButton(tr("OK")); - QPushButton *btn_cancel = new QPushButton(tr("Cancel")); - - layout->addWidget(d_text, 0, 0, 1, 2); - layout->addWidget(btn_ok, 1, 0); - layout->addWidget(btn_cancel, 1, 1); - - connect(btn_ok, SIGNAL(clicked()), this, SLOT(getText())); - connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close())); - - connect(this, SIGNAL(triggered()), this, SLOT(getTextDiag())); - } - - ~PopupMenu() - {} - -signals: - void whichTrigger(const QString data); - -public slots: - void getTextDiag() - { - d_diag->show(); - } - -private slots: - void getText() - { - emit whichTrigger(d_text->text()); - d_diag->accept(); - } - -private: - QDialog *d_diag; - QLineEdit *d_text; -}; - - -/********************************************************************/ - - -#endif /* FORM_MENUS_H */ diff --git a/gr-qtgui/lib/freq_sink_c_impl.h b/gr-qtgui/lib/freq_sink_c_impl.h index 0567b914c8..e82f5c9ee7 100644 --- a/gr-qtgui/lib/freq_sink_c_impl.h +++ b/gr-qtgui/lib/freq_sink_c_impl.h @@ -28,7 +28,7 @@ #include <fft/fft.h> #include <gruel/high_res_timer.h> #include <gruel/thread.h> -#include <freqdisplayform.h> +#include <qtgui/freqdisplayform.h> namespace gr { namespace qtgui { diff --git a/gr-qtgui/lib/freq_sink_f_impl.h b/gr-qtgui/lib/freq_sink_f_impl.h index b79127f3dd..d3d8851c88 100644 --- a/gr-qtgui/lib/freq_sink_f_impl.h +++ b/gr-qtgui/lib/freq_sink_f_impl.h @@ -28,7 +28,7 @@ #include <fft/fft.h> #include <gruel/high_res_timer.h> #include <gruel/thread.h> -#include <freqdisplayform.h> +#include <qtgui/freqdisplayform.h> namespace gr { namespace qtgui { diff --git a/gr-qtgui/lib/freqdisplayform.cc b/gr-qtgui/lib/freqdisplayform.cc index c90e8b7961..adcc09dc4b 100644 --- a/gr-qtgui/lib/freqdisplayform.cc +++ b/gr-qtgui/lib/freqdisplayform.cc @@ -22,7 +22,7 @@ #include <cmath> #include <QMessageBox> -#include <freqdisplayform.h> +#include <qtgui/freqdisplayform.h> #include <iostream> FreqDisplayForm::FreqDisplayForm(int nplots, QWidget* parent) diff --git a/gr-qtgui/lib/freqdisplayform.h b/gr-qtgui/lib/freqdisplayform.h deleted file mode 100644 index b22cd93c51..0000000000 --- a/gr-qtgui/lib/freqdisplayform.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef FREQ_DISPLAY_FORM_H -#define FREQ_DISPLAY_FORM_H - -#include <spectrumUpdateEvents.h> -#include <FrequencyDisplayPlot.h> -#include <QtGui/QtGui> -#include <vector> -#include <filter/firdes.h> - -#include "displayform.h" - -class FreqDisplayForm : public DisplayForm -{ - Q_OBJECT - - public: - FreqDisplayForm(int nplots=1, QWidget* parent = 0); - ~FreqDisplayForm(); - - FrequencyDisplayPlot* getPlot(); - - int getFFTSize() const; - float getFFTAverage() const; - gr::filter::firdes::win_type getFFTWindowType() const; - -public slots: - void customEvent(QEvent *e); - - void setSampleRate(const QString &samprate); - void setFFTSize(const int); - void setFFTAverage(const float); - void setFFTWindowType(const gr::filter::firdes::win_type); - - void setFrequencyRange(const double centerfreq, - const double bandwidth); - void setYaxis(double min, double max); - void autoScale(bool en); - -private slots: - void newData(const QEvent *updateEvent); - -private: - uint64_t _numRealDataPoints; - QIntValidator* _intValidator; - - double _samp_rate, _center_freq; - int _fftsize; - float _fftavg; - gr::filter::firdes::win_type _fftwintype; -}; - -#endif /* FREQ_DISPLAY_FORM_H */ diff --git a/gr-qtgui/lib/plot_raster.cc b/gr-qtgui/lib/plot_raster.cc index 76bff473e9..6d31a2596c 100644 --- a/gr-qtgui/lib/plot_raster.cc +++ b/gr-qtgui/lib/plot_raster.cc @@ -27,7 +27,7 @@ #include "qwt_painter.h" #include "qwt_scale_map.h" #include "qwt_color_map.h" -#include "plot_raster.h" +#include <qtgui/plot_raster.h> #if QWT_VERSION < 0x060000 #include "qwt_double_interval.h" diff --git a/gr-qtgui/lib/plot_raster.h b/gr-qtgui/lib/plot_raster.h deleted file mode 100644 index 7bea0a4d57..0000000000 --- a/gr-qtgui/lib/plot_raster.h +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012,2013 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef PLOT_TIMERASTER_H -#define PLOT_TIMERASTER_H - -#include <qglobal.h> -#include <timeRasterGlobalData.h> -#include <qwt_plot_rasteritem.h> - -#if QWT_VERSION >= 0x060000 -#include <qwt_point_3d.h> // doesn't seem necessary, but is... -#include <qwt_compat.h> -#endif - -class QwtColorMap; - -/*! - \brief A plot item, which displays a time raster. - - A time raster displays threedimenional data, where the 3rd dimension - ( the intensity ) is displayed using colors. The colors are calculated - from the values using a color map. - - \sa QwtRasterData, QwtColorMap -*/ - -class PlotTimeRaster: public QwtPlotRasterItem -{ -public: - explicit PlotTimeRaster(const QString &title = QString::null); - virtual ~PlotTimeRaster(); - - const TimeRasterData* data()const; - - void setData(TimeRasterData *data); - - void setColorMap(const QwtColorMap *map); - - const QwtColorMap &colorMap() const; - -#if QWT_VERSION < 0x060000 - virtual QwtDoubleRect boundingRect() const; - virtual QSize rasterHint(const QwtDoubleRect &) const; - virtual QwtDoubleInterval interval(Qt::Axis ax) const; -#else - virtual QwtInterval interval(Qt::Axis ax) const; -#endif - - virtual int rtti() const; - - virtual void draw(QPainter *p, - const QwtScaleMap &xMap, - const QwtScaleMap &yMap, - const QRect &rect) const; - -protected: -#if QWT_VERSION < 0x060000 - QImage renderImage(const QwtScaleMap &xMap, - const QwtScaleMap &yMap, - const QwtDoubleRect &rect) const; -#else - QImage renderImage(const QwtScaleMap &xMap, - const QwtScaleMap &yMap, - const QRectF &rect, - const QSize &size=QSize(0,0)) const; -#endif - -private: - class PrivateData; - PrivateData *d_data; -}; - -#endif diff --git a/gr-qtgui/lib/plot_waterfall.cc b/gr-qtgui/lib/plot_waterfall.cc index 84915e3f31..5a378767be 100644 --- a/gr-qtgui/lib/plot_waterfall.cc +++ b/gr-qtgui/lib/plot_waterfall.cc @@ -26,7 +26,7 @@ #include "qwt_painter.h" #include "qwt_scale_map.h" #include "qwt_color_map.h" -#include "plot_waterfall.h" +#include <qtgui/plot_waterfall.h> #if QWT_VERSION < 0x060000 #include "qwt_double_interval.h" diff --git a/gr-qtgui/lib/plot_waterfall.h b/gr-qtgui/lib/plot_waterfall.h deleted file mode 100644 index 40ee4eccb3..0000000000 --- a/gr-qtgui/lib/plot_waterfall.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008-2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef PLOT_WATERFALL_H -#define PLOT_WATERFALL_H - -#include <qglobal.h> -#include <waterfallGlobalData.h> -#include <qwt_plot_rasteritem.h> - -#if QWT_VERSION >= 0x060000 -#include <qwt_point_3d.h> // doesn't seem necessary, but is... -#include <qwt_compat.h> -#endif - -class QwtColorMap; - -/*! - \brief A plot item, which displays a waterfall spectrogram - - A waterfall displays threedimenional data, where the 3rd dimension - ( the intensity ) is displayed using colors. The colors are calculated - from the values using a color map. - - \sa QwtRasterData, QwtColorMap -*/ - -class PlotWaterfall: public QwtPlotRasterItem -{ -public: - explicit PlotWaterfall(WaterfallData* data, - const QString &title = QString::null); - virtual ~PlotWaterfall(); - - const WaterfallData* data()const; - - void setColorMap(const QwtColorMap &); - - const QwtColorMap &colorMap() const; - -#if QWT_VERSION < 0x060000 - virtual QwtDoubleRect boundingRect() const; - virtual QSize rasterHint(const QwtDoubleRect &) const; -#endif - - virtual int rtti() const; - - virtual void draw(QPainter *p, - const QwtScaleMap &xMap, - const QwtScaleMap &yMap, - const QRect &rect) const; - -protected: -#if QWT_VERSION < 0x060000 - QImage renderImage(const QwtScaleMap &xMap, - const QwtScaleMap &yMap, - const QwtDoubleRect &rect) const; -#else - QImage renderImage(const QwtScaleMap &xMap, - const QwtScaleMap &yMap, - const QRectF &rect, - const QSize &size=QSize(0,0)) const; -#endif - -private: - class PrivateData; - PrivateData *d_data; -}; - -#endif diff --git a/gr-qtgui/lib/qtgui_types.h b/gr-qtgui/lib/qtgui_types.h deleted file mode 100644 index f4b16dfef2..0000000000 --- a/gr-qtgui/lib/qtgui_types.h +++ /dev/null @@ -1,196 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef QTGUI_TYPES_H -#define QTGUI_TYPES_H - -#include <qwt_color_map.h> -#include <qwt_scale_draw.h> -#include <gruel/high_res_timer.h> - -class FreqOffsetAndPrecisionClass -{ -public: - FreqOffsetAndPrecisionClass(const int freqPrecision) - { - _frequencyPrecision = freqPrecision; - _centerFrequency = 0; - } - - virtual ~FreqOffsetAndPrecisionClass() - { - } - - virtual unsigned int getFrequencyPrecision() const - { - return _frequencyPrecision; - } - - virtual void setFrequencyPrecision(const unsigned int newPrecision) - { - _frequencyPrecision = newPrecision; - } - - virtual double getCenterFrequency() const - { - return _centerFrequency; - } - - virtual void setCenterFrequency(const double newFreq) - { - _centerFrequency = newFreq; - } - -protected: - -private: - unsigned int _frequencyPrecision; - double _centerFrequency; -}; - -class TimeScaleData -{ -public: - TimeScaleData() - { - _zeroTime = 0; - _secondsPerLine = 1.0; - } - - virtual ~TimeScaleData() - { - } - - virtual gruel::high_res_timer_type getZeroTime() const - { - return _zeroTime; - } - - virtual void setZeroTime(const gruel::high_res_timer_type newTime) - { - _zeroTime = newTime - gruel::high_res_timer_epoch(); - } - - virtual void setSecondsPerLine(const double newTime) - { - _secondsPerLine = newTime; - } - - virtual double getSecondsPerLine() const - { - return _secondsPerLine; - } - - -protected: - -private: - gruel::high_res_timer_type _zeroTime; - double _secondsPerLine; - -}; - -/*********************************************************************** - * Text scale widget to provide X (freq) axis text - **********************************************************************/ -class FreqDisplayScaleDraw: public QwtScaleDraw, FreqOffsetAndPrecisionClass -{ -public: - FreqDisplayScaleDraw(const unsigned int precision) - : QwtScaleDraw(), FreqOffsetAndPrecisionClass(precision) - { - } - - virtual QwtText label(double value) const - { - return QString("%1").arg(value, 0, 'f', getFrequencyPrecision()); - } - - virtual void initiateUpdate(void) - { - invalidateCache(); - } - -protected: - -private: - -}; - -enum{ - INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR = 0, - INTENSITY_COLOR_MAP_TYPE_WHITE_HOT = 1, - INTENSITY_COLOR_MAP_TYPE_BLACK_HOT = 2, - INTENSITY_COLOR_MAP_TYPE_INCANDESCENT = 3, - INTENSITY_COLOR_MAP_TYPE_USER_DEFINED = 4 -}; - -class ColorMap_MultiColor: public QwtLinearColorMap -{ -public: - ColorMap_MultiColor(): - QwtLinearColorMap(Qt::darkCyan, Qt::white) - { - addColorStop(0.25, Qt::cyan); - addColorStop(0.5, Qt::yellow); - addColorStop(0.75, Qt::red); - } -}; - -class ColorMap_WhiteHot: public QwtLinearColorMap -{ -public: - ColorMap_WhiteHot(): - QwtLinearColorMap(Qt::black, Qt::white) - { - } -}; - -class ColorMap_BlackHot: public QwtLinearColorMap -{ -public: - ColorMap_BlackHot(): - QwtLinearColorMap(Qt::white, Qt::black) - { - } -}; - -class ColorMap_Incandescent: public QwtLinearColorMap -{ -public: - ColorMap_Incandescent(): - QwtLinearColorMap(Qt::black, Qt::white) - { - addColorStop(0.5, Qt::darkRed); - } -}; - -class ColorMap_UserDefined: public QwtLinearColorMap -{ -public: - ColorMap_UserDefined(QColor low, QColor high): - QwtLinearColorMap(low, high) - { - } -}; - -#endif //QTGUI_TYPES_H diff --git a/gr-qtgui/lib/sink_c_impl.h b/gr-qtgui/lib/sink_c_impl.h index ddfb0865d5..83f542b426 100644 --- a/gr-qtgui/lib/sink_c_impl.h +++ b/gr-qtgui/lib/sink_c_impl.h @@ -27,7 +27,7 @@ #include <filter/firdes.h> #include <fft/fft.h> #include <gruel/high_res_timer.h> -#include <SpectrumGUIClass.h> +#include <qtgui/SpectrumGUIClass.h> namespace gr { namespace qtgui { diff --git a/gr-qtgui/lib/sink_f_impl.h b/gr-qtgui/lib/sink_f_impl.h index 394d5c3428..33dab713f6 100644 --- a/gr-qtgui/lib/sink_f_impl.h +++ b/gr-qtgui/lib/sink_f_impl.h @@ -27,7 +27,7 @@ #include <filter/firdes.h> #include <fft/fft.h> #include <gruel/high_res_timer.h> -#include <SpectrumGUIClass.h> +#include <qtgui/SpectrumGUIClass.h> namespace gr { namespace qtgui { diff --git a/gr-qtgui/lib/spectrumUpdateEvents.cc b/gr-qtgui/lib/spectrumUpdateEvents.cc index bda89651b6..82b195d692 100644 --- a/gr-qtgui/lib/spectrumUpdateEvents.cc +++ b/gr-qtgui/lib/spectrumUpdateEvents.cc @@ -23,7 +23,7 @@ #ifndef SPECTRUM_UPDATE_EVENTS_C #define SPECTRUM_UPDATE_EVENTS_C -#include <spectrumUpdateEvents.h> +#include <qtgui/spectrumUpdateEvents.h> SpectrumUpdateEvent::SpectrumUpdateEvent(const float* fftPoints, const uint64_t numFFTDataPoints, diff --git a/gr-qtgui/lib/spectrumUpdateEvents.h b/gr-qtgui/lib/spectrumUpdateEvents.h deleted file mode 100644 index 97d9c90146..0000000000 --- a/gr-qtgui/lib/spectrumUpdateEvents.h +++ /dev/null @@ -1,264 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008-2013 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SPECTRUM_UPDATE_EVENTS_H -#define SPECTRUM_UPDATE_EVENTS_H - -#include <stdint.h> -#include <QEvent> -#include <QString> -#include <complex> -#include <vector> -#include <gruel/high_res_timer.h> - -static const int SpectrumUpdateEventType = 10005; -static const int SpectrumWindowCaptionEventType = 10008; -static const int SpectrumWindowResetEventType = 10009; -static const int SpectrumFrequencyRangeEventType = 10010; - -class SpectrumUpdateEvent:public QEvent{ - -public: - SpectrumUpdateEvent(const float* fftPoints, - const uint64_t numFFTDataPoints, - const double* realTimeDomainPoints, - const double* imagTimeDomainPoints, - const uint64_t numTimeDomainDataPoints, - const gruel::high_res_timer_type dataTimestamp, - const bool repeatDataFlag, - const bool lastOfMultipleUpdateFlag, - const gruel::high_res_timer_type generatedTimestamp, - const int droppedFFTFrames); - - ~SpectrumUpdateEvent(); - - const float* getFFTPoints() const; - const double* getRealTimeDomainPoints() const; - const double* getImagTimeDomainPoints() const; - uint64_t getNumFFTDataPoints() const; - uint64_t getNumTimeDomainDataPoints() const; - gruel::high_res_timer_type getDataTimestamp() const; - bool getRepeatDataFlag() const; - bool getLastOfMultipleUpdateFlag() const; - gruel::high_res_timer_type getEventGeneratedTimestamp() const; - int getDroppedFFTFrames() const; - -protected: - -private: - float* _fftPoints; - double* _realDataTimeDomainPoints; - double* _imagDataTimeDomainPoints; - uint64_t _numFFTDataPoints; - uint64_t _numTimeDomainDataPoints; - gruel::high_res_timer_type _dataTimestamp; - bool _repeatDataFlag; - bool _lastOfMultipleUpdateFlag; - gruel::high_res_timer_type _eventGeneratedTimestamp; - int _droppedFFTFrames; -}; - -class SpectrumWindowCaptionEvent:public QEvent{ -public: - SpectrumWindowCaptionEvent(const QString&); - ~SpectrumWindowCaptionEvent(); - QString getLabel(); - -protected: - -private: - QString _labelString; -}; - -class SpectrumWindowResetEvent:public QEvent{ -public: - SpectrumWindowResetEvent(); - ~SpectrumWindowResetEvent(); - -protected: - -private: - -}; - -class SpectrumFrequencyRangeEvent:public QEvent{ -public: - SpectrumFrequencyRangeEvent(const double, const double, const double); - ~SpectrumFrequencyRangeEvent(); - double GetCenterFrequency()const; - double GetStartFrequency()const; - double GetStopFrequency()const; - -protected: - -private: - double _centerFrequency; - double _startFrequency; - double _stopFrequency; -}; - - -class TimeUpdateEvent: public QEvent -{ -public: - TimeUpdateEvent(const std::vector<double*> timeDomainPoints, - const uint64_t numTimeDomainDataPoints); - - ~TimeUpdateEvent(); - - int which() const; - const std::vector<double*> getTimeDomainPoints() const; - uint64_t getNumTimeDomainDataPoints() const; - bool getRepeatDataFlag() const; - - static QEvent::Type Type() - { return QEvent::Type(SpectrumUpdateEventType); } - -protected: - -private: - size_t _nplots; - std::vector<double*> _dataTimeDomainPoints; - uint64_t _numTimeDomainDataPoints; -}; - - -/********************************************************************/ - - -class FreqUpdateEvent: public QEvent -{ -public: - FreqUpdateEvent(const std::vector<double*> dataPoints, - const uint64_t numDataPoints); - - ~FreqUpdateEvent(); - - int which() const; - const std::vector<double*> getPoints() const; - uint64_t getNumDataPoints() const; - bool getRepeatDataFlag() const; - - static QEvent::Type Type() - { return QEvent::Type(SpectrumUpdateEventType); } - -protected: - -private: - size_t _nplots; - std::vector<double*> _dataPoints; - uint64_t _numDataPoints; -}; - - -/********************************************************************/ - - -class ConstUpdateEvent: public QEvent -{ -public: - ConstUpdateEvent(const std::vector<double*> realDataPoints, - const std::vector<double*> imagDataPoints, - const uint64_t numDataPoints); - - ~ConstUpdateEvent(); - - int which() const; - const std::vector<double*> getRealPoints() const; - const std::vector<double*> getImagPoints() const; - uint64_t getNumDataPoints() const; - bool getRepeatDataFlag() const; - - static QEvent::Type Type() - { return QEvent::Type(SpectrumUpdateEventType); } - -protected: - -private: - size_t _nplots; - std::vector<double*> _realDataPoints; - std::vector<double*> _imagDataPoints; - uint64_t _numDataPoints; -}; - - -/********************************************************************/ - - -class WaterfallUpdateEvent: public QEvent -{ -public: - WaterfallUpdateEvent(const std::vector<double*> dataPoints, - const uint64_t numDataPoints, - const gruel::high_res_timer_type dataTimestamp); - - ~WaterfallUpdateEvent(); - - int which() const; - const std::vector<double*> getPoints() const; - uint64_t getNumDataPoints() const; - bool getRepeatDataFlag() const; - - gruel::high_res_timer_type getDataTimestamp() const; - - static QEvent::Type Type() - { return QEvent::Type(SpectrumUpdateEventType); } - -protected: - -private: - size_t _nplots; - std::vector<double*> _dataPoints; - uint64_t _numDataPoints; - - gruel::high_res_timer_type _dataTimestamp; -}; - - -/********************************************************************/ - - -class TimeRasterUpdateEvent: public QEvent -{ -public: - TimeRasterUpdateEvent(const std::vector<double*> dataPoints, - const uint64_t numDataPoints); - ~TimeRasterUpdateEvent(); - - int which() const; - const std::vector<double*> getPoints() const; - uint64_t getNumDataPoints() const; - bool getRepeatDataFlag() const; - - static QEvent::Type Type() - { return QEvent::Type(SpectrumUpdateEventType); } - -protected: - -private: - size_t _nplots; - std::vector<double*> _dataPoints; - uint64_t _numDataPoints; -}; - - -#endif /* SPECTRUM_UPDATE_EVENTS_H */ diff --git a/gr-qtgui/lib/spectrumdisplayform.cc b/gr-qtgui/lib/spectrumdisplayform.cc index 8d7caebda8..e4ee028668 100644 --- a/gr-qtgui/lib/spectrumdisplayform.cc +++ b/gr-qtgui/lib/spectrumdisplayform.cc @@ -23,8 +23,8 @@ #include <cmath> #include <QColorDialog> #include <QMessageBox> -#include <spectrumdisplayform.h> -#include "qtgui_types.h" +#include <qtgui/spectrumdisplayform.h> +#include <qtgui/qtgui_types.h> SpectrumDisplayForm::SpectrumDisplayForm(QWidget* parent) : QWidget(parent) diff --git a/gr-qtgui/lib/spectrumdisplayform.h b/gr-qtgui/lib/spectrumdisplayform.h deleted file mode 100644 index c5b714e73f..0000000000 --- a/gr-qtgui/lib/spectrumdisplayform.h +++ /dev/null @@ -1,139 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2008-2011 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SPECTRUM_DISPLAY_FORM_H -#define SPECTRUM_DISPLAY_FORM_H - -#include "spectrumdisplayform.ui.h" - -class SpectrumGUIClass; -#include <SpectrumGUIClass.h> - -#include <SpectrumGUIClass.h> -#include <FrequencyDisplayPlot.h> -#include <WaterfallDisplayPlot.h> -#include <TimeDomainDisplayPlot.h> -#include <ConstellationDisplayPlot.h> -#include <QValidator> -#include <QTimer> -#include <vector> - -class SpectrumDisplayForm : public QWidget, public Ui::SpectrumDisplayForm -{ - Q_OBJECT - - public: - SpectrumDisplayForm(QWidget* parent = 0); - ~SpectrumDisplayForm(); - - void setSystem(SpectrumGUIClass * newSystem, const uint64_t numFFTDataPoints, - const uint64_t numTimeDomainDataPoints); - - int getAverageCount(); - void setAverageCount(const int newCount); - void reset(); - void averageDataReset(); - void resizeBuffers(const uint64_t numFFTDataPoints, - const uint64_t numTimeDomainDataPoints); - -public slots: - void resizeEvent(QResizeEvent * e); - void customEvent(QEvent * e); - void avgLineEdit_valueChanged(int valueString); - void maxHoldCheckBox_toggled(bool newState); - void minHoldCheckBox_toggled(bool newState); - void minHoldResetBtn_clicked(); - void maxHoldResetBtn_clicked(); - void tabChanged(int index); - - void setFrequencyRange(const double newCenterFrequency, - const double newStartFrequency, - const double newStopFrequency); - void closeEvent(QCloseEvent * e); - void windowTypeChanged(int newItem); - void useRFFrequenciesCB(bool useRFFlag); - void waterfallMaximumIntensityChangedCB(double); - void waterfallMinimumIntensityChangedCB(double); - void waterfallIntensityColorTypeChanged(int); - void waterfallAutoScaleBtnCB(); - void fftComboBoxSelectedCB(const QString&); - - void toggleTabFrequency(const bool state); - void toggleTabWaterfall(const bool state); - void toggleTabTime(const bool state); - void toggleTabConstellation(const bool state); - - void setTimeDomainAxis(double min, double max); - void setConstellationAxis(double xmin, double xmax, - double ymin, double ymax); - void setConstellationPenSize(int size); - void setFrequencyAxis(double min, double max); - void setUpdateTime(double t); - -private slots: - void newFrequencyData(const SpectrumUpdateEvent*); - void updateGuiTimer(); - - void onFFTPlotPointSelected(const QPointF p); - void onWFallPlotPointSelected(const QPointF p); - void onTimePlotPointSelected(const QPointF p); - void onConstPlotPointSelected(const QPointF p); - -signals: - void plotPointSelected(const QPointF p, int type); - -private: - void _averageHistory(const double * newBuffer); - - int _historyEntryCount; - int _historyEntry; - std::vector<double*>* _historyVector; - double* _averagedValues; - uint64_t _numRealDataPoints; - double* _realFFTDataPoints; - QIntValidator* _intValidator; - FrequencyDisplayPlot* _frequencyDisplayPlot; - WaterfallDisplayPlot* _waterfallDisplayPlot; - TimeDomainDisplayPlot* _timeDomainDisplayPlot; - ConstellationDisplayPlot* _constellationDisplayPlot; - SpectrumGUIClass* _system; - bool _systemSpecifiedFlag; - double _centerFrequency; - double _startFrequency; - double _noiseFloorAmplitude; - double _peakFrequency; - double _peakAmplitude; - double _stopFrequency; - - //SpectrumUpdateEvent _lastSpectrumEvent; - - // whether or not to use a particular display - int d_plot_fft; - int d_plot_waterfall; - int d_plot_time; - int d_plot_constellation; - - QTimer *displayTimer; - double d_update_time; -}; - -#endif /* SPECTRUM_DISPLAY_FORM_H */ diff --git a/gr-qtgui/lib/spectrumdisplayform.ui b/gr-qtgui/lib/spectrumdisplayform.ui index f1e1f08f98..e1ebfa8197 100644 --- a/gr-qtgui/lib/spectrumdisplayform.ui +++ b/gr-qtgui/lib/spectrumdisplayform.ui @@ -522,10 +522,10 @@ <tabstop>WaterfallMinimumIntensitySlider</tabstop> </tabstops> <includes> - <include location="global">SpectrumGUIClass.h</include> - <include location="global">FrequencyDisplayPlot.h</include> - <include location="global">WaterfallDisplayPlot.h</include> - <include location="global">TimeDomainDisplayPlot.h</include> + <include location="global">qtgui/SpectrumGUIClass.h</include> + <include location="global">qtgui/FrequencyDisplayPlot.h</include> + <include location="global">qtgui/WaterfallDisplayPlot.h</include> + <include location="global">qtgui/TimeDomainDisplayPlot.h</include> <include location="global">qvalidator.h</include> <include location="global">vector</include> <include location="local">qwt_slider.h</include> diff --git a/gr-qtgui/lib/timeRasterGlobalData.cc b/gr-qtgui/lib/timeRasterGlobalData.cc index 556196f644..6ebef5f47e 100644 --- a/gr-qtgui/lib/timeRasterGlobalData.cc +++ b/gr-qtgui/lib/timeRasterGlobalData.cc @@ -23,7 +23,7 @@ #ifndef TIMERASTER_GLOBAL_DATA_CPP #define TIMERASTER_GLOBAL_DATA_CPP -#include <timeRasterGlobalData.h> +#include <qtgui/timeRasterGlobalData.h> #include <cstdio> #include <cmath> #include <iostream> diff --git a/gr-qtgui/lib/timeRasterGlobalData.h b/gr-qtgui/lib/timeRasterGlobalData.h deleted file mode 100644 index 0a414432d1..0000000000 --- a/gr-qtgui/lib/timeRasterGlobalData.h +++ /dev/null @@ -1,78 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012,2013 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef TIMERASTER_GLOBAL_DATA_HPP -#define TIMERASTER_GLOBAL_DATA_HPP - -#include <qwt_raster_data.h> -#include <inttypes.h> - -#if QWT_VERSION >= 0x060000 -#include <qwt_point_3d.h> // doesn't seem necessary, but is... -#include <qwt_compat.h> -#endif - -class TimeRasterData: public QwtRasterData -{ -public: - TimeRasterData(const double rows, const double cols); - virtual ~TimeRasterData(); - - virtual void reset(); - virtual void copy(const TimeRasterData*); - - virtual void resizeData(const double rows, const double cols); - - virtual QwtRasterData *copy() const; - -#if QWT_VERSION < 0x060000 - virtual QwtDoubleInterval range() const; - virtual void setRange(const QwtDoubleInterval&); -#endif - - virtual double value(double x, double y) const; - - virtual double getNumCols()const; - virtual double getNumRows()const; - - virtual void addData(const double*, const int); - - void incrementResidual(); - -protected: - - double* d_data; - double d_rows, d_cols; - double d_resid; - int d_nitems, d_totalitems, d_data_size; - -#if QWT_VERSION < 0x060000 - QwtDoubleInterval d_intensityRange; -#else - QwtInterval d_intensityRange; -#endif - -private: - -}; - -#endif /* TIMERASTER_GLOBAL_DATA_HPP */ diff --git a/gr-qtgui/lib/time_raster_sink_b_impl.h b/gr-qtgui/lib/time_raster_sink_b_impl.h index 68dfa25aac..93d8819fdb 100644 --- a/gr-qtgui/lib/time_raster_sink_b_impl.h +++ b/gr-qtgui/lib/time_raster_sink_b_impl.h @@ -28,7 +28,7 @@ #include <fft/fft.h> #include <gruel/high_res_timer.h> #include <gruel/thread.h> -#include <timerasterdisplayform.h> +#include <qtgui/timerasterdisplayform.h> namespace gr { namespace qtgui { diff --git a/gr-qtgui/lib/time_raster_sink_c_impl.h b/gr-qtgui/lib/time_raster_sink_c_impl.h index f3594d58a5..0e95733853 100644 --- a/gr-qtgui/lib/time_raster_sink_c_impl.h +++ b/gr-qtgui/lib/time_raster_sink_c_impl.h @@ -28,7 +28,7 @@ #include <fft/fft.h> #include <gruel/high_res_timer.h> #include <gruel/thread.h> -#include <time_rasterdisplayform.h> +#include <qtgui/time_rasterdisplayform.h> namespace gr { namespace qtgui { diff --git a/gr-qtgui/lib/time_raster_sink_f_impl.h b/gr-qtgui/lib/time_raster_sink_f_impl.h index 1d7d791202..fcaab8126a 100644 --- a/gr-qtgui/lib/time_raster_sink_f_impl.h +++ b/gr-qtgui/lib/time_raster_sink_f_impl.h @@ -28,7 +28,7 @@ #include <fft/fft.h> #include <gruel/high_res_timer.h> #include <gruel/thread.h> -#include <timerasterdisplayform.h> +#include <qtgui/timerasterdisplayform.h> namespace gr { namespace qtgui { diff --git a/gr-qtgui/lib/time_sink_c_impl.h b/gr-qtgui/lib/time_sink_c_impl.h index 96bdf937b1..5a52a91316 100644 --- a/gr-qtgui/lib/time_sink_c_impl.h +++ b/gr-qtgui/lib/time_sink_c_impl.h @@ -24,7 +24,7 @@ #define INCLUDED_QTGUI_TIME_SINK_C_IMPL_H #include <qtgui/time_sink_c.h> -#include <timedisplayform.h> +#include <qtgui/timedisplayform.h> #include <gruel/thread.h> #include <gruel/high_res_timer.h> diff --git a/gr-qtgui/lib/time_sink_f_impl.h b/gr-qtgui/lib/time_sink_f_impl.h index 522511da01..3d4f6417a6 100644 --- a/gr-qtgui/lib/time_sink_f_impl.h +++ b/gr-qtgui/lib/time_sink_f_impl.h @@ -24,7 +24,7 @@ #define INCLUDED_QTGUI_TIME_SINK_F_IMPL_H #include <qtgui/time_sink_f.h> -#include <timedisplayform.h> +#include <qtgui/timedisplayform.h> #include <gruel/thread.h> #include <gruel/high_res_timer.h> diff --git a/gr-qtgui/lib/timedisplayform.cc b/gr-qtgui/lib/timedisplayform.cc index 5e1fbfb570..3ae6f93d0c 100644 --- a/gr-qtgui/lib/timedisplayform.cc +++ b/gr-qtgui/lib/timedisplayform.cc @@ -22,7 +22,7 @@ #include <cmath> #include <QMessageBox> -#include <timedisplayform.h> +#include <qtgui/timedisplayform.h> #include <iostream> TimeDisplayForm::TimeDisplayForm(int nplots, QWidget* parent) diff --git a/gr-qtgui/lib/timedisplayform.h b/gr-qtgui/lib/timedisplayform.h deleted file mode 100644 index 4bc99f622d..0000000000 --- a/gr-qtgui/lib/timedisplayform.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2011,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef TIME_DISPLAY_FORM_H -#define TIME_DISPLAY_FORM_H - -#include <spectrumUpdateEvents.h> -#include <TimeDomainDisplayPlot.h> -#include <QtGui/QtGui> -#include <vector> - -#include "displayform.h" - -class TimeDisplayForm : public DisplayForm -{ - Q_OBJECT - - public: - TimeDisplayForm(int nplots=1, QWidget* parent = 0); - ~TimeDisplayForm(); - - TimeDomainDisplayPlot* getPlot(); - - int getNPoints() const; - -public slots: - void customEvent(QEvent * e); - - void setSampleRate(const double samprate); - void setSampleRate(const QString &samprate); - void setYaxis(double min, double max); - void setNPoints(const int); - void setStem(bool en); - void autoScale(bool en); - void setSemilogx(bool en); - void setSemilogy(bool en); - -private slots: - void newData(const QEvent*); - -private: - QIntValidator* _intValidator; - - double _startFrequency; - double _stopFrequency; - - int d_npoints; - - bool d_stem; - bool d_semilogx; - bool d_semilogy; - - QAction *d_stemmenu; - QAction *d_semilogxmenu; - QAction *d_semilogymenu; -}; - -#endif /* TIME_DISPLAY_FORM_H */ diff --git a/gr-qtgui/lib/timerasterdisplayform.cc b/gr-qtgui/lib/timerasterdisplayform.cc index ed17cf45ce..50c63ad545 100644 --- a/gr-qtgui/lib/timerasterdisplayform.cc +++ b/gr-qtgui/lib/timerasterdisplayform.cc @@ -23,7 +23,7 @@ #include <cmath> #include <QColorDialog> #include <QMessageBox> -#include <timerasterdisplayform.h> +#include <qtgui/timerasterdisplayform.h> #include <iostream> TimeRasterDisplayForm::TimeRasterDisplayForm(int nplots, diff --git a/gr-qtgui/lib/timerasterdisplayform.h b/gr-qtgui/lib/timerasterdisplayform.h deleted file mode 100644 index f5341f5ecf..0000000000 --- a/gr-qtgui/lib/timerasterdisplayform.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012,2013 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef TIMERASTER_DISPLAY_FORM_H -#define TIMERASTER_DISPLAY_FORM_H - -#include <spectrumUpdateEvents.h> -#include <TimeRasterDisplayPlot.h> -#include <QtGui/QtGui> -#include <vector> -#include <filter/firdes.h> - -#include "displayform.h" - -class TimeRasterDisplayForm : public DisplayForm -{ - Q_OBJECT - - public: - TimeRasterDisplayForm(int nplots=1, - double samp_rate=1, - double rows=1, - double cols=1, - double zmax=1, - QWidget* parent = 0); - ~TimeRasterDisplayForm(); - - TimeRasterDisplayPlot* getPlot(); - - double numRows(); - double numCols(); - - int getColorMap(int which); - int getAlpha(int which); - double getMinIntensity(int which); - double getMaxIntensity(int which); - -public slots: - void customEvent(QEvent *e); - - void setNumRows(double rows); - void setNumCols(double cols); - - void setNumRows(QString rows); - void setNumCols(QString cols); - - void setSampleRate(const double samprate); - void setSampleRate(const QString &rate); - - void setIntensityRange(const double minIntensity, - const double maxIntensity); - - void setColorMap(int which, - const int newType, - const QColor lowColor=QColor("white"), - const QColor highColor=QColor("white")); - - void setAlpha(int which, int alpha); - - void autoScale(bool en=false); - -private slots: - void newData(const QEvent *updateEvent); - -private: - double _min_val; - double _max_val; -}; - -#endif /* TIMERASTER_DISPLAY_FORM_H */ diff --git a/gr-qtgui/lib/waterfallGlobalData.cc b/gr-qtgui/lib/waterfallGlobalData.cc index 8eb175b2c9..2085acf8fc 100644 --- a/gr-qtgui/lib/waterfallGlobalData.cc +++ b/gr-qtgui/lib/waterfallGlobalData.cc @@ -23,7 +23,7 @@ #ifndef WATERFALL_GLOBAL_DATA_CPP #define WATERFALL_GLOBAL_DATA_CPP -#include <waterfallGlobalData.h> +#include <qtgui/waterfallGlobalData.h> #include <cstdio> WaterfallData::WaterfallData(const double minimumFrequency, diff --git a/gr-qtgui/lib/waterfallGlobalData.h b/gr-qtgui/lib/waterfallGlobalData.h deleted file mode 100644 index 8ab9590d0b..0000000000 --- a/gr-qtgui/lib/waterfallGlobalData.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef WATERFALL_GLOBAL_DATA_HPP -#define WATERFALL_GLOBAL_DATA_HPP - -#include <qwt_raster_data.h> -#include <inttypes.h> - -#if QWT_VERSION >= 0x060000 -#include <qwt_point_3d.h> // doesn't seem necessary, but is... -#include <qwt_compat.h> -#endif - -class WaterfallData: public QwtRasterData -{ -public: - WaterfallData(const double, const double, const uint64_t, const unsigned int); - virtual ~WaterfallData(); - - virtual void reset(); - virtual void copy(const WaterfallData*); - - virtual void resizeData(const double, const double, const uint64_t); - - virtual QwtRasterData *copy() const; - -#if QWT_VERSION < 0x060000 - virtual QwtDoubleInterval range() const; - virtual void setRange(const QwtDoubleInterval&); -#endif - - virtual double value(double x, double y) const; - - virtual uint64_t getNumFFTPoints()const; - virtual void addFFTData(const double*, const uint64_t, const int); - - virtual double* getSpectrumDataBuffer()const; - virtual void setSpectrumDataBuffer(const double*); - - virtual int getNumLinesToUpdate()const; - virtual void setNumLinesToUpdate(const int); - virtual void incrementNumLinesToUpdate(); - -protected: - - double* _spectrumData; - uint64_t _fftPoints; - uint64_t _historyLength; - int _numLinesToUpdate; - -#if QWT_VERSION < 0x060000 - QwtDoubleInterval _intensityRange; -#else - QwtInterval _intensityRange; -#endif - -private: - -}; - -#endif /* WATERFALL_GLOBAL_DATA_HPP */ diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.h b/gr-qtgui/lib/waterfall_sink_c_impl.h index 1d709c6c5f..d9a90875af 100644 --- a/gr-qtgui/lib/waterfall_sink_c_impl.h +++ b/gr-qtgui/lib/waterfall_sink_c_impl.h @@ -28,7 +28,7 @@ #include <fft/fft.h> #include <gruel/high_res_timer.h> #include <gruel/thread.h> -#include <waterfalldisplayform.h> +#include <qtgui/waterfalldisplayform.h> namespace gr { namespace qtgui { diff --git a/gr-qtgui/lib/waterfall_sink_f_impl.h b/gr-qtgui/lib/waterfall_sink_f_impl.h index 6185a25397..c204ef1509 100644 --- a/gr-qtgui/lib/waterfall_sink_f_impl.h +++ b/gr-qtgui/lib/waterfall_sink_f_impl.h @@ -23,13 +23,12 @@ #ifndef INCLUDED_QTGUI_WATERFALL_SINK_F_IMPL_H #define INCLUDED_QTGUI_WATERFALL_SINK_F_IMPL_H - #include <qtgui/waterfall_sink_f.h> #include <filter/firdes.h> #include <fft/fft.h> #include <gruel/high_res_timer.h> #include <gruel/thread.h> -#include <waterfalldisplayform.h> +#include <qtgui/waterfalldisplayform.h> namespace gr { namespace qtgui { diff --git a/gr-qtgui/lib/waterfalldisplayform.cc b/gr-qtgui/lib/waterfalldisplayform.cc index e42e63fbc4..23b2a486bb 100644 --- a/gr-qtgui/lib/waterfalldisplayform.cc +++ b/gr-qtgui/lib/waterfalldisplayform.cc @@ -23,7 +23,7 @@ #include <cmath> #include <QColorDialog> #include <QMessageBox> -#include <waterfalldisplayform.h> +#include <qtgui/waterfalldisplayform.h> #include <iostream> WaterfallDisplayForm::WaterfallDisplayForm(int nplots, QWidget* parent) diff --git a/gr-qtgui/lib/waterfalldisplayform.h b/gr-qtgui/lib/waterfalldisplayform.h deleted file mode 100644 index 959f2fea68..0000000000 --- a/gr-qtgui/lib/waterfalldisplayform.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef WATERFALL_DISPLAY_FORM_H -#define WATERFALL_DISPLAY_FORM_H - -#include <spectrumUpdateEvents.h> -#include <WaterfallDisplayPlot.h> -#include <QtGui/QtGui> -#include <vector> -#include <filter/firdes.h> - -#include "displayform.h" - -class WaterfallDisplayForm : public DisplayForm -{ - Q_OBJECT - - public: - WaterfallDisplayForm(int nplots=1, QWidget* parent = 0); - ~WaterfallDisplayForm(); - - WaterfallDisplayPlot* getPlot(); - - int getFFTSize() const; - float getFFTAverage() const; - gr::filter::firdes::win_type getFFTWindowType() const; - - int getColorMap(int which); - int getAlpha(int which); - double getMinIntensity(int which); - double getMaxIntensity(int which); - - void clearData(); - -public slots: - void customEvent(QEvent *e); - - void setSampleRate(const QString &samprate); - void setFFTSize(const int); - void setFFTAverage(const float); - void setFFTWindowType(const gr::filter::firdes::win_type); - - void setFrequencyRange(const double centerfreq, - const double bandwidth); - - void setIntensityRange(const double minIntensity, - const double maxIntensity); - - void setAlpha(int which, int alpha); - - void setColorMap(int which, - const int newType, - const QColor lowColor=QColor("white"), - const QColor highColor=QColor("white")); - - void autoScale(bool en=false); - -private slots: - void newData(const QEvent *updateEvent); - -private: - uint64_t _numRealDataPoints; - QIntValidator* _intValidator; - - double _samp_rate, _center_freq; - double _time_per_slice; - int _fftsize; - float _fftavg; - gr::filter::firdes::win_type _fftwintype; - - double _min_val; - double _max_val; -}; - -#endif /* WATERFALL_DISPLAY_FORM_H */ |