-
Notifications
You must be signed in to change notification settings - Fork 0
/
rgbcontrollerqml.h
76 lines (51 loc) · 1.52 KB
/
rgbcontrollerqml.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef RGBCONTROLLERQML_H
#define RGBCONTROLLERQML_H
#include <QThread>
#include <QTimer>
#include <QObject>
#include "rgbcontroller.h"
class RGBControllerQML : public QObject
{
Q_OBJECT
public:
RGBControllerQML();
~RGBControllerQML();
private:
QThread *rgbControllerThread;
QTimer *timer;
RGBController *rgbController;
int setR;
int setG;
int setB;
int setH;
int setS;
int setV;
public slots:
void connectToDevice(QString comName, int baud);
bool getConnectionStatus();
void disconnectFromDevice();
void setRGB(int r, int g, int b);
void setHSV(int h, int s, int v);
void setAnimation(int type, int speed, int step);
void setAnimation(int type, int speed, int step, int red, int green, int blue);
private slots:
void sendGetTemperatureRequest();
void getTemperatureSlot(QString temperature);
void getConnecting();
void getConnectingFinish();
void setRGBSlot();
void setHSVSlot();
signals:
QString getTemperature(QString temperature);
void qmlConnecting();
void qmlConnectingFinish();
void disconnectSignal();
void setRGBSignal(int r, int g, int b);
void setHSVSignal(int h, int s, int v);
void setAnimationSignal(int type, int speed, int step);
void setAnimationSignal(int type, int speed, int step, int red, int green, int blue);
bool getConnectionStatusSignal();
void setParameterSignal(QString comName, int baud);
void sendGetTemperatureRequestSignal();
};
#endif // RGBCONTROLLERQML_H