Subversion Repositories Code-Repo

Rev

Rev 287 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
287 Kevin 1
#ifndef ROBOTCONTROL_H
2
#define ROBOTCONTROL_H
3
 
4
#include "GlobalDefines.h"
5
#include <QSerialPort>
6
#include <QSerialPortInfo>
7
 
8
class RobotControl : public QWidget
9
{
10
	Q_OBJECT
11
 
12
public:
13
	RobotControl(QWidget *parent = 0);
14
	~RobotControl();
15
 
16
	void handleKeyPress(QKeyEvent *event);
17
	void handleKeyRelease(QKeyEvent *event);
18
 
19
public slots:
20
	void refreshPorts();
21
	void toggleConnect();
22
 
23
private:
24
	void processMove();
25
 
26
	bool connected;
27
	bool moveForward;
28
	bool moveBackward;
29
	bool turnLeft;
30
	bool turnRight;
31
 
32
	QPushButton *connectBtn;
33
	QPushButton *refreshBtn;
34
	QLabel *statusLabel;
35
	QLabel *speedLabel;
36
	QSpinBox *speedBox;
37
	QComboBox *portSelect;
38
 
39
	QSerialPort *port;
40
	QList<QSerialPortInfo> ports;
41
};
42
 
43
#endif // ROBOTCONTROL_H