Implement fan curves and extend serialization logic
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
#ifndef SERIALIZER_H_
|
||||
#define SERIALIZER_H_
|
||||
|
||||
#include "fan/HwmonFan.h"
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <fan/Fan.h>
|
||||
#include <fan/FanCurve.h>
|
||||
#include <sensor/Sensor.h>
|
||||
|
||||
#define SERIALIZATION_DIR "/etc/fantasize"
|
||||
@@ -20,10 +22,9 @@ public:
|
||||
void SerializeFans(std::vector<std::shared_ptr<Fan>> fans);
|
||||
std::vector<std::shared_ptr<Fan>>
|
||||
DeserializeFans(std::vector<std::shared_ptr<Sensor>> availableSensors);
|
||||
|
||||
void SerializeTempSensors(std::vector<std::shared_ptr<Sensor>> senors);
|
||||
std::vector<std::shared_ptr<Sensor>>
|
||||
DeserializeTempSensors(std::vector<std::shared_ptr<Sensor>> availableSensors);
|
||||
std::vector<std::shared_ptr<FanCurve>>
|
||||
DeserializeFanCurves(std::vector<std::shared_ptr<Sensor>> availableSensors,
|
||||
std::vector<std::shared_ptr<Fan>> availableFans);
|
||||
|
||||
private:
|
||||
void WriteJson(json o);
|
||||
|
||||
@@ -14,6 +14,10 @@ struct FanStep {
|
||||
|
||||
class FanCurve {
|
||||
public:
|
||||
FanCurve(std::vector<FanStep> steps,
|
||||
std::vector<std::shared_ptr<Sensor>> sensors,
|
||||
std::vector<std::shared_ptr<Fan>> fans);
|
||||
|
||||
void DoFanControl();
|
||||
|
||||
private:
|
||||
@@ -21,7 +25,7 @@ private:
|
||||
|
||||
std::vector<FanStep> mSteps;
|
||||
std::vector<std::shared_ptr<Sensor>> mTempSensors;
|
||||
std::vector<std::shared_ptr<HwmonFan>> mFans;
|
||||
std::vector<std::shared_ptr<Fan>> mFans;
|
||||
};
|
||||
|
||||
#endif // FANCURVE_H_
|
||||
|
||||
Reference in New Issue
Block a user