| 1 | #ifndef DATAPLOT2D_H_INCLUDED
|
---|
| 2 | #define DATAPLOT2D_H_INCLUDED
|
---|
| 3 |
|
---|
| 4 | #include "DataRemote.h"
|
---|
| 5 | #include <stdint.h>
|
---|
| 6 | #include <QPen>
|
---|
| 7 |
|
---|
| 8 | class Layout;
|
---|
| 9 | class QwtPlot;
|
---|
| 10 | class QwtPlotCurve;
|
---|
| 11 | class QwtPlotItem;
|
---|
| 12 | class QMouseEvent;
|
---|
| 13 |
|
---|
| 14 | class DataPlot2D : public DataRemote
|
---|
| 15 | {
|
---|
| 16 | Q_OBJECT
|
---|
| 17 |
|
---|
| 18 | public:
|
---|
| 19 | DataPlot2D(Layout* parent,int row, int col,QString plot_name,QString x_name,QString y_name,float xmin, float xmax,float ymin, float ymax,bool enabled,int period);
|
---|
| 20 | ~DataPlot2D();
|
---|
| 21 | void addCurve(QPen pen,QString legend,QString type);
|
---|
| 22 |
|
---|
| 23 | protected:
|
---|
| 24 | void mousePressEvent(QMouseEvent *event);
|
---|
| 25 |
|
---|
| 26 | private:
|
---|
| 27 | QwtPlot* plot;
|
---|
| 28 | void XmlEvent(QDomElement dom);
|
---|
| 29 | void alignScales(void);
|
---|
| 30 | void plot_data(double data_x,double data_y,int index);
|
---|
| 31 | float xmin_orig,xmax_orig,ymin_orig,ymax_orig;
|
---|
| 32 |
|
---|
| 33 | QList<QwtPlotCurve*> *datas;
|
---|
| 34 | QList<QString> *datas_type;
|
---|
| 35 | QList<bool> datas_first_update;
|
---|
| 36 | QList<double*> d_x;
|
---|
| 37 | QList<double*> d_y;
|
---|
| 38 | double view_size;//en s
|
---|
| 39 |
|
---|
| 40 | bool eventFilter(QObject *, QEvent *);
|
---|
| 41 | void setYAxisScale(float ymin,float ymax);
|
---|
| 42 | void setXAxisScale(float xmin,float xmax);
|
---|
| 43 | void BufEvent(char** buf,int *buf_size,uint16_t period,bool big_endian);
|
---|
| 44 | void showCurve(QwtPlotItem *item, bool on);
|
---|
| 45 |
|
---|
| 46 | private slots:
|
---|
| 47 | void legendChecked( const QVariant &itemInfo, bool on );
|
---|
| 48 | };
|
---|
| 49 |
|
---|
| 50 |
|
---|
| 51 | #endif // DATAPLOT2D_H_INCLUDED
|
---|