Subversion Repositories Code-Repo

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef ROBOTCONTROL_H
#define ROBOTCONTROL_H

#include "GlobalDefines.h"
#include <QSerialPort>
#include <QSerialPortInfo>

class RobotControl : public QWidget
{
        Q_OBJECT

public:
        RobotControl(QWidget *parent = 0);
        ~RobotControl();

        void handleKeyPress(QKeyEvent *event);
        void handleKeyRelease(QKeyEvent *event);

public slots:
        void refreshPorts();
        void toggleConnect();

private:
        void processMove();

        bool connected;
        bool moveForward;
        bool moveBackward;
        bool turnLeft;
        bool turnRight;

        QPushButton *connectBtn;
        QPushButton *refreshBtn;
        QLabel *statusLabel;
        QLabel *speedLabel;
        QSpinBox *speedBox;
        QComboBox *portSelect;

        QSerialPort *port;
        QList<QSerialPortInfo> ports;
};

#endif // ROBOTCONTROL_H