switched from qsettings to json added editng of actors
This commit is contained in:
parent
b04fbfb5bc
commit
df27b622a0
141 changed files with 4402 additions and 5068 deletions
41
src/items/relay.h
Normal file
41
src/items/relay.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#ifndef RELAY_H
|
||||
#define RELAY_H
|
||||
|
||||
#include<stdint.h>
|
||||
#include<QObject>
|
||||
|
||||
#include "../sensors/sensor.h"
|
||||
#include "item.h"
|
||||
|
||||
class Microcontroller;
|
||||
|
||||
class Relay : public Item
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
Microcontroller* micro_;
|
||||
|
||||
uint8_t id_;
|
||||
uint16_t address_;
|
||||
|
||||
public slots:
|
||||
|
||||
virtual void setValue(uint8_t value);
|
||||
void on();
|
||||
void off();
|
||||
void toggle();
|
||||
|
||||
public:
|
||||
Relay(SensorStore* sensors, Microcontroller* micro, uint8_t id = 0, QString name = "", uint16_t address = 0, bool state = false, QObject* parent = nullptr);
|
||||
|
||||
uint16_t getAddress() const;
|
||||
uint8_t getId() const;
|
||||
void setId(uint8_t id);
|
||||
|
||||
virtual void store(QJsonObject& json);
|
||||
virtual void load(const QJsonObject& json);
|
||||
|
||||
virtual void store(QString subsecton, QSettings* settings);
|
||||
virtual void load(QString subsecton, QSettings* settings);
|
||||
};
|
||||
#endif // RELAY_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue