forked from nonesense84/QDmi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanometer.h
56 lines (49 loc) · 1.37 KB
/
manometer.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
#ifndef MANOMETER_H
#define MANOMETER_H
#include <QObject>
#include <QWidget>
#include <QPainter>
class manometer : public QWidget
{
Q_OBJECT
public:
explicit manometer(QWidget *parent = nullptr);
public slots:
void setDpi(qreal dpi);
void setPressMaxDial(quint8 pressure);
void setPointer2using(bool use);
void setPointer1color(QColor color);
void setPointer2color(QColor color);
void setPonter1Label(QString text);
void setPonter2Label(QString text);
void setPressure1(quint16 pressure);
void setPressure2(quint16 pressure);
void setBackgroundColor(QColor color);
private:
float posNeedle1;
float posNeedle2;
quint16 pressure1;
quint16 pressure2;
int fontSiceDial = 26;
int fontSiceLabel = 37;
quint8 pressMaxDial = 0;
qreal scaleDegStep;
qreal scaleDegStepSmall;
quint8 numShortLines;
quint8 numNumbers;
bool pointer2used = true;
QColor colorPointer1 = Qt::yellow;
QColor colorPointer2 = Qt::red;
QColor colorBackground = Qt::black;
QString textLabel1 = "";
QString textLabel2 = "";
// =============
qreal arcOpenTotal = 288; // 288° 0 to Vmax
qreal startPosZero = -234; //-(144 + 90)
quint16 outEndLines = 250;
quint16 lenShortLines = 30;
quint16 lenLongLines = 50;
protected:
void paintEvent(QPaintEvent *event) override;
};
#endif // MANOMETER_H