Decreases allowed based on all groups

For speed decreases to occur, all sensor groups involved with setting a
net decrease delta must be below their given t-control low values for
the associated zone. This handles the case where one or more sensor
groups' temperatures stabilize above their t-control low value, but one
or more other sensor groups' temperatures are below their t-control low
value which would result in speed decrease requests that could
eventually lead to fan speed oscillations.

Resolves openbmc/openbmc#2710

Change-Id: I382de5d3f9c3e631a332d49dfcb06e705ff6fc17
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/zone.hpp b/control/zone.hpp
index bc08f48..406af13 100644
--- a/control/zone.hpp
+++ b/control/zone.hpp
@@ -89,6 +89,17 @@
         }
 
         /**
+         * @brief Sets the decrease allowed state of a group
+         *
+         * @param[in] group - A group that affects speed decreases
+         * @param[in] isAllow - Allow state according to group
+         */
+        inline void setDecreaseAllow(const Group* group, bool isAllow)
+        {
+            _decAllowed[*(group)] = isAllow;
+        }
+
+        /**
          * @brief Sets a given object's property value
          *
          * @param[in] object - Name of the object containing the property
@@ -487,6 +498,11 @@
         std::map<const Group, bool> _floorChange;
 
         /**
+         * @brief Map of groups controlling decreases allowed
+         */
+        std::map<const Group, bool> _decAllowed;
+
+        /**
          * @brief Map of group service names
          */
         std::map<const Group, std::vector<Service>> _services;