Lines Matching +full:level +full:- +full:low
11 #include <phosphor-logging/lg2.hpp>
32 Level findThresholdLevel(uint8_t sev)
38 return prop.level;
41 return Level::ERROR;
52 return Direction::LOW;
75 if (std::visit(VariantToStringVisitor(), labelFind->second) !=
93 (std::visit(VariantToIntVisitor(), indexFind->second) !=
105 std::visit(VariantToDoubleVisitor(), hysteresisFind->second);
120 std::visit(VariantToUnsignedIntVisitor(), severityFind->second);
123 std::visit(VariantToStringVisitor(), directionFind->second);
125 Level level = findThresholdLevel(severity);
128 if ((level == Level::ERROR) || (direction == Direction::ERROR))
132 double val = std::visit(VariantToDoubleVisitor(), valueFind->second);
134 thresholdVector.emplace_back(level, direction, val, hysteresis);
148 conn->async_method_call(
166 std::visit(VariantToStringVisitor(), labelFind->second);
183 VariantToUnsignedIntVisitor(), severityFind->second);
186 std::visit(VariantToStringVisitor(), directionFind->second);
187 if ((findThresholdLevel(severity) != threshold.level) ||
194 conn->async_method_call(
213 for (const auto& threshold : sensor->thresholds)
216 sensor->getThresholdInterface(threshold.level);
224 Sensor::propertyLevel(threshold.level, threshold.direction);
229 interface->set_property(property, threshold.value);
257 if (sensor->thresholds.empty())
262 for (auto& threshold : sensor->thresholds)
279 "NAME", sensor->name, "THRESHOLD", threshold.value,
280 "VALUE", value, "RAW_DATA", sensor->rawValue);
283 else if (value < (threshold.value - threshold.hysteresis))
293 else if (threshold.direction == thresholds::Direction::LOW)
301 "Sensor name: {NAME}, low threshold: {THRESHOLD}, "
303 "NAME", sensor->name, "THRESHOLD", threshold.value,
304 "VALUE", value, "RAW_DATA", sensor->rawValue);
331 " M= {HIGH_MIDSTATE}, Low T= {LOW_TRUE}, F= {LOW_FALSE},"
363 pair->first.used = true;
364 pair->first.level = threshold.level;
365 pair->first.direction = threshold.direction;
366 pair->first.assert = assert;
367 pair->second.expires_after(std::chrono::seconds(waitTime));
368 pair->second.async_wait([weakSensor, pair, threshold, assert,
376 pair->first.used = false;
388 if (sensorPtr->readingStateGood())
390 assertThresholds(sensorPtr.get(), assertValue, threshold.level,
399 std::vector<ChangeParam> changes = checkThresholds(sensor, sensor->value);
402 assertThresholds(sensor, change.assertValue, change.threshold.level,
404 if (change.threshold.level == thresholds::Level::CRITICAL &&
424 std::vector<ChangeParam> changes = checkThresholds(sensor, sensor->value);
428 // go below low thresholds. Filter these events with thresholdTimer.
429 // 1. always delay the assertion of low events to see if they are
431 // 2. conditional delay the de-assertion of low events if there is
433 // 3. no delays for de-assert of low events if there is an existing
434 // de-assert for low event. This means 2nd de-assert would happen
438 if (change.threshold.direction == thresholds::Direction::LOW)
448 assertThresholds(sensor, change.assertValue, change.threshold.level,
454 thresholds::Level level, thresholds::Direction direction,
458 sensor->getThresholdInterface(level);
466 std::string property = Sensor::propertyAlarm(level, direction);
472 if (interface->set_property<bool, true>(property, assert))
476 // msg.get_path() is interface->get_object_path()
478 interface->new_signal("ThresholdAsserted");
480 msg.append(sensor->name, interface->get_interface_name(), property,
498 std::string, std::vector<std::tuple<const char*, thresholds::Level,
503 std::make_tuple("average_min", Level::WARNING, Direction::LOW,
505 std::make_tuple("average_max", Level::WARNING, Direction::HIGH,
510 std::make_tuple("min", Level::WARNING, Direction::LOW, 0.0),
511 std::make_tuple("max", Level::WARNING, Direction::HIGH, 0.0),
512 std::make_tuple("lcrit", Level::CRITICAL, Direction::LOW, 0.0),
513 std::make_tuple("crit", Level::CRITICAL, Direction::HIGH,
525 const auto& [suffix, level, direction, offset] = t;
536 thresholdVector.emplace_back(level, direction, *val,
545 std::string getInterface(const Level thresholdLevel)
549 if (thresh.level == thresholdLevel)