switched from qsettings to json added editng of actors
This commit is contained in:
32
src/items/poweritem.h
Normal file
32
src/items/poweritem.h
Normal file
@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include "item.h"
|
||||
#include "../sensors/sensors.h"
|
||||
#include "../microcontroller.h"
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
class PowerItem: public Item
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
QApplication* a_;
|
||||
|
||||
signals:
|
||||
|
||||
void stateChanged(Sensor sensor);
|
||||
|
||||
private slots:
|
||||
|
||||
void timeout();
|
||||
|
||||
public slots:
|
||||
|
||||
virtual void setValue(uint8_t value);
|
||||
|
||||
public:
|
||||
PowerItem(SensorStore* sensors, QApplication* a, uint32_t itemIdIn = QRandomGenerator::global()->generate(), QString name = "", uint8_t value = 0, QObject* parent = nullptr);
|
||||
void emmitSensor(){stateChanged(Sensor(Sensor::TYPE_SHUTDOWN_IMMINENT, 0, 0));}
|
||||
virtual void store(QJsonObject& json);
|
||||
virtual void store(QString subsecton, QSettings* settings);
|
||||
};
|
Reference in New Issue
Block a user