39 lines
855 B
C++
39 lines
855 B
C++
#pragma once
|
|
#include "actor.h"
|
|
#include "../sensors/sensor.h"
|
|
|
|
class Regulator : public Actor
|
|
{
|
|
Q_OBJECT
|
|
|
|
private:
|
|
Sensor sensor_;
|
|
float setPoint_ = 0;
|
|
float band_ = 1;
|
|
bool invert_ = false;
|
|
|
|
bool first = true;
|
|
|
|
public slots:
|
|
|
|
void sensorEvent(Sensor sensor);
|
|
|
|
void setSensor(const Sensor sensor);
|
|
void setPoint( float setPoint );
|
|
void setBand ( float band );
|
|
void setInvert( bool invert );
|
|
|
|
public:
|
|
|
|
float getBand() {return band_;}
|
|
float getSetPoint() {return setPoint_;}
|
|
Regulator(const Sensor sensor, QObject* parent = nullptr);
|
|
Regulator(QObject* parent = nullptr);
|
|
Sensor getSensor(){return sensor_;}
|
|
virtual QString getName() const;
|
|
virtual ~Regulator(){}
|
|
|
|
virtual void store(QJsonObject& json);
|
|
virtual void load(const QJsonObject& json, bool preserve);
|
|
};
|