/
MPlot.h
61 lines (42 loc) · 1.38 KB
/
MPlot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef MPLOT_H
#define MPLOT_H
#include "MPlot.h"
#include <QFrame>
#include <QEvent>
#include <QList>
#include <QScrollBar>
//============================================================================================
class MPlot : public QFrame
{
Q_OBJECT
public:
explicit MPlot(QWidget* pParent, const bool isReport, const char* cYAxisLabel, float* pminYNormalValue, float* pmaxYNormalValue);
virtual ~MPlot(); // 2: Plot moves to the left
private:
bool IsReport;
QString SYAxisLabel; // QString SXAxisLabel;
float* PMinYNormalValue; float* PMaxYNormalValue;
qreal XStep;
int NYStroke, NXStroke;
int IxyOff, IxyOffStroke, IxyStrokeLength, IxyArrow;
int NItemVisibleLeft;
QScrollBar* PScrollBar; int HScrollBar;
int PosSB;
QRectF RectCurve;
QList<QPointF> ListVisibleValues; int NMaxVisibleCount;
QList<QPointF> ListAllValues; int NAllCount;
qreal YMinAllValue, YMaxAllValue;
void Init();
void Draw(QPainter& painter);
protected:
virtual bool event(QEvent* event);
virtual void paintEvent(QPaintEvent* event);
public:
void AddValue(const qreal &fx, const qreal &fy);
void Clear();
signals:
public slots:
void SliderMoved(int pos);
};
//============================================================================================
#endif // MPLOT_H