diff options
Diffstat (limited to 'gr-qtgui/lib')
66 files changed, 199 insertions, 3636 deletions
diff --git a/gr-qtgui/lib/CMakeLists.txt b/gr-qtgui/lib/CMakeLists.txt index 2395136e08..7114c6c390 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) @@ -103,13 +104,12 @@ include_directories( ${GR_QTGUI_INCLUDE_DIRS} ${GR_FFT_INCLUDE_DIRS} ${GR_FILTER_INCLUDE_DIRS} - ${GNURADIO_CORE_INCLUDE_DIRS} - ${GRUEL_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ${VOLK_INCLUDE_DIRS} ${QWT_INCLUDE_DIRS} ${QT_INCLUDE_DIRS} ${FFTW3F_INCLUDE_DIRS} - ${LOG4CXX_INCLUDE_DIRS} + ${LOG4CPP_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} ) @@ -117,7 +117,7 @@ include_directories( link_directories( ${QWT_LIBRARY_DIRS} ${FFTW3F_LIBRARY_DIRS} - ${LOG4CXX_LIBRARY_DIRS} + ${LOG4CPP_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS} ) @@ -132,7 +132,7 @@ endif(ENABLE_GR_CTRLPORT) # Setup library ######################################################################## list(APPEND qtgui_libs - gnuradio-core + gnuradio-runtime gnuradio-fft gnuradio-filter volk @@ -140,38 +140,10 @@ list(APPEND qtgui_libs ${QT_LIBRARIES} ${PYTHON_LIBRARIES} ${FFTW3F_LIBRARIES} - ${LOG4CXX_LIBRARIES} + ${LOG4CPP_LIBRARIES} ) 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..020cd8218a 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> @@ -126,7 +126,7 @@ SpectrumGUIClass::openSpectrumWindow(QWidget* parent, _lastGUIUpdateTime = 0; // Draw Blank Display - updateWindow(false, NULL, 0, NULL, 0, NULL, 0, gruel::high_res_timer_now(), true); + updateWindow(false, NULL, 0, NULL, 0, NULL, 0, gr::high_res_timer_now(), true); // Set up the initial frequency axis settings setFrequencyRange(_centerFrequency, _startFrequency, _stopFrequency); @@ -164,7 +164,7 @@ SpectrumGUIClass::setDisplayTitle(const std::string newString) bool SpectrumGUIClass::getWindowOpenFlag() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); bool returnFlag = false; returnFlag = _windowOpennedFlag; return returnFlag; @@ -174,7 +174,7 @@ SpectrumGUIClass::getWindowOpenFlag() void SpectrumGUIClass::setWindowOpenFlag(const bool newFlag) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _windowOpennedFlag = newFlag; } @@ -183,7 +183,7 @@ SpectrumGUIClass::setFrequencyRange(const double centerFreq, const double startFreq, const double stopFreq) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _centerFrequency = centerFreq; _startFrequency = startFreq; _stopFrequency = stopFreq; @@ -196,7 +196,7 @@ SpectrumGUIClass::setFrequencyRange(const double centerFreq, double SpectrumGUIClass::getStartFrequency() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); double returnValue = 0.0; returnValue = _startFrequency; return returnValue; @@ -205,7 +205,7 @@ SpectrumGUIClass::getStartFrequency() double SpectrumGUIClass::getStopFrequency() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); double returnValue = 0.0; returnValue = _stopFrequency; return returnValue; @@ -214,7 +214,7 @@ SpectrumGUIClass::getStopFrequency() double SpectrumGUIClass::getCenterFrequency() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); double returnValue = 0.0; returnValue = _centerFrequency; return returnValue; @@ -229,10 +229,10 @@ SpectrumGUIClass::updateWindow(const bool updateDisplayFlag, const uint64_t realTimeDomainDataSize, const float* complexTimeDomainData, const uint64_t complexTimeDomainDataSize, - const gruel::high_res_timer_type timestamp, + const gr::high_res_timer_type timestamp, const bool lastOfMultipleFFTUpdateFlag) { - //gruel::scoped_lock lock(d_mutex); + //gr::thread::scoped_lock lock(d_mutex); int64_t bufferSize = inputBufferSize; bool repeatDataFlag = false; if(bufferSize > _dataPoints){ @@ -279,10 +279,10 @@ SpectrumGUIClass::updateWindow(const bool updateDisplayFlag, _lastDataPointCount = bufferSize; } - const gruel::high_res_timer_type currentTime = gruel::high_res_timer_now(); - const gruel::high_res_timer_type lastUpdateGUITime = getLastGUIUpdateTime(); + const gr::high_res_timer_type currentTime = gr::high_res_timer_now(); + const gr::high_res_timer_type lastUpdateGUITime = getLastGUIUpdateTime(); - if((currentTime - lastUpdateGUITime > (4*_updateTime)*gruel::high_res_timer_tps()) && + if((currentTime - lastUpdateGUITime > (4*_updateTime)*gr::high_res_timer_tps()) && (getPendingGUIUpdateEvents() > 0) && lastUpdateGUITime != 0) { // Do not update the display if too much data is pending to be displayed _droppedEntriesCount++; @@ -312,7 +312,7 @@ SpectrumGUIClass::updateWindow(const bool updateDisplayFlag, float SpectrumGUIClass::getPowerValue() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); float returnValue = 0; returnValue = _powerValue; return returnValue; @@ -321,14 +321,14 @@ SpectrumGUIClass::getPowerValue() void SpectrumGUIClass::setPowerValue(const float value) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _powerValue = value; } int SpectrumGUIClass::getWindowType() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); int returnValue = 0; returnValue = _windowType; return returnValue; @@ -337,7 +337,7 @@ SpectrumGUIClass::getWindowType() void SpectrumGUIClass::setWindowType(const int newType) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _windowType = newType; } @@ -352,7 +352,7 @@ SpectrumGUIClass::getFFTSize() int SpectrumGUIClass::getFFTSizeIndex() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); int fftsize = getFFTSize(); switch(fftsize) { case(1024): return 0; break; @@ -368,30 +368,30 @@ SpectrumGUIClass::getFFTSizeIndex() void SpectrumGUIClass::setFFTSize(const int newSize) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _fftSize = newSize; } -gruel::high_res_timer_type +gr::high_res_timer_type SpectrumGUIClass::getLastGUIUpdateTime() { - gruel::scoped_lock lock(d_mutex); - gruel::high_res_timer_type returnValue; + gr::thread::scoped_lock lock(d_mutex); + gr::high_res_timer_type returnValue; returnValue = _lastGUIUpdateTime; return returnValue; } void -SpectrumGUIClass::setLastGUIUpdateTime(const gruel::high_res_timer_type newTime) +SpectrumGUIClass::setLastGUIUpdateTime(const gr::high_res_timer_type newTime) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _lastGUIUpdateTime = newTime; } unsigned int SpectrumGUIClass::getPendingGUIUpdateEvents() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); unsigned int returnValue = 0; returnValue = _pendingGUIUpdateEventsCount; return returnValue; @@ -400,14 +400,14 @@ SpectrumGUIClass::getPendingGUIUpdateEvents() void SpectrumGUIClass::incrementPendingGUIUpdateEvents() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _pendingGUIUpdateEventsCount++; } void SpectrumGUIClass::decrementPendingGUIUpdateEvents() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); if(_pendingGUIUpdateEventsCount > 0){ _pendingGUIUpdateEventsCount--; } @@ -416,7 +416,7 @@ SpectrumGUIClass::decrementPendingGUIUpdateEvents() void SpectrumGUIClass::resetPendingGUIUpdateEvents() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _pendingGUIUpdateEventsCount = 0; } @@ -424,14 +424,14 @@ SpectrumGUIClass::resetPendingGUIUpdateEvents() QWidget* SpectrumGUIClass::qwidget() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); return (QWidget*)_spectrumDisplayForm; } void SpectrumGUIClass::setTimeDomainAxis(double min, double max) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _spectrumDisplayForm->setTimeDomainAxis(min, max); } @@ -439,14 +439,14 @@ void SpectrumGUIClass::setConstellationAxis(double xmin, double xmax, double ymin, double ymax) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _spectrumDisplayForm->setConstellationAxis(xmin, xmax, ymin, ymax); } void SpectrumGUIClass::setConstellationPenSize(int size) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _spectrumDisplayForm->setConstellationPenSize(size); } @@ -454,14 +454,14 @@ SpectrumGUIClass::setConstellationPenSize(int size) void SpectrumGUIClass::setFrequencyAxis(double min, double max) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _spectrumDisplayForm->setFrequencyAxis(min, max); } void SpectrumGUIClass::setUpdateTime(double t) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); _updateTime = t; _spectrumDisplayForm->setUpdateTime(_updateTime); } 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..aa78000741 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> @@ -264,7 +264,7 @@ void WaterfallDisplayPlot::plotNewData(const std::vector<double*> dataPoints, const int64_t numDataPoints, const double timePerFFT, - const gruel::high_res_timer_type timestamp, + const gr::high_res_timer_type timestamp, const int droppedFrames) { if(!_stop) { @@ -283,7 +283,7 @@ WaterfallDisplayPlot::plotNewData(const std::vector<double*> dataPoints, replot(); } - _lastReplot = gruel::high_res_timer_now(); + _lastReplot = gr::high_res_timer_now(); } for(int i = 0; i < _nplots; i++) { @@ -312,7 +312,7 @@ void WaterfallDisplayPlot::plotNewData(const double* dataPoints, const int64_t numDataPoints, const double timePerFFT, - const gruel::high_res_timer_type timestamp, + const gr::high_res_timer_type timestamp, const int droppedFrames) { std::vector<double*> vecDataPoints; @@ -569,7 +569,7 @@ WaterfallDisplayPlot::_updateIntensityRangeDisplay() replot(); // Update the last replot timer - _lastReplot = gruel::high_res_timer_now(); + _lastReplot = gr::high_res_timer_now(); } #endif /* WATERFALL_DISPLAY_PLOT_C */ 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.cc b/gr-qtgui/lib/const_sink_c_impl.cc index b623dc2175..9064be4ebe 100644 --- a/gr-qtgui/lib/const_sink_c_impl.cc +++ b/gr-qtgui/lib/const_sink_c_impl.cc @@ -145,7 +145,7 @@ namespace gr { const_sink_c_impl::set_update_time(double t) { //convert update time to ticks - gruel::high_res_timer_type tps = gruel::high_res_timer_tps(); + gr::high_res_timer_type tps = gr::high_res_timer_tps(); d_update_time = t * tps; d_main_gui->setUpdateTime(t); d_last_time = 0; @@ -244,7 +244,7 @@ namespace gr { void const_sink_c_impl::set_nsamps(const int newsize) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); if(newsize != d_size) { // Resize residbuf and replace data @@ -325,8 +325,8 @@ namespace gr { } // Update the plot if its time - if(gruel::high_res_timer_now() - d_last_time > d_update_time) { - d_last_time = gruel::high_res_timer_now(); + if(gr::high_res_timer_now() - d_last_time > d_update_time) { + d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, new ConstUpdateEvent(d_residbufs_real, d_residbufs_imag, diff --git a/gr-qtgui/lib/const_sink_c_impl.h b/gr-qtgui/lib/const_sink_c_impl.h index 81cdb9881f..02b25409e6 100644 --- a/gr-qtgui/lib/const_sink_c_impl.h +++ b/gr-qtgui/lib/const_sink_c_impl.h @@ -24,9 +24,9 @@ #define INCLUDED_QTGUI_CONST_SINK_C_IMPL_H #include <qtgui/const_sink_c.h> -#include <gruel/high_res_timer.h> -#include <gruel/thread.h> -#include <constellationdisplayform.h> +#include <high_res_timer.h> +#include <thread/thread.h> +#include <qtgui/constellationdisplayform.h> namespace gr { namespace qtgui { @@ -36,7 +36,7 @@ namespace gr { private: void initialize(); - gruel::mutex d_mutex; + gr::thread::mutex d_mutex; int d_size; std::string d_name; @@ -49,8 +49,8 @@ namespace gr { QWidget *d_parent; ConstellationDisplayForm *d_main_gui; - gruel::high_res_timer_type d_update_time; - gruel::high_res_timer_type d_last_time; + gr::high_res_timer_type d_update_time; + gr::high_res_timer_type d_last_time; void npoints_resize(); 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..3439db31ee 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> @@ -151,7 +151,7 @@ void DisplayForm::mousePressEvent( QMouseEvent * e) { bool ctrloff = Qt::ControlModifier != QApplication::keyboardModifiers(); - if((e->button() == Qt::MiddleButton) && ctrloff && (_menu_on)) { + if((e->button() == Qt::MidButton) && ctrloff && (_menu_on)) { if(_stop_state == false) _stop_act->setText(tr("Stop")); else 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.cc b/gr-qtgui/lib/freq_sink_c_impl.cc index b1f9a2b1a1..4508750457 100644 --- a/gr-qtgui/lib/freq_sink_c_impl.cc +++ b/gr-qtgui/lib/freq_sink_c_impl.cc @@ -208,7 +208,7 @@ namespace gr { freq_sink_c_impl::set_update_time(double t) { //convert update time to ticks - gruel::high_res_timer_type tps = gruel::high_res_timer_tps(); + gr::high_res_timer_type tps = gr::high_res_timer_tps(); d_update_time = t * tps; d_main_gui->setUpdateTime(t); d_last_time = 0; @@ -376,7 +376,7 @@ namespace gr { void freq_sink_c_impl::fftresize() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); int newfftsize = d_main_gui->getFFTSize(); d_fftavg = d_main_gui->getFFTAverage(); @@ -443,8 +443,8 @@ namespace gr { //volk_32f_convert_64f_a(d_magbufs[n], d_fbuf, d_fftsize); } - if(gruel::high_res_timer_now() - d_last_time > d_update_time) { - d_last_time = gruel::high_res_timer_now(); + if(gr::high_res_timer_now() - d_last_time > d_update_time) { + d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, new FreqUpdateEvent(d_magbufs, d_fftsize)); } diff --git a/gr-qtgui/lib/freq_sink_c_impl.h b/gr-qtgui/lib/freq_sink_c_impl.h index 0567b914c8..ef17079567 100644 --- a/gr-qtgui/lib/freq_sink_c_impl.h +++ b/gr-qtgui/lib/freq_sink_c_impl.h @@ -26,9 +26,9 @@ #include <qtgui/freq_sink_c.h> #include <filter/firdes.h> #include <fft/fft.h> -#include <gruel/high_res_timer.h> -#include <gruel/thread.h> -#include <freqdisplayform.h> +#include <high_res_timer.h> +#include <thread/thread.h> +#include <qtgui/freqdisplayform.h> namespace gr { namespace qtgui { @@ -40,7 +40,7 @@ namespace gr { void initialize(); - gruel::mutex d_mutex; + gr::thread::mutex d_mutex; int d_fftsize; float d_fftavg; @@ -62,8 +62,8 @@ namespace gr { QWidget *d_parent; FreqDisplayForm *d_main_gui; - gruel::high_res_timer_type d_update_time; - gruel::high_res_timer_type d_last_time; + gr::high_res_timer_type d_update_time; + gr::high_res_timer_type d_last_time; void windowreset(); void buildwindow(); diff --git a/gr-qtgui/lib/freq_sink_f_impl.cc b/gr-qtgui/lib/freq_sink_f_impl.cc index f357ae10be..6028c8ec4e 100644 --- a/gr-qtgui/lib/freq_sink_f_impl.cc +++ b/gr-qtgui/lib/freq_sink_f_impl.cc @@ -208,7 +208,7 @@ namespace gr { freq_sink_f_impl::set_update_time(double t) { //convert update time to ticks - gruel::high_res_timer_type tps = gruel::high_res_timer_tps(); + gr::high_res_timer_type tps = gr::high_res_timer_tps(); d_update_time = t * tps; d_main_gui->setUpdateTime(t); d_last_time = 0; @@ -357,7 +357,7 @@ namespace gr { void freq_sink_f_impl::windowreset() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); filter::firdes::win_type newwintype; newwintype = d_main_gui->getFFTWindowType(); @@ -379,7 +379,7 @@ namespace gr { void freq_sink_f_impl::fftresize() { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); int newfftsize = d_main_gui->getFFTSize(); d_fftavg = d_main_gui->getFFTAverage(); @@ -446,8 +446,8 @@ namespace gr { //volk_32f_convert_64f_a(d_magbufs[n], d_fbuf, d_fftsize); } - if(gruel::high_res_timer_now() - d_last_time > d_update_time) { - d_last_time = gruel::high_res_timer_now(); + if(gr::high_res_timer_now() - d_last_time > d_update_time) { + d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, new FreqUpdateEvent(d_magbufs, d_fftsize)); } diff --git a/gr-qtgui/lib/freq_sink_f_impl.h b/gr-qtgui/lib/freq_sink_f_impl.h index b79127f3dd..6f4d9d2062 100644 --- a/gr-qtgui/lib/freq_sink_f_impl.h +++ b/gr-qtgui/lib/freq_sink_f_impl.h @@ -26,9 +26,9 @@ #include <qtgui/freq_sink_f.h> #include <filter/firdes.h> #include <fft/fft.h> -#include <gruel/high_res_timer.h> -#include <gruel/thread.h> -#include <freqdisplayform.h> +#include <high_res_timer.h> +#include <thread/thread.h> +#include <qtgui/freqdisplayform.h> namespace gr { namespace qtgui { @@ -40,7 +40,7 @@ namespace gr { void initialize(); - gruel::mutex d_mutex; + gr::thread::mutex d_mutex; int d_fftsize; float d_fftavg; @@ -62,8 +62,8 @@ namespace gr { QWidget *d_parent; FreqDisplayForm *d_main_gui; - gruel::high_res_timer_type d_update_time; - gruel::high_res_timer_type d_last_time; + gr::high_res_timer_type d_update_time; + gr::high_res_timer_type d_last_time; void windowreset(); void buildwindow(); 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.cc b/gr-qtgui/lib/sink_c_impl.cc index a8a0526e77..aab5be54bf 100644 --- a/gr-qtgui/lib/sink_c_impl.cc +++ b/gr-qtgui/lib/sink_c_impl.cc @@ -137,7 +137,7 @@ namespace gr { // initialize update time to 10 times a second set_update_time(0.5); - d_last_update = gruel::high_res_timer_now(); + d_last_update = gr::high_res_timer_now(); d_update_active = false; } @@ -215,7 +215,7 @@ namespace gr { void sink_c_impl::set_update_time(double t) { - d_update_time = t * gruel::high_res_timer_tps(); + d_update_time = t * gr::high_res_timer_tps(); d_main_gui->setUpdateTime(t); } @@ -300,18 +300,18 @@ namespace gr { unsigned int datasize = noutput_items - i; unsigned int resid = d_fftsize-d_index; - if (!d_update_active && (gruel::high_res_timer_now() - d_last_update) < d_update_time) { + if (!d_update_active && (gr::high_res_timer_now() - d_last_update) < d_update_time) { consume_each(noutput_items); return noutput_items; } else { - d_last_update = gruel::high_res_timer_now(); + d_last_update = gr::high_res_timer_now(); d_update_active = true; } // If we have enough input for one full FFT, do it if(datasize >= resid) { - const gruel::high_res_timer_type currentTime = gruel::high_res_timer_now(); + const gr::high_res_timer_type currentTime = gr::high_res_timer_now(); // Fill up residbuf with d_fftsize number of items memcpy(d_residbuf+d_index, &in[j], sizeof(gr_complex)*resid); diff --git a/gr-qtgui/lib/sink_c_impl.h b/gr-qtgui/lib/sink_c_impl.h index ddfb0865d5..77ddf79a0e 100644 --- a/gr-qtgui/lib/sink_c_impl.h +++ b/gr-qtgui/lib/sink_c_impl.h @@ -26,8 +26,8 @@ #include <qtgui/sink_c.h> #include <filter/firdes.h> #include <fft/fft.h> -#include <gruel/high_res_timer.h> -#include <SpectrumGUIClass.h> +#include <high_res_timer.h> +#include <qtgui/SpectrumGUIClass.h> namespace gr { namespace qtgui { @@ -45,7 +45,7 @@ namespace gr { double d_center_freq; double d_bandwidth; std::string d_name; - gruel::high_res_timer_type d_last_update; + gr::high_res_timer_type d_last_update; bool d_update_active; bool d_shift; @@ -57,7 +57,7 @@ namespace gr { bool d_plotfreq, d_plotwaterfall, d_plottime, d_plotconst; - gruel::high_res_timer_type d_update_time; + gr::high_res_timer_type d_update_time; QWidget *d_parent; SpectrumGUIClass *d_main_gui; diff --git a/gr-qtgui/lib/sink_f_impl.cc b/gr-qtgui/lib/sink_f_impl.cc index 5cb14db672..1fb2bbdbb7 100644 --- a/gr-qtgui/lib/sink_f_impl.cc +++ b/gr-qtgui/lib/sink_f_impl.cc @@ -297,7 +297,7 @@ namespace gr { // If we have enough input for one full FFT, do it if(datasize >= resid) { - const gruel::high_res_timer_type currentTime = gruel::high_res_timer_now(); + const gr::high_res_timer_type currentTime = gr::high_res_timer_now(); // Fill up residbuf with d_fftsize number of items memcpy(d_residbuf+d_index, &in[j], sizeof(float)*resid); diff --git a/gr-qtgui/lib/sink_f_impl.h b/gr-qtgui/lib/sink_f_impl.h index 394d5c3428..24dff8d6b3 100644 --- a/gr-qtgui/lib/sink_f_impl.h +++ b/gr-qtgui/lib/sink_f_impl.h @@ -26,8 +26,8 @@ #include <qtgui/sink_f.h> #include <filter/firdes.h> #include <fft/fft.h> -#include <gruel/high_res_timer.h> -#include <SpectrumGUIClass.h> +#include <high_res_timer.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..21b1f4d6d9 100644 --- a/gr-qtgui/lib/spectrumUpdateEvents.cc +++ b/gr-qtgui/lib/spectrumUpdateEvents.cc @@ -23,17 +23,17 @@ #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, const double* realTimeDomainPoints, const double* imagTimeDomainPoints, const uint64_t numTimeDomainDataPoints, - const gruel::high_res_timer_type dataTimestamp, + const gr::high_res_timer_type dataTimestamp, const bool repeatDataFlag, const bool lastOfMultipleUpdateFlag, - const gruel::high_res_timer_type generatedTimestamp, + const gr::high_res_timer_type generatedTimestamp, const int droppedFFTFrames) : QEvent(QEvent::Type(SpectrumUpdateEventType)) { @@ -112,7 +112,7 @@ SpectrumUpdateEvent::getNumTimeDomainDataPoints() const return _numTimeDomainDataPoints; } -gruel::high_res_timer_type +gr::high_res_timer_type SpectrumUpdateEvent::getDataTimestamp() const { return _dataTimestamp; @@ -130,7 +130,7 @@ SpectrumUpdateEvent::getLastOfMultipleUpdateFlag() const return _lastOfMultipleUpdateFlag; } -gruel::high_res_timer_type +gr::high_res_timer_type SpectrumUpdateEvent::getEventGeneratedTimestamp() const { return _eventGeneratedTimestamp; @@ -348,7 +348,7 @@ ConstUpdateEvent::getNumDataPoints() const WaterfallUpdateEvent::WaterfallUpdateEvent(const std::vector<double*> dataPoints, const uint64_t numDataPoints, - const gruel::high_res_timer_type dataTimestamp) + const gr::high_res_timer_type dataTimestamp) : QEvent(QEvent::Type(SpectrumUpdateEventType)) { if(numDataPoints < 1) { @@ -389,7 +389,7 @@ WaterfallUpdateEvent::getNumDataPoints() const return _numDataPoints; } -gruel::high_res_timer_type +gr::high_res_timer_type WaterfallUpdateEvent::getDataTimestamp() const { return _dataTimestamp; 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..24f15886ba 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) @@ -192,10 +192,10 @@ SpectrumDisplayForm::newFrequencyData( const SpectrumUpdateEvent* spectrumUpdate const float* fftMagDataPoints = spectrumUpdateEvent->getFFTPoints(); const uint64_t numFFTDataPoints = spectrumUpdateEvent->getNumFFTDataPoints(); const uint64_t numTimeDomainDataPoints = spectrumUpdateEvent->getNumTimeDomainDataPoints(); - const gruel::high_res_timer_type dataTimestamp = spectrumUpdateEvent->getDataTimestamp(); + const gr::high_res_timer_type dataTimestamp = spectrumUpdateEvent->getDataTimestamp(); const bool repeatDataFlag = spectrumUpdateEvent->getRepeatDataFlag(); const bool lastOfMultipleUpdatesFlag = spectrumUpdateEvent->getLastOfMultipleUpdateFlag(); - const gruel::high_res_timer_type generatedTimestamp = spectrumUpdateEvent->getEventGeneratedTimestamp(); + const gr::high_res_timer_type generatedTimestamp = spectrumUpdateEvent->getEventGeneratedTimestamp(); double* realTimeDomainDataPoints = (double*)spectrumUpdateEvent->getRealTimeDomainPoints(); double* imagTimeDomainDataPoints = (double*)spectrumUpdateEvent->getImagTimeDomainPoints(); 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.cc b/gr-qtgui/lib/time_raster_sink_b_impl.cc index d90661b968..6ec6c6075b 100644 --- a/gr-qtgui/lib/time_raster_sink_b_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_b_impl.cc @@ -153,7 +153,7 @@ namespace gr { time_raster_sink_b_impl::set_update_time(double t) { //convert update time to ticks - gruel::high_res_timer_type tps = gruel::high_res_timer_tps(); + gr::high_res_timer_type tps = gr::high_res_timer_tps(); d_update_time = t * tps; d_main_gui->setUpdateTime(t); d_last_time = 0; @@ -404,8 +404,8 @@ namespace gr { d_tmpflt, resid); } - if(gruel::high_res_timer_now() - d_last_time > d_update_time) { - d_last_time = gruel::high_res_timer_now(); + if(gr::high_res_timer_now() - d_last_time > d_update_time) { + d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, new TimeRasterUpdateEvent(d_residbufs, d_icols)); } diff --git a/gr-qtgui/lib/time_raster_sink_b_impl.h b/gr-qtgui/lib/time_raster_sink_b_impl.h index 68dfa25aac..09c471fcfc 100644 --- a/gr-qtgui/lib/time_raster_sink_b_impl.h +++ b/gr-qtgui/lib/time_raster_sink_b_impl.h @@ -26,9 +26,9 @@ #include <qtgui/time_raster_sink_b.h> #include <filter/firdes.h> #include <fft/fft.h> -#include <gruel/high_res_timer.h> -#include <gruel/thread.h> -#include <timerasterdisplayform.h> +#include <high_res_timer.h> +#include <thread/thread.h> +#include <qtgui/timerasterdisplayform.h> namespace gr { namespace qtgui { @@ -56,8 +56,8 @@ namespace gr { std::vector<float> d_offset; double d_samp_rate; - gruel::high_res_timer_type d_update_time; - gruel::high_res_timer_type d_last_time; + gr::high_res_timer_type d_update_time; + gr::high_res_timer_type d_last_time; public: time_raster_sink_b_impl(double samp_rate, diff --git a/gr-qtgui/lib/time_raster_sink_c_impl.cc b/gr-qtgui/lib/time_raster_sink_c_impl.cc index 17098f0d93..1c71258030 100644 --- a/gr-qtgui/lib/time_raster_sink_c_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_c_impl.cc @@ -126,7 +126,7 @@ namespace gr { time_raster_sink_c_impl::set_update_time(double t) { //convert update time to ticks - gruel::high_res_timer_type tps = gruel::high_res_timer_tps(); + gr::high_res_timer_type tps = gr::high_res_timer_tps(); d_update_time = t * tps; d_main_gui->setUpdateTime(t); } @@ -193,8 +193,8 @@ namespace gr { memcpy(d_residbufs[n]+d_index, &in[j], sizeof(gr_complex)*resid); } - if(gruel::high_res_timer_now() - d_last_time > d_update_time) { - d_last_time = gruel::high_res_timer_now(); + if(gr::high_res_timer_now() - d_last_time > d_update_time) { + d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, new TimeRasterUpdateEvent(d_residbufs, d_fftsize, diff --git a/gr-qtgui/lib/time_raster_sink_c_impl.h b/gr-qtgui/lib/time_raster_sink_c_impl.h index f3594d58a5..9f8a463bf8 100644 --- a/gr-qtgui/lib/time_raster_sink_c_impl.h +++ b/gr-qtgui/lib/time_raster_sink_c_impl.h @@ -26,9 +26,9 @@ #include <qtgui/time_raster_sink_c.h> #include <filter/firdes.h> #include <fft/fft.h> -#include <gruel/high_res_timer.h> -#include <gruel/thread.h> -#include <time_rasterdisplayform.h> +#include <high_res_timer.h> +#include <thread/thread.h> +#include <qtgui/time_rasterdisplayform.h> namespace gr { namespace qtgui { @@ -52,8 +52,8 @@ namespace gr { unsigned int d_rows, d_cols; - gruel::high_res_timer_type d_update_time; - gruel::high_res_timer_type d_last_time; + gr::high_res_timer_type d_update_time; + gr::high_res_timer_type d_last_time; public: time_raster_sink_c_impl(unsignedint rows, diff --git a/gr-qtgui/lib/time_raster_sink_f_impl.cc b/gr-qtgui/lib/time_raster_sink_f_impl.cc index 39237e2912..b6b0a1fc7d 100644 --- a/gr-qtgui/lib/time_raster_sink_f_impl.cc +++ b/gr-qtgui/lib/time_raster_sink_f_impl.cc @@ -151,7 +151,7 @@ namespace gr { time_raster_sink_f_impl::set_update_time(double t) { //convert update time to ticks - gruel::high_res_timer_type tps = gruel::high_res_timer_tps(); + gr::high_res_timer_type tps = gr::high_res_timer_tps(); d_update_time = t * tps; d_main_gui->setUpdateTime(t); d_last_time = 0; @@ -401,8 +401,8 @@ namespace gr { } // Update the plot if its time - if(gruel::high_res_timer_now() - d_last_time > d_update_time) { - d_last_time = gruel::high_res_timer_now(); + if(gr::high_res_timer_now() - d_last_time > d_update_time) { + d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, new TimeRasterUpdateEvent(d_residbufs, d_cols)); } diff --git a/gr-qtgui/lib/time_raster_sink_f_impl.h b/gr-qtgui/lib/time_raster_sink_f_impl.h index 1d7d791202..fad731570c 100644 --- a/gr-qtgui/lib/time_raster_sink_f_impl.h +++ b/gr-qtgui/lib/time_raster_sink_f_impl.h @@ -26,9 +26,9 @@ #include <qtgui/time_raster_sink_f.h> #include <filter/firdes.h> #include <fft/fft.h> -#include <gruel/high_res_timer.h> -#include <gruel/thread.h> -#include <timerasterdisplayform.h> +#include <high_res_timer.h> +#include <thread/thread.h> +#include <qtgui/timerasterdisplayform.h> namespace gr { namespace qtgui { @@ -55,8 +55,8 @@ namespace gr { std::vector<float> d_offset; double d_samp_rate; - gruel::high_res_timer_type d_update_time; - gruel::high_res_timer_type d_last_time; + gr::high_res_timer_type d_update_time; + gr::high_res_timer_type d_last_time; public: time_raster_sink_f_impl(double samp_rate, diff --git a/gr-qtgui/lib/time_sink_c_impl.cc b/gr-qtgui/lib/time_sink_c_impl.cc index 2edb83fa12..f8ff758218 100644 --- a/gr-qtgui/lib/time_sink_c_impl.cc +++ b/gr-qtgui/lib/time_sink_c_impl.cc @@ -138,7 +138,7 @@ namespace gr { time_sink_c_impl::set_update_time(double t) { //convert update time to ticks - gruel::high_res_timer_type tps = gruel::high_res_timer_tps(); + gr::high_res_timer_type tps = gr::high_res_timer_tps(); d_update_time = t * tps; d_main_gui->setUpdateTime(t); d_last_time = 0; @@ -237,7 +237,7 @@ namespace gr { void time_sink_c_impl::set_nsamps(const int newsize) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); if(newsize != d_size) { // Resize residbuf and replace data @@ -260,7 +260,7 @@ namespace gr { void time_sink_c_impl::set_samp_rate(const double samp_rate) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); d_samp_rate = samp_rate; d_main_gui->setSampleRate(d_samp_rate); } @@ -347,8 +347,8 @@ namespace gr { } // Update the plot if its time - if(gruel::high_res_timer_now() - d_last_time > d_update_time) { - d_last_time = gruel::high_res_timer_now(); + if(gr::high_res_timer_now() - d_last_time > d_update_time) { + d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, new TimeUpdateEvent(d_residbufs, d_size)); } diff --git a/gr-qtgui/lib/time_sink_c_impl.h b/gr-qtgui/lib/time_sink_c_impl.h index 96bdf937b1..2f9765c2c5 100644 --- a/gr-qtgui/lib/time_sink_c_impl.h +++ b/gr-qtgui/lib/time_sink_c_impl.h @@ -24,9 +24,9 @@ #define INCLUDED_QTGUI_TIME_SINK_C_IMPL_H #include <qtgui/time_sink_c.h> -#include <timedisplayform.h> -#include <gruel/thread.h> -#include <gruel/high_res_timer.h> +#include <qtgui/timedisplayform.h> +#include <thread/thread.h> +#include <high_res_timer.h> namespace gr { namespace qtgui { @@ -36,7 +36,7 @@ namespace gr { private: void initialize(); - gruel::mutex d_mutex; + gr::thread::mutex d_mutex; int d_size; double d_samp_rate; @@ -49,8 +49,8 @@ namespace gr { QWidget *d_parent; TimeDisplayForm *d_main_gui; - gruel::high_res_timer_type d_update_time; - gruel::high_res_timer_type d_last_time; + gr::high_res_timer_type d_update_time; + gr::high_res_timer_type d_last_time; void npoints_resize(); diff --git a/gr-qtgui/lib/time_sink_f_impl.cc b/gr-qtgui/lib/time_sink_f_impl.cc index 39a62d3d6b..6011751b2b 100644 --- a/gr-qtgui/lib/time_sink_f_impl.cc +++ b/gr-qtgui/lib/time_sink_f_impl.cc @@ -138,7 +138,7 @@ namespace gr { time_sink_f_impl::set_update_time(double t) { //convert update time to ticks - gruel::high_res_timer_type tps = gruel::high_res_timer_tps(); + gr::high_res_timer_type tps = gr::high_res_timer_tps(); d_update_time = t * tps; d_main_gui->setUpdateTime(t); d_last_time = 0; @@ -237,7 +237,7 @@ namespace gr { void time_sink_f_impl::set_nsamps(const int newsize) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); if(newsize != d_size) { // Resize residbuf and replace data @@ -260,7 +260,7 @@ namespace gr { void time_sink_f_impl::set_samp_rate(const double samp_rate) { - gruel::scoped_lock lock(d_mutex); + gr::thread::scoped_lock lock(d_mutex); d_samp_rate = samp_rate; d_main_gui->setSampleRate(d_samp_rate); } @@ -346,8 +346,8 @@ namespace gr { } // Update the plot if its time - if(gruel::high_res_timer_now() - d_last_time > d_update_time) { - d_last_time = gruel::high_res_timer_now(); + if(gr::high_res_timer_now() - d_last_time > d_update_time) { + d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, new TimeUpdateEvent(d_residbufs, d_size)); } diff --git a/gr-qtgui/lib/time_sink_f_impl.h b/gr-qtgui/lib/time_sink_f_impl.h index 522511da01..1012ffbd77 100644 --- a/gr-qtgui/lib/time_sink_f_impl.h +++ b/gr-qtgui/lib/time_sink_f_impl.h @@ -24,9 +24,9 @@ #define INCLUDED_QTGUI_TIME_SINK_F_IMPL_H #include <qtgui/time_sink_f.h> -#include <timedisplayform.h> -#include <gruel/thread.h> -#include <gruel/high_res_timer.h> +#include <qtgui/timedisplayform.h> +#include <thread/thread.h> +#include <high_res_timer.h> namespace gr { namespace qtgui { @@ -36,7 +36,7 @@ namespace gr { private: void initialize(); - gruel::mutex d_mutex; + gr::thread::mutex d_mutex; int d_size; double d_samp_rate; @@ -49,8 +49,8 @@ namespace gr { QWidget *d_parent; TimeDisplayForm *d_main_gui; - gruel::high_res_timer_type d_update_time; - gruel::high_res_timer_type d_last_time; + gr::high_res_timer_type d_update_time; + gr::high_res_timer_type d_last_time; void npoints_resize(); 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.cc b/gr-qtgui/lib/waterfall_sink_c_impl.cc index 72908b51b9..817a5a126e 100644 --- a/gr-qtgui/lib/waterfall_sink_c_impl.cc +++ b/gr-qtgui/lib/waterfall_sink_c_impl.cc @@ -214,7 +214,7 @@ namespace gr { waterfall_sink_c_impl::set_update_time(double t) { //convert update time to ticks - gruel::high_res_timer_type tps = gruel::high_res_timer_tps(); + gr::high_res_timer_type tps = gr::high_res_timer_tps(); d_update_time = t * tps; d_main_gui->setUpdateTime(t); d_last_time = 0; @@ -417,8 +417,8 @@ namespace gr { //volk_32f_convert_64f_a(d_magbufs[n], d_fbuf, d_fftsize); } - if(gruel::high_res_timer_now() - d_last_time > d_update_time) { - d_last_time = gruel::high_res_timer_now(); + if(gr::high_res_timer_now() - d_last_time > d_update_time) { + d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, new WaterfallUpdateEvent(d_magbufs, d_fftsize, diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.h b/gr-qtgui/lib/waterfall_sink_c_impl.h index 1d709c6c5f..7483989c00 100644 --- a/gr-qtgui/lib/waterfall_sink_c_impl.h +++ b/gr-qtgui/lib/waterfall_sink_c_impl.h @@ -26,9 +26,9 @@ #include <qtgui/waterfall_sink_c.h> #include <filter/firdes.h> #include <fft/fft.h> -#include <gruel/high_res_timer.h> -#include <gruel/thread.h> -#include <waterfalldisplayform.h> +#include <high_res_timer.h> +#include <thread/thread.h> +#include <qtgui/waterfalldisplayform.h> namespace gr { namespace qtgui { @@ -60,8 +60,8 @@ namespace gr { QWidget *d_parent; WaterfallDisplayForm *d_main_gui; - gruel::high_res_timer_type d_update_time; - gruel::high_res_timer_type d_last_time; + gr::high_res_timer_type d_update_time; + gr::high_res_timer_type d_last_time; void windowreset(); void buildwindow(); diff --git a/gr-qtgui/lib/waterfall_sink_f_impl.cc b/gr-qtgui/lib/waterfall_sink_f_impl.cc index bdf1159e5a..aad2ffe5c7 100644 --- a/gr-qtgui/lib/waterfall_sink_f_impl.cc +++ b/gr-qtgui/lib/waterfall_sink_f_impl.cc @@ -213,7 +213,7 @@ namespace gr { waterfall_sink_f_impl::set_update_time(double t) { //convert update time to ticks - gruel::high_res_timer_type tps = gruel::high_res_timer_tps(); + gr::high_res_timer_type tps = gr::high_res_timer_tps(); d_update_time = t * tps; d_main_gui->setUpdateTime(t); d_last_time = 0; @@ -418,8 +418,8 @@ namespace gr { //volk_32f_convert_64f_a(d_magbufs[n], d_fbuf, d_fftsize); } - if(gruel::high_res_timer_now() - d_last_time > d_update_time) { - d_last_time = gruel::high_res_timer_now(); + if(gr::high_res_timer_now() - d_last_time > d_update_time) { + d_last_time = gr::high_res_timer_now(); d_qApplication->postEvent(d_main_gui, new WaterfallUpdateEvent(d_magbufs, d_fftsize, diff --git a/gr-qtgui/lib/waterfall_sink_f_impl.h b/gr-qtgui/lib/waterfall_sink_f_impl.h index 6185a25397..02556fd9d6 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 <high_res_timer.h> +#include <thread/thread.h> +#include <qtgui/waterfalldisplayform.h> namespace gr { namespace qtgui { @@ -61,8 +60,8 @@ namespace gr { QWidget *d_parent; WaterfallDisplayForm *d_main_gui; - gruel::high_res_timer_type d_update_time; - gruel::high_res_timer_type d_last_time; + gr::high_res_timer_type d_update_time; + gr::high_res_timer_type d_last_time; void windowreset(); void buildwindow(); diff --git a/gr-qtgui/lib/waterfalldisplayform.cc b/gr-qtgui/lib/waterfalldisplayform.cc index e42e63fbc4..fb5df230c2 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) @@ -115,7 +115,7 @@ WaterfallDisplayForm::newData(const QEvent *updateEvent) WaterfallUpdateEvent *event = (WaterfallUpdateEvent*)updateEvent; const std::vector<double*> dataPoints = event->getPoints(); const uint64_t numDataPoints = event->getNumDataPoints(); - const gruel::high_res_timer_type dataTimestamp = event->getDataTimestamp(); + const gr::high_res_timer_type dataTimestamp = event->getDataTimestamp(); _min_val = 1000; _max_val = -1000; 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 */ |