control: Mapped floor action can use parameters
Previously, the mapped floor action could only set floor values based on
group property values. This commit adds support to be able to use a
manager parameter instead of a floor value.
For example:
"floors": [
{
"parameter": "pcie_floor_index",
"floors": [
{
"value": 1,
"floor": 2000
}
...
}
...
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I874fa0f0c6b9befd74a095c31b893c5435b08abe
diff --git a/control/json/actions/mapped_floor.hpp b/control/json/actions/mapped_floor.hpp
index baf2701..3edbf3d 100644
--- a/control/json/actions/mapped_floor.hpp
+++ b/control/json/actions/mapped_floor.hpp
@@ -96,6 +96,14 @@
* Other notes:
* - If a group has multiple members, they must be numeric or else
* the code will throw an exception.
+ *
+ * - The group inside the floors array can also be a Manager parameter, so that
+ * this action can operate on a parameter value set by another action.
+ *
+ * So instead of
+ * "group": "altitude",
+ * it can be:
+ * "parameter": "some_parameter"
*/
class MappedFloor : public ActionBase, public ActionRegister<MappedFloor>
@@ -177,7 +185,7 @@
struct FloorGroup
{
- const Group* group;
+ std::variant<const Group*, std::string> groupOrParameter;
std::vector<FloorEntry> floorEntries;
};