GNU Radio 3.3.0 C++ API
|
00001 #ifndef TIME_DOMAIN_DISPLAY_PLOT_HPP 00002 #define TIME_DOMAIN_DISPLAY_PLOT_HPP 00003 00004 #include <cstdio> 00005 #include <qwt_plot.h> 00006 #include <qwt_painter.h> 00007 #include <qwt_plot_canvas.h> 00008 #include <qwt_plot_curve.h> 00009 #include <qwt_scale_engine.h> 00010 #include <qwt_scale_widget.h> 00011 #include <qwt_plot_zoomer.h> 00012 #include <qwt_plot_panner.h> 00013 #include <qwt_plot_marker.h> 00014 #include <highResTimeFunctions.h> 00015 #include <qwt_symbol.h> 00016 00017 class TimeDomainDisplayPlot:public QwtPlot{ 00018 Q_OBJECT 00019 00020 public: 00021 TimeDomainDisplayPlot(QWidget*); 00022 virtual ~TimeDomainDisplayPlot(); 00023 00024 void PlotNewData(const double* realDataPoints, const double* imagDataPoints, 00025 const int64_t numDataPoints, const double timeInterval); 00026 00027 void SetImaginaryDataVisible(const bool); 00028 00029 virtual void replot(); 00030 00031 void set_yaxis(double min, double max); 00032 void set_xaxis(double min, double max); 00033 00034 public slots: 00035 void resizeSlot( QSize *s ); 00036 void SetSampleRate(double sr, double units, 00037 const std::string &strunits); 00038 00039 protected slots: 00040 void LegendEntryChecked(QwtPlotItem *plotItem, bool on); 00041 00042 protected: 00043 00044 private: 00045 void _resetXAxisPoints(); 00046 00047 QwtPlotCurve* _real_plot_curve; 00048 QwtPlotCurve* _imag_plot_curve; 00049 00050 QwtPlotPanner* _panner; 00051 QwtPlotZoomer* _zoomer; 00052 00053 double* _realDataPoints; 00054 double* _imagDataPoints; 00055 double* _xAxisPoints; 00056 00057 double _sampleRate; 00058 00059 timespec _lastReplot; 00060 00061 int64_t _numPoints; 00062 }; 00063 00064 #endif /* TIME_DOMAIN_DISPLAY_PLOT_HPP */