s/minThermalRPM/minThermalOutput

The minThermalRPM is only an RPM by the fact that
that is the units of the PID. As the PID units can
be anything, change this to minThermalOutput to allow
for different units (i.e. percent).

Change-Id: Ic53fef1159ade5a413e5d519d407947f3023d8e3
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/conf.hpp b/conf.hpp
index 8a6170d..14e1cc9 100644
--- a/conf.hpp
+++ b/conf.hpp
@@ -51,7 +51,7 @@
 struct ZoneConfig
 {
     /* The minimum RPM value we would ever want. */
-    double minThermalRpm;
+    double minThermalOutput;
 
     /* If the sensors are in fail-safe mode, this is the percentage to use. */
     double failsafePercent;
diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp
index 06bcdcc..3c5be34 100644
--- a/dbus/dbusconfiguration.cpp
+++ b/dbus/dbusconfiguration.cpp
@@ -92,7 +92,7 @@
     for (const auto& zone : zoneDetailsConfig)
     {
         std::cout << "\t{" << zone.first << ",\n";
-        std::cout << "\t\t{" << zone.second.minThermalRpm << ", ";
+        std::cout << "\t\t{" << zone.second.minThermalOutput << ", ";
         std::cout << zone.second.failsafePercent << "}\n\t},\n";
     }
     std::cout << "}\n\n";
@@ -299,8 +299,8 @@
             size_t index = getZoneIndex(name, foundZones);
 
             auto& details = zoneDetailsConfig[index];
-            details.minThermalRpm =
-                std::visit(VariantToDoubleVisitor(), zone.at("MinThermalRpm"));
+            details.minThermalOutput = std::visit(VariantToDoubleVisitor(),
+                                                  zone.at("MinThermalOutput"));
             details.failsafePercent = std::visit(VariantToDoubleVisitor(),
                                                  zone.at("FailSafePercent"));
         }
