Files
fantasize/app/include/fan/FanCurve.h
Tabascl 78b2a62643 Remove aggregator, fix changing HWMON paths
Add logic to use actual device paths for the PWM sensors instead of their
standart HWMON paths.

This was done after noticing that due to the load order of kernel modules,
the index of HWMON paths could change.
2024-07-07 22:19:27 +02:00

39 lines
853 B
C++

#ifndef FANCURVE_H_
#define FANCURVE_H_
#include <memory>
#include <vector>
#include <fan/Aggregators.h>
#include <fan/HwmonFan.h>
#include <sensor/Sensor.h>
struct FanStep {
int Temp;
int Percent;
};
class FanCurve {
public:
FanCurve(std::vector<FanStep> steps,
std::vector<std::shared_ptr<Sensor>> sensors,
std::vector<std::shared_ptr<Fan>> fans,
std::unique_ptr<Aggregator> aggregator, int hysteresis);
void DoFanControl();
private:
void PrintInfo();
bool ExceedsHysteresis(int temperature);
void ApplyFanPower(std::shared_ptr<Fan> fan, int targetFanPower);
std::vector<FanStep> mSteps;
std::vector<std::shared_ptr<Sensor>> mTempSensors;
std::vector<std::shared_ptr<Fan>> mFans;
std::unique_ptr<Aggregator> mAggregator;
int mHystersis;
int mLastTemperature;
};
#endif // FANCURVE_H_