Support to accumulate PWM of different controllers for same sensor

Description:
1. Add one property: accumulateSetPoint in zone of fan table that could
   be used to enable accumulation of output PWM of different controllers
   with same sensor.

2. Add one property: checkHysterWithSetpt in pid info of fan table to
   select to compare current input and setpoint to check hysteresis.

3. The purpose of accumulate the stepwise output and PID output for
   one sensor is that the setting of stepwise could use to prevent
   the fan speed from suddenly increasing from a very low speed to a
   very high speed due to reaching the setpoint.

   Use stepwise before setpoint could also keep the PWM steady at
   low ambient temperature.

Design:
1. Search "accumulateSetPoint" field in fan table.
   If the value was true, accumulate the output PWM of different
   controllers with same profile name.

2. Support two method to calculate PID output that could be chosen by
   setting the "checkHysterWithSetpt" to true in pid info of fan table.

   If the flag was set to true, it won't calculate PWM output if the
   input lower than setpoint.

Test Case:
1. Check the output PWM of different controllers with same profile
   name could be accumulated - pass.

2. Set "checkHysterWithSetpt" to true and check PID output would not be
   calculated if the input temperature was lower than setpoint - pass.

Please see more details in gist:
https://gist.github.com/DelphineCCChiu/a6170d3e1a12fc4ee76fad324382fba3

Change-Id: I9f38f250d72545784c6c11be2fde7d45f0b385c4
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
diff --git a/test/pid_thermalcontroller_unittest.cpp b/test/pid_thermalcontroller_unittest.cpp
index 7aee1e1..8abedf5 100644
--- a/test/pid_thermalcontroller_unittest.cpp
+++ b/test/pid_thermalcontroller_unittest.cpp
@@ -211,6 +211,7 @@
     std::vector<pid_control::conf::SensorInput> inputs = {{"fleeting0"}};
     double setpoint = 10.0;
     ec::pidinfo initial;
+    initial.checkHysterWithSetpt = false;
     initial.negativeHysteresis = 4.0;
 
     std::unique_ptr<PIDController> p = ThermalController::createThermalPid(
@@ -244,6 +245,7 @@
     std::vector<pid_control::conf::SensorInput> inputs = {{"fleeting0"}};
     double setpoint = 10.0;
     ec::pidinfo initial;
+    initial.checkHysterWithSetpt = false;
     initial.positiveHysteresis = 5.0;
 
     std::unique_ptr<PIDController> p = ThermalController::createThermalPid(
diff --git a/test/pid_zone_unittest.cpp b/test/pid_zone_unittest.cpp
index 6c570cc..1f6e672 100644
--- a/test/pid_zone_unittest.cpp
+++ b/test/pid_zone_unittest.cpp
@@ -53,6 +53,7 @@
     SensorManager m(bus_mock_passive, bus_mock_host);
 
     bool defer = true;
+    bool accSetPoint = false;
     const char* objPath = "/path/";
     int64_t zone = 1;
     double minThermalOutput = 1000.0;
@@ -83,7 +84,7 @@
         .WillOnce(Return(0));
 
     DbusPidZone p(zone, minThermalOutput, failSafePercent, cycleTime, m,
-                  bus_mock_mode, objPath, defer);
+                  bus_mock_mode, objPath, defer, accSetPoint);
     // Success.
 }
 
@@ -126,9 +127,9 @@
             .Times(::testing::AnyNumber())
             .WillOnce(Return(0));
 
-        zone = std::make_unique<DbusPidZone>(zoneId, minThermalOutput,
-                                             failSafePercent, cycleTime, mgr,
-                                             bus_mock_mode, objPath, defer);
+        zone = std::make_unique<DbusPidZone>(
+            zoneId, minThermalOutput, failSafePercent, cycleTime, mgr,
+            bus_mock_mode, objPath, defer, accSetPoint);
     }
 
     // unused
@@ -146,6 +147,7 @@
     double failSafePercent = 0;
     double setpoint = 50.0;
     bool defer = true;
+    bool accSetPoint = false;
     const char* objPath = "/path/";
     SensorManager mgr;
     conf::CycleTime cycleTime;
diff --git a/test/zone_mock.hpp b/test/zone_mock.hpp
index a3d6be9..4e34890 100644
--- a/test/zone_mock.hpp
+++ b/test/zone_mock.hpp
@@ -46,6 +46,7 @@
 
     MOCK_CONST_METHOD0(getCycleIntervalTime, uint64_t());
     MOCK_CONST_METHOD0(getUpdateThermalsCycle, uint64_t());
+    MOCK_CONST_METHOD0(getAccSetPoint, bool());
 
     MOCK_METHOD1(getSensor, Sensor*(const std::string&));