source: flair-src/branches/sanscv/tools/FlairGCS/src/UsSensorPlot.h@ 377

Last change on this file since 377 was 324, checked in by Sanahuja Guillaume, 5 years ago

removing opencv dependency

File size: 1.6 KB
Line 
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
12class Layout;
13class QwtPlot;
14class QwtPlotCurve;
15class QwtPlotItem;
16class QMouseEvent;
17class QwtPlotMarker;
18class QScrollBar;
19
20class UsSensorPlot : public DataRemote {
21 Q_OBJECT
22
23public:
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, int period);
26 ~UsSensorPlot();
27
28protected:
29 void mousePressEvent(QMouseEvent *event);
30
31private:
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, bool big_endian);
60 void plotMeasure(int index);
61
62 private slots:
63 void scrollBarMoved(int value);
64};
65
66#endif // USSENSORPLOT_H_INCLUDED
Note: See TracBrowser for help on using the repository browser.