control: Add 'less_than' modifier
This modifier allows one to return a value from a table based on if the
value passed to it is less than the table key value.
For example:
"modifier": {
"operator": "less_than",
"value": [
{
"arg_value": 30,
"parameter_value": 300
},
{
"arg_value": 40,
"parameter_value": 400
},
{
"arg_value": 50,
"parameter_value": 500
}
]
}
With the above config, it would do the following:
* value less than 30: return 300
* else if value less than 40: return 400
* else if value less than 50: return 500
* else: return a default value based on data type of parameter_value
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I8b47341f41723c0cdf1ee2786526550fc24551f9
diff --git a/control/json/config_base.hpp b/control/json/config_base.hpp
index 4f7a425..5bfb9f2 100644
--- a/control/json/config_base.hpp
+++ b/control/json/config_base.hpp
@@ -102,7 +102,6 @@
return _profiles;
}
- protected:
/**
* @brief Determines the data type of a JSON configured parameter that is
* used as a variant within the fan control application and returns the
@@ -143,6 +142,7 @@
"Unsupported data type for JSON object's value");
}
+ protected:
/* Name of the configuration object */
std::string _name;