#pragma once #include "conf.hpp" #include "pid/ec/pid.hpp" #include #include #include #include #include #include namespace pid_control { void tryRestartControlLoops(bool first = true); /* * Given a configuration structure, fill out the information we use within the * PID loop. */ void initializePIDStruct(ec::pid_info_t* info, const ec::pidinfo& initial); void dumpPIDStruct(ec::pid_info_t* info); struct SensorThresholds { double lowerThreshold = std::numeric_limits::quiet_NaN(); double upperThreshold = std::numeric_limits::quiet_NaN(); }; const std::string sensorintf = "xyz.openbmc_project.Sensor.Value"; const std::string criticalThreshInf = "xyz.openbmc_project.Sensor.Threshold.Critical"; const std::string propertiesintf = "org.freedesktop.DBus.Properties"; /* * Given a path that optionally has a glob portion, fill it out. */ std::string FixupPath(std::string original); /* * Splice together two vectors, "Inputs" and "TempToMargin" from JSON, * into one vector of SensorInput structures containing info from both. */ std::vector spliceInputs(const std::vector& inputNames, const std::vector& inputTempToMargin, const std::vector& missingAcceptableNames); /* * Recovers the original "Inputs" vector from spliceInputs(). */ std::vector splitNames(const std::vector& sensorInputs); /* * Dump active configuration. */ void debugPrint(const std::map& sensorConfig, const std::map& zoneConfig, const std::map& zoneDetailsConfig); } // namespace pid_control