init branch
This commit is contained in:
@ -13,13 +13,21 @@
|
||||
#include <QTimer>
|
||||
#include <QAbstractButton>
|
||||
#include <vector>
|
||||
#include "relay.h"
|
||||
|
||||
class Microcontroller: public QObject
|
||||
class Microcontroller : public QObject
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
static constexpr char AMP_RELAY = 0;
|
||||
|
||||
private:
|
||||
|
||||
std::vector<bool> _relayStates; //ugh vector of bools
|
||||
int _auxState = 0;
|
||||
QIODevice* _port = nullptr;
|
||||
|
||||
QScopedPointer<QEventLoop> loop;
|
||||
@ -41,10 +49,15 @@ public slots:
|
||||
void rgbOff();
|
||||
void changeRgbColor(const QColor color);
|
||||
void setPattern(int pattern);
|
||||
void startSunrise();
|
||||
|
||||
void requestRelayList();
|
||||
|
||||
void setAuxPwm(int duty);
|
||||
|
||||
void relayToggle(int state, int id);
|
||||
void relayOn(int relay);
|
||||
void relayOff(int relay);
|
||||
void relayToggle(bool state, int id);
|
||||
|
||||
void run();
|
||||
void abort();
|
||||
@ -52,7 +65,9 @@ public slots:
|
||||
|
||||
signals:
|
||||
void textRecived(const QString string);
|
||||
void relayStateChanged(std::vector<bool> relayStates);
|
||||
void relayStateChanged(Relay relay);
|
||||
void auxStateChanged(int value);
|
||||
void gotRelayList(std::vector<Relay> relays);
|
||||
void doorOpenTimeout();
|
||||
void doorOpened(int id);
|
||||
void doorClosed(int id);
|
||||
|
Reference in New Issue
Block a user