From 5008dafb53c29599dd85ad7cc383a7f2ab319fdd Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Mon, 15 Jan 2018 16:38:24 -0600 Subject: Remove getTargetSpeed The getTargetSpeed function is no longer needed. The tach sensors are used to get the target speed. Change-Id: I5f82b0c3e8104203e2700b22a5488cf63673d181 Signed-off-by: Matthew Barth --- monitor/fan.cpp | 10 ++-------- monitor/fan.hpp | 13 ------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/monitor/fan.cpp b/monitor/fan.cpp index f24312d..9d2593f 100644 --- a/monitor/fan.cpp +++ b/monitor/fan.cpp @@ -154,12 +154,6 @@ uint64_t Fan::findTargetSpeed() } -uint64_t Fan::getTargetSpeed(const TachSensor& sensor) -{ - return sensor.getTarget(); -} - - bool Fan::tooManySensorsNonfunctional() { size_t numFailed = std::count_if(_sensors.begin(), _sensors.end(), @@ -175,7 +169,7 @@ bool Fan::tooManySensorsNonfunctional() bool Fan::outOfRange(const TachSensor& sensor) { auto actual = static_cast(sensor.getInput()); - auto target = getTargetSpeed(sensor); + auto target = sensor.getTarget(); uint64_t min = target * (100 - _deviation) / 100; uint64_t max = target * (100 + _deviation) / 100; @@ -203,7 +197,7 @@ void Fan::timerExpired(TachSensor& sensor) entry("FAN=%s", _name.c_str()), entry("TACH_SENSOR=%s", sensor.name().c_str()), entry("ACTUAL_SPEED=%lld", sensor.getInput()), - entry("TARGET_SPEED=%lld", getTargetSpeed(sensor))); + entry("TARGET_SPEED=%lld", sensor.getTarget())); updateInventory(false); } diff --git a/monitor/fan.hpp b/monitor/fan.hpp index d765650..bd8179f 100644 --- a/monitor/fan.hpp +++ b/monitor/fan.hpp @@ -146,19 +146,6 @@ class Fan private: - /** - * @brief Returns the target speed of the fan - * - * Retrieves the target speed using the given sensor which may or may - * not contain a target speed value. The sensor determines what its - * target speed is. - * - * @param[in] sensor - The sensor to use in getting the target speed - * - * @return - The target speed of the fan - */ - uint64_t getTargetSpeed(const TachSensor& sensor); - /** * @brief Returns true if the sensor input is not within * some deviation of the target. -- cgit v1.2.1