Cleanup, more documentation
This commit is contained in:
@@ -23,6 +23,7 @@ public:
|
||||
private:
|
||||
std::shared_ptr<PWMControl> mPWMControl;
|
||||
std::shared_ptr<Sensor> mRpmSensor;
|
||||
std::string mLabel;
|
||||
};
|
||||
|
||||
#endif // HWMONFAN_H_
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef PWMCONTROLFACADE_H_
|
||||
#define PWMCONTROLFACADE_H_
|
||||
|
||||
#include <filesystem>
|
||||
#include <memory>
|
||||
#include <regex>
|
||||
#include <vector>
|
||||
|
||||
#include <pwm/PWMControl.h>
|
||||
|
||||
@@ -14,7 +14,7 @@ int HwmonFan::rpm() { return mRpmSensor->value(); }
|
||||
|
||||
json HwmonFan::toJson() const {
|
||||
json obj;
|
||||
obj = {mPWMControl->toJson(), mRpmSensor->toJson()};
|
||||
obj = {mPWMControl->toJson(), mRpmSensor->toJson(), mLabel};
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
|
||||
#include <FanGenerator.h>
|
||||
@@ -7,8 +6,6 @@
|
||||
#include <pwm/PWMControlFacade.h>
|
||||
#include <sensor/SensorManager.h>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
int main() {
|
||||
SensorManager sensorManager;
|
||||
auto pwmSensors = sensorManager.RPMSensors();
|
||||
@@ -21,12 +18,7 @@ int main() {
|
||||
|
||||
std::vector<std::shared_ptr<Fan>> fans;
|
||||
|
||||
if (fs::exists(fs::path(SERIALIZATION_DIR) / FANS_JSON_FILENAME)) {
|
||||
fans = s.DeserializeFans(pwmSensors);
|
||||
} else {
|
||||
fans = m.FindFans(pwmSensors, controls);
|
||||
s.SerializeFans(fans);
|
||||
}
|
||||
fans = m.FindFans(pwmSensors, controls);
|
||||
|
||||
for (auto f : fans) {
|
||||
std::cout << f->toString() << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user