switched from qsettings to json added editng of actors
This commit is contained in:
45
src/actors/sensoractor.h
Normal file
45
src/actors/sensoractor.h
Normal file
@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
#include "actor.h"
|
||||
#include "../sensors/sensor.h"
|
||||
|
||||
class SensorActor : public Actor
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
static constexpr uint8_t SLOPE_UP = 0;
|
||||
static constexpr uint8_t SLOPE_DOWN = 1;
|
||||
static constexpr uint8_t SLOPE_BOTH = 2;
|
||||
|
||||
private:
|
||||
Sensor sensor_;
|
||||
uint8_t sloap_ = SLOPE_UP;
|
||||
float threshold_ = 0;
|
||||
|
||||
public slots:
|
||||
|
||||
void sensorEvent(Sensor sensor);
|
||||
|
||||
void setSloap(uint8_t sloap);
|
||||
void setSensor(const Sensor sensor);
|
||||
void setThreshold( float threshold );
|
||||
|
||||
public:
|
||||
|
||||
SensorActor(const Sensor sensor, QObject* parent = nullptr);
|
||||
SensorActor(QObject* parent = nullptr);
|
||||
Sensor getSensor(){return sensor_;}
|
||||
virtual QString getName();
|
||||
virtual ~SensorActor(){}
|
||||
|
||||
float getThreshold();
|
||||
uint8_t getSloap();
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user