8d98abac6d422ee99881c665cfe76ae73f427a49
[debian/gnuradio] / gr-qtgui / src / lib / TimeDomainDisplayPlot.h
1 #ifndef TIME_DOMAIN_DISPLAY_PLOT_HPP
2 #define TIME_DOMAIN_DISPLAY_PLOT_HPP
3
4 #include <cstdio>
5 #include <qwt_plot.h>
6 #include <qwt_painter.h>
7 #include <qwt_plot_canvas.h>
8 #include <qwt_plot_curve.h>
9 #include <qwt_scale_engine.h>
10 #include <qwt_scale_widget.h>
11 #include <qwt_plot_zoomer.h>
12 #include <qwt_plot_panner.h>
13 #include <qwt_plot_marker.h>
14 #include <highResTimeFunctions.h>
15 #include <qwt_symbol.h>
16
17 class TimeDomainDisplayPlot:public QwtPlot{
18   Q_OBJECT
19
20 public:
21   TimeDomainDisplayPlot(QWidget*);
22   virtual ~TimeDomainDisplayPlot();
23
24   void PlotNewData(const double* realDataPoints, const double* imagDataPoints, const int64_t numDataPoints);
25     
26   void SetImaginaryDataVisible(const bool);
27                                    
28   virtual void replot();
29
30   void set_yaxis(double min, double max);
31   void set_xaxis(double min, double max);
32
33 public slots:
34   void resizeSlot( QSize *s );
35
36 protected slots:
37   void LegendEntryChecked(QwtPlotItem *plotItem, bool on);
38
39 protected:
40
41 private:
42   void _resetXAxisPoints();
43
44   QwtPlotCurve* _real_plot_curve;
45   QwtPlotCurve* _imag_plot_curve;
46
47   QwtPlotPanner* _panner;
48   QwtPlotZoomer* _zoomer;
49   
50   double* _realDataPoints;
51   double* _imagDataPoints;
52   double* _xAxisPoints;
53
54   timespec _lastReplot;
55
56   int64_t _numPoints;
57
58   double _displayIntervalTime;
59 };
60
61 #endif /* TIME_DOMAIN_DISPLAY_PLOT_HPP */