From 1de66629a31ee2a4751b2f30c5baa11464ba5aad Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Mon, 12 Jun 2017 13:13:02 -0500 Subject: Add default floor speed support Change-Id: Id2d3b362e79e7a8c2330181f68ae11e43f84e2fd Signed-off-by: Matthew Barth --- control/gen-fan-zone-defs.py | 3 +++ control/types.hpp | 8 +++++--- control/zone.cpp | 3 ++- control/zone.hpp | 15 +++++++++++++++ 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/control/gen-fan-zone-defs.py b/control/gen-fan-zone-defs.py index 20c1534..eb33956 100755 --- a/control/gen-fan-zone-defs.py +++ b/control/gen-fan-zone-defs.py @@ -49,6 +49,7 @@ const std::vector Manager::_zoneLayouts ZoneDefinition{ ${zone['num']}, ${zone['full_speed']}, + ${zone['default_floor']}, std::vector{ %for fan in zone['fans']: FanDefinition{ @@ -294,6 +295,8 @@ def buildZoneData(zone_data, fan_data, events_data, zone_conditions_data): zone['full_speed'] = z['full_speed'] + zone['default_floor'] = z['default_floor'] + # 'cooling_profiles' is optional (use 'all' instead) if ('cooling_profiles' not in z) or \ (z['cooling_profiles'] is None): diff --git a/control/types.hpp b/control/types.hpp index de56186..6e99950 100644 --- a/control/types.hpp +++ b/control/types.hpp @@ -58,10 +58,12 @@ using EventData = std::tuple; constexpr auto zoneNumPos = 0; constexpr auto fullSpeedPos = 1; -constexpr auto fanListPos = 2; -constexpr auto setSpeedEventsPos = 3; +constexpr auto floorSpeedPos = 2; +constexpr auto fanListPos = 3; +constexpr auto setSpeedEventsPos = 4; using ZoneDefinition = std::tuple, std::vector>; diff --git a/control/zone.cpp b/control/zone.cpp index a57174d..1a299e2 100644 --- a/control/zone.cpp +++ b/control/zone.cpp @@ -31,7 +31,8 @@ Zone::Zone(Mode mode, const ZoneDefinition& def) : _bus(bus), _fullSpeed(std::get(def)), - _zoneNum(std::get(def)) + _zoneNum(std::get(def)), + _defFloorSpeed(std::get(def)) { auto& fanDefs = std::get(def); diff --git a/control/zone.hpp b/control/zone.hpp index 1af0c22..c524397 100644 --- a/control/zone.hpp +++ b/control/zone.hpp @@ -113,6 +113,16 @@ class Zone _properties[object][interface][property]); }; + /** + * @brief Get the default floor speed + * + * @return - The defined default floor speed + */ + inline auto getDefFloor() + { + return _defFloorSpeed; + }; + private: /** @@ -130,6 +140,11 @@ class Zone */ const size_t _zoneNum; + /** + * The default floor speed for the zone + */ + const uint64_t _defFloorSpeed; + /** * Automatic fan control active state */ -- cgit v1.2.1