For each zone log sensor name with max setpoint
Add sensor name that has the maximum setpoint for a PID zone.
Log a debug message when the sensor is changed.
The name is also added to the log file for each log record.
Tested:
Override one CPU temperature sensor
busctl set-property xyz.openbmc_project.CPUSensor /xyz/openbmc_project/sensors/temperature/DTS_CPU1 xyz.openbmc_project.Sensor.Value Value d 82
Observed log message:
swampd[443]: PID Zone 0 max SetPoint 34.5546 requested by DTS_CPU1
Signed-off-by: Nirav Shah <nirav.j2.shah@intel.com>
Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
Change-Id: Ifc12cb9a106da1bf41dd35697210f74ba1b589db
diff --git a/pid/pidcontroller.hpp b/pid/pidcontroller.hpp
index cb92377..c3bbc2e 100644
--- a/pid/pidcontroller.hpp
+++ b/pid/pidcontroller.hpp
@@ -21,7 +21,7 @@
{
public:
PIDController(const std::string& id, ZoneInterface* owner) :
- Controller(), _owner(owner), _setpoint(0), _id(id)
+ Controller(), _owner(owner), _id(id)
{}
virtual ~PIDController()
@@ -58,12 +58,12 @@
protected:
ZoneInterface* _owner;
+ std::string _id;
private:
// parameters
ec::pid_info_t _pid_info;
- double _setpoint;
- std::string _id;
+ double _setpoint = 0;
double lastInput = std::numeric_limits<double>::quiet_NaN();
};