GNU Radio 3.7.1 C++ API
|
00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2012,2013 Free Software Foundation, Inc. 00004 * 00005 * This file is part of GNU Radio 00006 * 00007 * GNU Radio is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 3, or (at your option) 00010 * any later version. 00011 * 00012 * GNU Radio is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with GNU Radio; see the file COPYING. If not, write to 00019 * the Free Software Foundation, Inc., 51 Franklin Street, 00020 * Boston, MA 02110-1301, USA. 00021 */ 00022 00023 #ifndef TIMERASTER_DISPLAY_PLOT_H 00024 #define TIMERASTER_DISPLAY_PLOT_H 00025 00026 #include <stdint.h> 00027 #include <cstdio> 00028 #include <vector> 00029 #include <qwt_plot_rasteritem.h> 00030 #include <gnuradio/qtgui/DisplayPlot.h> 00031 #include <gnuradio/qtgui/timeRasterGlobalData.h> 00032 #include <gnuradio/qtgui/plot_raster.h> 00033 #include <gnuradio/high_res_timer.h> 00034 00035 #if QWT_VERSION < 0x060000 00036 #include <gnuradio/qtgui/plot_waterfall.h> 00037 #else 00038 #include <qwt_compat.h> 00039 #endif 00040 00041 /*! 00042 * \brief QWidget for time raster (time vs. time) plots. 00043 * \ingroup qtgui_blk 00044 */ 00045 class TimeRasterDisplayPlot: public DisplayPlot 00046 { 00047 Q_OBJECT 00048 00049 public: 00050 TimeRasterDisplayPlot(int nplots, 00051 double samp_rate, 00052 double rows, double cols, 00053 QWidget*); 00054 virtual ~TimeRasterDisplayPlot(); 00055 00056 void reset(); 00057 00058 void setNumRows(double rows); 00059 void setNumCols(double cols); 00060 void setAlpha(int which, int alpha); 00061 void setSampleRate(double samprate); 00062 00063 double numRows() const; 00064 double numCols() const; 00065 00066 int getAlpha(int which); 00067 00068 void setPlotDimensions(const double rows, const double cols, 00069 const double units, const std::string &strunits); 00070 00071 void plotNewData(const std::vector<double*> dataPoints, 00072 const int64_t numDataPoints); 00073 00074 void plotNewData(const double* dataPoints, 00075 const int64_t numDataPoints); 00076 00077 void setIntensityRange(const double minIntensity, 00078 const double maxIntensity); 00079 00080 void replot(void); 00081 00082 int getIntensityColorMapType(int) const; 00083 void setIntensityColorMapType(const int, const int, const QColor, const QColor); 00084 const QColor getUserDefinedLowIntensityColor() const; 00085 const QColor getUserDefinedHighIntensityColor() const; 00086 00087 double getMinIntensity(int which) const; 00088 double getMaxIntensity(int which) const; 00089 00090 signals: 00091 void updatedLowerIntensityLevel(const double); 00092 void updatedUpperIntensityLevel(const double); 00093 00094 private: 00095 void _updateIntensityRangeDisplay(); 00096 00097 std::vector<TimeRasterData*> d_data; 00098 std::vector<PlotTimeRaster*> d_raster; 00099 00100 double d_samp_rate; 00101 double d_rows, d_cols; 00102 00103 std::vector<int> d_color_map_type; 00104 QColor d_low_intensity; 00105 QColor d_high_intensity; 00106 }; 00107 00108 #endif /* TIMERASTER_DISPLAY_PLOT_H */