-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsocketthread.h
More file actions
40 lines (30 loc) · 811 Bytes
/
socketthread.h
File metadata and controls
40 lines (30 loc) · 811 Bytes
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
#ifndef SOCKETTHREAD_H
#define SOCKETTHREAD_H
#include <QObject>
#include <QThread>
#include <QTimer>
#include <QCerebellum/qtcerebellum.h>
#include <QCerebellum/message.h>
class SocketThread : public QObject
{
Q_OBJECT
QCerebellum::Socket socket;
QTimer *pos_updater;
QTimer *odetect_updater;
QThread *poller;
int posInterval;
int odInterval;
public:
explicit SocketThread(const QString &address, int posInt = 25, int odInt = 25, QObject *parent = 0);
~SocketThread();
signals:
void positionReceived(QCerebellum::PositionMessage m);
void odetectReceived(QCerebellum::ODetectMessage m);
public slots:
void sendTwist(QCerebellum::TwistMessage m);
void stop();
private slots:
void getPosition();
void getODetect();
};
#endif // SOCKETTHREAD_H