Working TCP subsystem
This commit is contained in:
@ -1,11 +1,51 @@
|
||||
#ifndef MICROCONTROLLER_H
|
||||
#define MICROCONTROLLER_H
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class Microcontroller
|
||||
#include <QObject>
|
||||
#include <QColor>
|
||||
#include <QIODevice>
|
||||
#include <QString>
|
||||
#include <QRunnable>
|
||||
#include <QScopedPointer>
|
||||
#include <QEventLoop>
|
||||
#include <QTimer>
|
||||
|
||||
class Microcontroller: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
|
||||
QIODevice* _port = nullptr;
|
||||
|
||||
QScopedPointer<QEventLoop> loop;
|
||||
QString _buffer;
|
||||
|
||||
public:
|
||||
Microcontroller(QIODevice* port);
|
||||
Microcontroller();
|
||||
~Microcontroller();
|
||||
bool connected();
|
||||
void setIODevice(QIODevice* port);
|
||||
|
||||
public slots:
|
||||
void rgbOn();
|
||||
void rgbOff();
|
||||
void changeRgbColor(const QColor color);
|
||||
void setPattern(int pattern);
|
||||
|
||||
void relayToggle(int state, int id);
|
||||
void relayOn(int relay);
|
||||
void relayOff(int relay);
|
||||
|
||||
void run();
|
||||
void abort();
|
||||
void doTick();
|
||||
|
||||
signals:
|
||||
void textRecived(const QString string);
|
||||
|
||||
};
|
||||
|
||||
#endif // MICROCONTROLLER_H
|
||||
#endif // MICROCONTROLLER_H
|
||||
|
Reference in New Issue
Block a user