control: Create MappedFloor action

This action can be used to set a floor value based on 2 or more groups
having values within certain ranges, where the key group chooses the set
of tables in which to check the remaining group values.

For example, with the following JSON:

    {
    "name": "mapped_floor",
    "key_group": "ambient_temp",
    "fan_floors": [
        {
        "key": 27,
        "floors": [
          {
            "group": "altitude",
            "floors": [
               {
                 "value": 5000,
                 "floor": 2000
               },
               {
                 "value": 7000,
                 "floor": 6000
               }
            ]
          },
          {
            "group": "power_mode",
            "floors": [
               {
                 "value": "PowerSave",
                 "floor": 3000
               },
               {
                 "value": "MaximumPerformance",
                 "floor": 5000
               }
            ]
          }
        ]
        }
      ]
    }

If the ambient_temp group has a value less than 27, then it looks up the
values for the altitude and power_mode groups, where for altitude, since
it's numeric, it will use a <= operator, and for power_mode, since it's
a string, it will use an == operator when comparing to the values in the
JSON.  It will then choose the largest floor value between the altitude
and power_mode results.

There are several scenarios that result in a default floor being set.

Full action documentation is in the class header file.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I8e0ff3a97ff73dd20018473c1993b2e043276099
3 files changed