GNU Radio 3.3.0 C++ API
|
00001 #ifndef WATERFALL_DISPLAY_PLOT_HPP 00002 #define WATERFALL_DISPLAY_PLOT_HPP 00003 00004 #include <cstdio> 00005 #include <qwt_plot.h> 00006 #include <qwt_plot_zoomer.h> 00007 #include <qwt_plot_panner.h> 00008 00009 #include <plot_waterfall.h> 00010 00011 #include <highResTimeFunctions.h> 00012 00013 class WaterfallDisplayPlot:public QwtPlot{ 00014 Q_OBJECT 00015 00016 public: 00017 WaterfallDisplayPlot(QWidget*); 00018 virtual ~WaterfallDisplayPlot(); 00019 00020 void Reset(); 00021 00022 void SetFrequencyRange(const double, const double, 00023 const double, const bool, 00024 const double units=1000.0, 00025 const std::string &strunits = "kHz"); 00026 double GetStartFrequency()const; 00027 double GetStopFrequency()const; 00028 00029 void PlotNewData(const double* dataPoints, const int64_t numDataPoints, 00030 const double timePerFFT, const timespec timestamp, 00031 const int droppedFrames); 00032 00033 void SetIntensityRange(const double minIntensity, const double maxIntensity); 00034 00035 virtual void replot(void); 00036 00037 int GetIntensityColorMapType()const; 00038 void SetIntensityColorMapType( const int, const QColor, const QColor ); 00039 const QColor GetUserDefinedLowIntensityColor()const; 00040 const QColor GetUserDefinedHighIntensityColor()const; 00041 00042 static const int INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR = 0; 00043 static const int INTENSITY_COLOR_MAP_TYPE_WHITE_HOT = 1; 00044 static const int INTENSITY_COLOR_MAP_TYPE_BLACK_HOT = 2; 00045 static const int INTENSITY_COLOR_MAP_TYPE_INCANDESCENT = 3; 00046 static const int INTENSITY_COLOR_MAP_TYPE_USER_DEFINED = 4; 00047 00048 public slots: 00049 void resizeSlot( QSize *s ); 00050 00051 signals: 00052 void UpdatedLowerIntensityLevel(const double); 00053 void UpdatedUpperIntensityLevel(const double); 00054 00055 protected: 00056 00057 private: 00058 void _UpdateIntensityRangeDisplay(); 00059 00060 double _startFrequency; 00061 double _stopFrequency; 00062 00063 PlotWaterfall *d_spectrogram; 00064 00065 QwtPlotPanner* _panner; 00066 QwtPlotZoomer* _zoomer; 00067 00068 WaterfallData* _waterfallData; 00069 00070 timespec _lastReplot; 00071 00072 bool _useCenterFrequencyFlag; 00073 00074 int64_t _numPoints; 00075 00076 int _intensityColorMapType; 00077 QColor _userDefinedLowIntensityColor; 00078 QColor _userDefinedHighIntensityColor; 00079 }; 00080 00081 #endif /* WATERFALL_DISPLAY_PLOT_HPP */