diff --git a/examples/README b/examples/README
index df76978..dcbd645 100644
--- a/examples/README
+++ b/examples/README
@@ -55,7 +55,7 @@
 "zones" : [
   {
     "id": 1, /* zone id. */
-    "minThermalRpm": 3000.0, /* The minimum thermal RPM value. (double) */
+    "minThermalOutput": 3000.0, /* The minimum thermal RPM value. (double) */
     "failsafePercent": 75.0, /* The percent to use when the zone is in fail-safe mode. (double) */
     "pids": [
       {
diff --git a/examples/fan-info.json b/examples/fan-info.json
index e0b87ee..f1676cb 100644
--- a/examples/fan-info.json
+++ b/examples/fan-info.json
@@ -62,7 +62,7 @@
     "zones" : [
         {
             "id": 1,
-            "minThermalRpm": 3000.0,
+            "minThermalOutput": 3000.0,
             "failsafePercent": 75.0,
             "pids": [
                 {
diff --git a/pid/builder.cpp b/pid/builder.cpp
index 2a64215..2faa1cc 100644
--- a/pid/builder.cpp
+++ b/pid/builder.cpp
@@ -63,7 +63,7 @@
         const PIDConf& pidConfig = zi.second;
 
         auto zone = std::make_unique<PIDZone>(
-            zoneId, zoneConf->second.minThermalRpm,
+            zoneId, zoneConf->second.minThermalOutput,
             zoneConf->second.failsafePercent, mgr, modeControlBus,
             getControlPath(zi.first).c_str(), deferSignals);
 
diff --git a/pid/buildjson.cpp b/pid/buildjson.cpp
index 97f2bf0..b620439 100644
--- a/pid/buildjson.cpp
+++ b/pid/buildjson.cpp
@@ -86,7 +86,7 @@
 
         /* TODO: using at() throws a specific exception we can catch */
         id = zone["id"];
-        thisZoneConfig.minThermalRpm = zone["minThermalRpm"];
+        thisZoneConfig.minThermalOutput = zone["minThermalOutput"];
         thisZoneConfig.failsafePercent = zone["failsafePercent"];
 
         auto pids = zone["pids"];
diff --git a/pid/zone.cpp b/pid/zone.cpp
index 065e6d7..7433d30 100644
--- a/pid/zone.cpp
+++ b/pid/zone.cpp
@@ -87,7 +87,7 @@
 
 double PIDZone::getMinThermalRPMSetpoint(void) const
 {
-    return _minThermalRpmSetPt;
+    return _minThermalOutputSetPt;
 }
 
 void PIDZone::addFanPID(std::unique_ptr<Controller> pid)
diff --git a/pid/zone.hpp b/pid/zone.hpp
index 077d272..94082e9 100644
--- a/pid/zone.hpp
+++ b/pid/zone.hpp
@@ -43,11 +43,12 @@
 class PIDZone : public ZoneInterface, public ModeObject
 {
   public:
-    PIDZone(int64_t zone, double minThermalRpm, double failSafePercent,
+    PIDZone(int64_t zone, double minThermalOutput, double failSafePercent,
             const SensorManager& mgr, sdbusplus::bus::bus& bus,
             const char* objPath, bool defer) :
         ModeObject(bus, objPath, defer),
-        _zoneId(zone), _maximumRPMSetPt(), _minThermalRpmSetPt(minThermalRpm),
+        _zoneId(zone), _maximumRPMSetPt(),
+        _minThermalOutputSetPt(minThermalOutput),
         _failSafePercent(failSafePercent), _mgr(mgr)
     {
 #ifdef __TUNING_LOGGING__
@@ -104,7 +105,7 @@
     const int64_t _zoneId;
     double _maximumRPMSetPt = 0;
     bool _manualMode = false;
-    const double _minThermalRpmSetPt;
+    const double _minThermalOutputSetPt;
     const double _failSafePercent;
 
     std::set<std::string> _failSafeSensors;
diff --git a/test/json_parse_unittest.cpp b/test/json_parse_unittest.cpp
index ba6ff11..4913461 100644
--- a/test/json_parse_unittest.cpp
+++ b/test/json_parse_unittest.cpp
@@ -16,7 +16,7 @@
         }],
         "zones": [{
           "id": 1,
-          "minThermalRpm": 3000.0,
+          "minThermalOutput": 3000.0,
           "failsafePercent": 75.0,
           "pids": [{
             "name": "fan1-5",
@@ -51,7 +51,7 @@
       {
         "zones": [{
           "id": 1,
-          "minThermalRpm": 3000.0,
+          "minThermalOutput": 3000.0,
           "failsafePercent": 75.0,
           "pids": [{
             "name": "fan1-5",
@@ -103,7 +103,7 @@
         "sensors": [],
         "zones": [{
           "id": 1,
-          "minThermalRpm": 3000.0,
+          "minThermalOutput": 3000.0,
           "failsafePercent": 75.0,
           "pids": [{
             "name": "fan1-5",
@@ -143,7 +143,7 @@
         }],
         "zones": [{
           "id": 1,
-          "minThermalRpm": 3000.0,
+          "minThermalOutput": 3000.0,
           "failsafePercent": 75.0,
           "pids": []
         }]
diff --git a/test/pid_json_unittest.cpp b/test/pid_json_unittest.cpp
index 42402d1..098d9da 100644
--- a/test/pid_json_unittest.cpp
+++ b/test/pid_json_unittest.cpp
@@ -34,7 +34,7 @@
       {
         "zones" : [{
           "id": 1,
-          "minThermalRpm": 3000.0,
+          "minThermalOutput": 3000.0,
           "failsafePercent": 75.0,
           "pids": [{
             "name": "fan1-5",
@@ -64,5 +64,5 @@
     EXPECT_EQ(zoneConfig.size(), 1);
 
     EXPECT_EQ(pidConfig[1]["fan1-5"].type, "fan");
-    EXPECT_DOUBLE_EQ(zoneConfig[1].minThermalRpm, 3000.0);
+    EXPECT_DOUBLE_EQ(zoneConfig[1].minThermalOutput, 3000.0);
 }
diff --git a/test/pid_zone_unittest.cpp b/test/pid_zone_unittest.cpp
index e8c8a2b..2270fa6 100644
--- a/test/pid_zone_unittest.cpp
+++ b/test/pid_zone_unittest.cpp
@@ -42,7 +42,7 @@
     bool defer = true;
     const char* objPath = "/path/";
     int64_t zone = 1;
-    double minThermalRpm = 1000.0;
+    double minThermalOutput = 1000.0;
     double failSafePercent = 0.75;
 
     int i;
@@ -50,8 +50,8 @@
     SetupDbusObject(&sdbus_mock_mode, defer, objPath, modeInterface, properties,
                     &i);
 
-    PIDZone p(zone, minThermalRpm, failSafePercent, m, bus_mock_mode, objPath,
-              defer);
+    PIDZone p(zone, minThermalOutput, failSafePercent, m, bus_mock_mode,
+              objPath, defer);
     // Success.
 }
 
@@ -80,8 +80,9 @@
         SetupDbusObject(&sdbus_mock_mode, defer, objPath, modeInterface,
                         properties, &property_index);
 
-        zone = std::make_unique<PIDZone>(zoneId, minThermalRpm, failSafePercent,
-                                         mgr, bus_mock_mode, objPath, defer);
+        zone =
+            std::make_unique<PIDZone>(zoneId, minThermalOutput, failSafePercent,
+                                      mgr, bus_mock_mode, objPath, defer);
     }
 
     // unused
@@ -92,7 +93,7 @@
     sdbusplus::SdBusMock sdbus_mock_host;
     sdbusplus::SdBusMock sdbus_mock_mode;
     int64_t zoneId = 1;
-    double minThermalRpm = 1000.0;
+    double minThermalOutput = 1000.0;
     double failSafePercent = 0.75;
     bool defer = true;
     const char* objPath = "/path/";