Implementing the TempToMargin feature

Wrapping the input name std::string in a new structure SensorInput, so
that the TempToMargin information can be cleanly carried along with
it, all the way down to the PID input processing layer where it is
needed. This allows the conversion to be done just-in-time before the
temperature reading is interpreted, minimizing the blast radius of
this change. Nonetheless, because of the type change, there was a
somewhat large blast radius to implement this feature.

The design, and the documentation, is already here:
https://github.com/openbmc/phosphor-pid-control/issues/23

Tested: Added unit tests for JSON parsing and for proper execution
of the TempToMargin feature. They pass. Ran it locally, on our
appropriately-configured system, and it seems to work for me.

Change-Id: I598ba485195aaa70c26e91a1da3ab88fff8c3a4c
Signed-off-by: Josh Lehan <krellan@google.com>
diff --git a/pid/thermalcontroller.hpp b/pid/thermalcontroller.hpp
index 752c105..ac551d2 100644
--- a/pid/thermalcontroller.hpp
+++ b/pid/thermalcontroller.hpp
@@ -1,5 +1,6 @@
 #pragma once
 
+#include "conf.hpp"
 #include "ec/pid.hpp"
 #include "pidcontroller.hpp"
 
@@ -44,14 +45,13 @@
 class ThermalController : public PIDController
 {
   public:
-    static std::unique_ptr<PIDController>
-        createThermalPid(ZoneInterface* owner, const std::string& id,
-                         const std::vector<std::string>& inputs,
-                         double setpoint, const ec::pidinfo& initial,
-                         const ThermalType& type);
+    static std::unique_ptr<PIDController> createThermalPid(
+        ZoneInterface* owner, const std::string& id,
+        const std::vector<pid_control::conf::SensorInput>& inputs,
+        double setpoint, const ec::pidinfo& initial, const ThermalType& type);
 
     ThermalController(const std::string& id,
-                      const std::vector<std::string>& inputs,
+                      const std::vector<pid_control::conf::SensorInput>& inputs,
                       const ThermalType& type, ZoneInterface* owner) :
         PIDController(id, owner),
         _inputs(inputs), type(type)
@@ -62,7 +62,7 @@
     void outputProc(double value) override;
 
   private:
-    std::vector<std::string> _inputs;
+    std::vector<pid_control::conf::SensorInput> _inputs;
     ThermalType type;
 };