Lines Matching +full:boost +full:- +full:max +full:- +full:current
3 * Copyright (c) 2018-present Facebook.
9 * http://www.apache.org/licenses/LICENSE-2.0
21 #include <phosphor-logging/log.hpp>
30 static constexpr int16_t minInt10 = -0x200;
32 static constexpr int8_t minInt4 = -8;
49 current = 0x3, enumerator
62 using SensorSubTree = boost::container::flat_map<
64 boost::container::flat_map<std::string, std::vector<std::string>>,
75 phosphor::logging::entry("ERRNO=0x%X", -ret)); in getSensorSubtree()
114 const static boost::container::flat_map<const char*, SensorUnits, CmpStr>
117 {"current", SensorUnits::amps},
121 const static boost::container::flat_map<const char*, SensorTypeCodes, CmpStr>
124 {"current", SensorTypeCodes::current},
138 size_t typeStart = path.rfind("/", typeEnd - 1); in getSensorTypeStringFromPath()
145 return path.substr(typeStart, typeEnd - typeStart); in getSensorTypeStringFromPath()
155 sensorType = static_cast<uint8_t>(findSensor->second); in getSensorTypeFromPath()
168 const double max, const double min, int16_t& mValue, int8_t& rExp, in getSensorAttributes() argument
175 if (max <= min) in getSensorAttributes()
178 "getSensorAttributes: Max must be greater than min"); in getSensorAttributes()
182 mDouble = (max - min) / 0xFF; in getSensorAttributes()
187 bDouble = floor(0.5 + ((max + min) / 2)); in getSensorAttributes()
203 "rExp Too big, Max and Min range too far", in getSensorAttributes()
212 while (((mDouble - floor(mDouble)) / mDouble) > (1.0 / 255)) in getSensorAttributes()
217 "rExp Too Small, Max and Min range too close"); in getSensorAttributes()
222 if (bDouble / std::pow(10, rExp + minInt4 - 1) > bDouble) in getSensorAttributes()
233 // can't multiply M any more, max precision reached in getSensorAttributes()
239 rExp--; in getSensorAttributes()
251 "bExp Too Big, Max and Min range need to be adjusted"); in getSensorAttributes()
258 while (((fabs(bDouble) - floor(fabs(bDouble))) / fabs(bDouble)) > in getSensorAttributes()
264 "bExp Too Small, Max and Min range need to be adjusted"); in getSensorAttributes()
268 bExp -= 1; in getSensorAttributes()
282 (value - (bValue * std::pow(10, bExp) * std::pow(10, rExp))) / in scaleIPMIValueFromDouble()
285 if (scaledValue > std::numeric_limits<uint8_t>::max() || in scaleIPMIValueFromDouble()
300 static inline uint8_t getScaledIPMIValue(const double value, const double max, in getScaledIPMIValue() argument
310 result = getSensorAttributes(max, min, mValue, rExp, bValue, bExp, bSigned); in getScaledIPMIValue()