summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2019-02-11 09:39:59 -0800
committerPatrick Venture <venture@google.com>2019-02-11 09:39:59 -0800
commit8e2fdb34b4338b41cb27756810266f6e3eb900ee (patch)
tree5415e65b614f130681bbefaf47fa35d85a82d42f
parenta23468ef06b72ad2946e8f744c7e606435988253 (diff)
downloadphosphor-pid-control-8e2fdb34b4338b41cb27756810266f6e3eb900ee.tar.gz
phosphor-pid-control-8e2fdb34b4338b41cb27756810266f6e3eb900ee.zip
conf change: rename zone variables
Rename the zone variables to make them camelCase as a step towards making all configuration variables camelCase for consistency. Note: This patchset requires a change to your yaml configuration if you're using it, or libconfig if you're using it. Change-Id: If9cf1d7eb8227d305a1625275f2f7082c0d6905a Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--conf.hpp4
-rw-r--r--dbus/dbusconfiguration.cpp8
-rw-r--r--examples/swampd.conf2
-rw-r--r--pid/builder.cpp4
-rw-r--r--pid/builderconfig.cpp6
-rw-r--r--scripts/writezone.mako.cpp4
-rw-r--r--scripts/zone-example.txt4
-rw-r--r--scripts/zone-example.yaml4
8 files changed, 18 insertions, 18 deletions
diff --git a/conf.hpp b/conf.hpp
index c251efc..c5734cc 100644
--- a/conf.hpp
+++ b/conf.hpp
@@ -46,10 +46,10 @@ struct ControllerInfo
struct ZoneConfig
{
/* The minimum RPM value we would ever want. */
- double minthermalrpm;
+ double minThermalRpm;
/* If the sensors are in fail-safe mode, this is the percentage to use. */
- double failsafepercent;
+ double failsafePercent;
};
using PIDConf = std::map<std::string, struct ControllerInfo>;
diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp
index 4cdeb44..0045822 100644
--- a/dbus/dbusconfiguration.cpp
+++ b/dbus/dbusconfiguration.cpp
@@ -92,8 +92,8 @@ void debugPrint(void)
for (const auto& zone : zoneDetailsConfig)
{
std::cout << "\t{" << zone.first << ",\n";
- std::cout << "\t\t{" << zone.second.minthermalrpm << ", ";
- std::cout << zone.second.failsafepercent << "}\n\t},\n";
+ std::cout << "\t\t{" << zone.second.minThermalRpm << ", ";
+ std::cout << zone.second.failsafePercent << "}\n\t},\n";
}
std::cout << "}\n\n";
std::cout << "ZoneConfig\n";
@@ -294,9 +294,9 @@ void init(sdbusplus::bus::bus& bus)
size_t index = getZoneIndex(name, foundZones);
auto& details = zoneDetailsConfig[index];
- details.minthermalrpm =
+ details.minThermalRpm =
std::visit(VariantToDoubleVisitor(), zone.at("MinThermalRpm"));
- details.failsafepercent = std::visit(VariantToDoubleVisitor(),
+ details.failsafePercent = std::visit(VariantToDoubleVisitor(),
zone.at("FailSafePercent"));
}
auto findBase = configuration.second.find(pidConfigurationInterface);
diff --git a/examples/swampd.conf b/examples/swampd.conf
index c17a75c..c4fab5e 100644
--- a/examples/swampd.conf
+++ b/examples/swampd.conf
@@ -58,7 +58,7 @@ sensors = (
zones = (
{ id = 0x01
- minthermalrpm = 3000.0
+ minThermalRpm = 3000.0
failsafepwm = 90.0
pids = (
{ name = "allfans"
diff --git a/pid/builder.cpp b/pid/builder.cpp
index 8fef528..2a64215 100644
--- a/pid/builder.cpp
+++ b/pid/builder.cpp
@@ -63,8 +63,8 @@ std::unordered_map<int64_t, std::unique_ptr<PIDZone>>
const PIDConf& pidConfig = zi.second;
auto zone = std::make_unique<PIDZone>(
- zoneId, zoneConf->second.minthermalrpm,
- zoneConf->second.failsafepercent, mgr, modeControlBus,
+ zoneId, zoneConf->second.minThermalRpm,
+ zoneConf->second.failsafePercent, mgr, modeControlBus,
getControlPath(zi.first).c_str(), deferSignals);
std::cerr << "Zone Id: " << zone->getZoneID() << "\n";
diff --git a/pid/builderconfig.cpp b/pid/builderconfig.cpp
index f85e1c1..652724d 100644
--- a/pid/builderconfig.cpp
+++ b/pid/builderconfig.cpp
@@ -76,9 +76,9 @@ std::unordered_map<int64_t, std::unique_ptr<PIDZone>>
zoneSettings.lookupValue("id", id);
- thisZoneConfig.minthermalrpm = zoneSettings.lookup("minthermalrpm");
- thisZoneConfig.failsafepercent =
- zoneSettings.lookup("failsafepercent");
+ thisZoneConfig.minThermalRpm = zoneSettings.lookup("minThermalRpm");
+ thisZoneConfig.failsafePercent =
+ zoneSettings.lookup("failsafePercent");
const Setting& pids = zoneSettings["pids"];
int pidCount = pids.getLength();
diff --git a/scripts/writezone.mako.cpp b/scripts/writezone.mako.cpp
index 5c4f4fa..f466060 100644
--- a/scripts/writezone.mako.cpp
+++ b/scripts/writezone.mako.cpp
@@ -11,8 +11,8 @@ std::map<int64_t, struct ZoneConfig> zoneDetailsConfig = {
% if zone:
<%
zConf = ZoneDict[zone]
- min = zConf["minthermalrpm"]
- percent = zConf["failsafepercent"]
+ min = zConf["minThermalRpm"]
+ percent = zConf["failsafePercent"]
%>
{${zone},
{${min}, ${percent}},
diff --git a/scripts/zone-example.txt b/scripts/zone-example.txt
index 88adc26..3f987a2 100644
--- a/scripts/zone-example.txt
+++ b/scripts/zone-example.txt
@@ -1,4 +1,4 @@
0x01: /* The zone ID */
- minthermalrpm: 3000.0 /* The minimum thermal RPM value. (double) */
+ minThermalRpm: 3000.0 /* The minimum thermal RPM value. (double) */
/* The percent to use when the zone is in fail-safe mode. (double) */
- failsafepercent: 90.0
+ failsafePercent: 90.0
diff --git a/scripts/zone-example.yaml b/scripts/zone-example.yaml
index ef422a5..8fecf71 100644
--- a/scripts/zone-example.yaml
+++ b/scripts/zone-example.yaml
@@ -1,3 +1,3 @@
0x01:
- minthermalrpm: 3000.0
- failsafepercent: 90.0
+ minThermalRpm: 3000.0
+ failsafePercent: 90.0
OpenPOWER on IntegriCloud