1 | // %flair:license{
|
---|
2 | // This file is part of the Flair framework distributed under the
|
---|
3 | // CECILL-C License, Version 1.0.
|
---|
4 | // %flair:license}
|
---|
5 | #ifndef USSENSORPLOT_H_INCLUDED
|
---|
6 | #define USSENSORPLOT_H_INCLUDED
|
---|
7 |
|
---|
8 | #include "DataRemote.h"
|
---|
9 | #include <stdint.h>
|
---|
10 | #include <QPen>
|
---|
11 |
|
---|
12 | class Layout;
|
---|
13 | class QwtPlot;
|
---|
14 | class QwtPlotCurve;
|
---|
15 | class QwtPlotItem;
|
---|
16 | class QMouseEvent;
|
---|
17 | class QwtPlotMarker;
|
---|
18 | class QScrollBar;
|
---|
19 |
|
---|
20 | class UsSensorPlot : public DataRemote {
|
---|
21 | Q_OBJECT
|
---|
22 |
|
---|
23 | public:
|
---|
24 | UsSensorPlot(Layout *parent, int row, int col, QString plot_name,
|
---|
25 | QString y_name, float ymin,float ymax, uint32_t nbSamples,QString datasType,bool enabled, uint16_t period);
|
---|
26 | ~UsSensorPlot();
|
---|
27 |
|
---|
28 | protected:
|
---|
29 | void mousePressEvent(QMouseEvent *event);
|
---|
30 |
|
---|
31 | private:
|
---|
32 | QwtPlot *plot;
|
---|
33 | void XmlEvent(QDomElement *dom);
|
---|
34 | void alignScales(void);
|
---|
35 | float xmin_orig, xmax_orig, ymin_orig, ymax_orig;
|
---|
36 | QScrollBar* scrollbar;
|
---|
37 |
|
---|
38 | QwtPlotCurve *datas;
|
---|
39 | QwtPlotMarker *firstPeakStart,*firstPeakEnd,*secondPeakStart,*secondPeakEnd;
|
---|
40 | QString datasType;
|
---|
41 | double *dx;
|
---|
42 |
|
---|
43 | struct measure_t {
|
---|
44 | double *dy;
|
---|
45 | uint16_t firstPeakStartIndex;
|
---|
46 | uint16_t firstPeakEndIndex;
|
---|
47 | uint16_t secondPeakStartIndex;
|
---|
48 | uint16_t secondPeakEndIndex;
|
---|
49 | };
|
---|
50 | QList<measure_t> measures;
|
---|
51 |
|
---|
52 |
|
---|
53 | uint32_t nbSamples;
|
---|
54 | bool scrolling;
|
---|
55 |
|
---|
56 | bool eventFilter(QObject *, QEvent *);
|
---|
57 | void setYAxisScale(float ymin, float ymax);
|
---|
58 | void setXAxisScale(float xmin, float xmax);
|
---|
59 | void BufEvent(char **buf, int *buf_size, uint16_t period, uint16_t nb_buffering,bool big_endian);
|
---|
60 | void plotMeasure(int index);
|
---|
61 |
|
---|
62 | private slots:
|
---|
63 | void scrollBarMoved(int value);
|
---|
64 | };
|
---|
65 |
|
---|
66 | #endif // USSENSORPLOT_H_INCLUDED
|
---|