ifw-fcf  3.0.0
lampConfig.hpp
Go to the documentation of this file.
1 
10 #ifndef FCF_DEVMGR_DEVICE_LAMP_CONFIG_HPP
11 #define FCF_DEVMGR_DEVICE_LAMP_CONFIG_HPP
12 
13 // System headers
14 #include <string>
15 
16 // Third party headers
17 #include <yaml-cpp/yaml.h>
18 
19 
20 #include <fcf/common/iComm.hpp>
26 
27 namespace fcf::devmgr::lamp {
28 
29 
30  // Constants for internal mapping
31  constexpr auto CI_ACTIVE_LOW_FAULT = "low_fault";
32  constexpr auto CI_ACTIVE_LOW_ON = "low_on";
33  constexpr auto CI_ACTIVE_LOW_SWITCH = "low_switch";
34  constexpr auto CI_IGNORE_FAULT = "ignore_fault";
35  constexpr auto CI_INVERT_ANALOG = "invert_analog";
36  constexpr auto CI_ANALOG_THRESHOLD = "analog_threshold";
37  constexpr auto CI_ANALOG_RANGE = "analog_range";
38  constexpr auto CI_COOLDDOWN = "cooldown";
39  constexpr auto CI_MAX_ON = "maxon";
40  constexpr auto CI_WARMUP = "warmup";
41  constexpr auto CI_INITIAL_STATE = "initial_state";
42  constexpr auto CI_TIMEOUT = "timeout";
43 
44  // Specifics lamp status values
45  const std::string CI_STAT_INTENSITY = "intensity";
46 
47  // Specific lamp RPC
48  const std::string RPC_ON = "rpcSwitchOn";
49  const std::string RPC_OFF = "rpcSwitchOff";
50 
51  // Specific constant values for lamp device state/substate
52  constexpr int SUBSTATE_READY_OFF = 103;
53  constexpr int SUBSTATE_READY_ON = 104;
54 
55  constexpr int SUBSTATE_OP_DISABLING = 205;
56  constexpr int SUBSTATE_OP_OFF = 206;
57  constexpr int SUBSTATE_OP_SWITCHING_OFF = 207;
58  constexpr int SUBSTATE_OP_COOLING = 208;
59  constexpr int SUBSTATE_OP_ON = 209;
60  constexpr int SUBSTATE_OP_SWITCHING_ON = 210;
61  constexpr int SUBSTATE_OP_WARMING = 211;
62 
63  constexpr auto SUBSTATE_NOTREADY_STR = "NotReady";
64  constexpr auto SUBSTATE_READY_OFF_STR = "Ready/Off";
65  constexpr auto SUBSTATE_READY_ON_STR = "Ready/On";
66  constexpr auto SUBSTATE_OP_DISABLING_STR = "Disabling";
67  constexpr auto SUBSTATE_OP_OFF_STR = "Off";
68  constexpr auto SUBSTATE_OP_SWITCHING_OFF_STR = "Switching off";
69  constexpr auto SUBSTATE_OP_COOLING_STR = "Cooling down";
70  constexpr auto SUBSTATE_OP_ON_STR = "On";
71  constexpr auto SUBSTATE_OP_SWITCHING_ON_STR = "Switching on";
72  constexpr auto SUBSTATE_OP_WARMING_STR = "Warming up";
73 
74 
75  const std::unordered_map<short, std::string> SubstateMap = {
89  };
90 
91  const std::vector<std::string> cfgMapping = {
94  };
95 
96  const std::vector<std::string> statMapping = {
102  };
103 
104  const std::vector<std::string> rpcMapping = {
110  RPC_OFF,
111  RPC_ON
112  };
113 
122  {
123 
124  // Enumerations of configuration paramters
125  enum {
126  CFG_LOWFAULT = 1,
127  CFG_LOWON = 2,
128  CFG_LOWSWITCH = 3,
129  CFG_IGFAULT = 4,
130  CFG_INANALOG = 5,
131  CFG_ANTHRES = 6,
132  CFG_ANRANGE = 7,
133  CFG_COOLDOWN = 8,
134  CFG_MAXON = 9,
135  CFG_WARMUP = 10,
136  CFG_INITSTATE = 11,
137  CFG_TIMEOUT = 12,
138  END_ENUM_LAMP // WARNING: This should be always last enumerator.
139  };
140 
141  public:
142 
148  LampConfig(const std::string filename,
149  const std::string name);
150 
154  virtual ~LampConfig();
155 
156 
157 
158 
159  };
160 
161 } // fcf::devmgr::lamp
162 
163 
164 #endif //FCF_DEVMGR_DEVICE_LAMP_CONFIG_H
fcf::devmgr::lamp::SUBSTATE_OP_COOLING_STR
constexpr auto SUBSTATE_OP_COOLING_STR
Definition: lampConfig.hpp:69
fcf::devmgr::lamp::SUBSTATE_OP_SWITCHING_ON_STR
constexpr auto SUBSTATE_OP_SWITCHING_ON_STR
Definition: lampConfig.hpp:71
lampRpcErrors.hpp
LampRpcErrors header file.
dataContext.hpp
DataContext class header file.
fcf::devmgr::lamp::rpcMapping
const std::vector< std::string > rpcMapping
Definition: lampConfig.hpp:104
fcf::devmgr::lamp::CI_ACTIVE_LOW_ON
constexpr auto CI_ACTIVE_LOW_ON
Definition: lampConfig.hpp:32
fcf::devmgr::lamp
Definition: lamp.hpp:22
fcf::devmgr::lamp::CI_TIMEOUT
constexpr auto CI_TIMEOUT
Definition: lampConfig.hpp:42
fcf::devmgr::lamp::LampConfig::~LampConfig
virtual ~LampConfig()
DeviceConfig destructor.
Definition: lampConfig.cpp:62
fcf::devmgr::lamp::CI_MAX_ON
constexpr auto CI_MAX_ON
Definition: lampConfig.hpp:39
fcf::devmgr::common::CI_STAT_ERROR_CODE
constexpr auto CI_STAT_ERROR_CODE
Definition: deviceConfig.hpp:54
fcf::devmgr::lamp::SUBSTATE_READY_ON
constexpr int SUBSTATE_READY_ON
Definition: lampConfig.hpp:53
fcf::devmgr::lamp::CI_WARMUP
constexpr auto CI_WARMUP
Definition: lampConfig.hpp:40
fcf::devmgr::lamp::SUBSTATE_READY_ON_STR
constexpr auto SUBSTATE_READY_ON_STR
Definition: lampConfig.hpp:65
fcf::devmgr::lamp::SUBSTATE_OP_OFF_STR
constexpr auto SUBSTATE_OP_OFF_STR
Definition: lampConfig.hpp:67
deviceConfig.hpp
DeviceConfig class header file.
fcf::devmgr::lamp::CI_STAT_INTENSITY
const std::string CI_STAT_INTENSITY
Definition: lampConfig.hpp:45
fcf::devmgr::lamp::SUBSTATE_OP_SWITCHING_OFF_STR
constexpr auto SUBSTATE_OP_SWITCHING_OFF_STR
Definition: lampConfig.hpp:68
fcf::devmgr::common::CI_STAT_STATE
constexpr auto CI_STAT_STATE
Definition: deviceConfig.hpp:51
fcf::devmgr::common::CI_STAT_LOCAL
constexpr auto CI_STAT_LOCAL
Definition: deviceConfig.hpp:53
fcf::devmgr::lamp::SUBSTATE_READY_OFF_STR
constexpr auto SUBSTATE_READY_OFF_STR
Definition: lampConfig.hpp:64
fcf::devmgr::lamp::statMapping
const std::vector< std::string > statMapping
Definition: lampConfig.hpp:96
fcf::devmgr::lamp::SUBSTATE_OP_DISABLING_STR
constexpr auto SUBSTATE_OP_DISABLING_STR
Definition: lampConfig.hpp:66
fcf::devmgr::lamp::CI_ACTIVE_LOW_FAULT
constexpr auto CI_ACTIVE_LOW_FAULT
Definition: lampConfig.hpp:31
fcf::devmgr::common::RPC_STOP
constexpr auto RPC_STOP
Definition: deviceConfig.hpp:46
fcf::devmgr::lamp::SUBSTATE_READY_OFF
constexpr int SUBSTATE_READY_OFF
Definition: lampConfig.hpp:52
fcf::devmgr::lamp::CI_INITIAL_STATE
constexpr auto CI_INITIAL_STATE
Definition: lampConfig.hpp:41
fcf::devmgr::lamp::CI_COOLDDOWN
constexpr auto CI_COOLDDOWN
Definition: lampConfig.hpp:38
fcf::devmgr::common::RPC_DISABLE
constexpr auto RPC_DISABLE
Definition: deviceConfig.hpp:45
fcf::devmgr::lamp::LampConfig
Lamp Configuration class.
Definition: lampConfig.hpp:122
fcf::devmgr::lamp::CI_IGNORE_FAULT
constexpr auto CI_IGNORE_FAULT
Definition: lampConfig.hpp:34
fcf::devmgr::lamp::SUBSTATE_OP_SWITCHING_ON
constexpr int SUBSTATE_OP_SWITCHING_ON
Definition: lampConfig.hpp:60
fcf::devmgr::lamp::SUBSTATE_OP_SWITCHING_OFF
constexpr int SUBSTATE_OP_SWITCHING_OFF
Definition: lampConfig.hpp:57
fcf::devmgr::common::SUBSTATE_NOTREADY_STR
constexpr auto SUBSTATE_NOTREADY_STR
Definition: deviceConfig.hpp:87
configSet.hpp
configSet class header file.
fcf::devmgr::common::SUBSTATE_INITIALISING_STR
constexpr auto SUBSTATE_INITIALISING_STR
Definition: deviceConfig.hpp:88
fcf::devmgr::lamp::SUBSTATE_OP_ON_STR
constexpr auto SUBSTATE_OP_ON_STR
Definition: lampConfig.hpp:70
fcf::devmgr::common::SUBSTATE_NOTREADY
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:82
fcf::devmgr::lamp::CI_ANALOG_THRESHOLD
constexpr auto CI_ANALOG_THRESHOLD
Definition: lampConfig.hpp:36
fcf::devmgr::lamp::LampConfig::LampConfig
LampConfig(const std::string filename, const std::string name)
DeviceConfig constructor.
Definition: lampConfig.cpp:25
fcf::devmgr::common::SUBSTATE_INITIALISING
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:84
fcf::devmgr::lamp::SUBSTATE_OP_DISABLING
constexpr int SUBSTATE_OP_DISABLING
Definition: lampConfig.hpp:55
fcf::devmgr::common::RPC_ENABLE
constexpr auto RPC_ENABLE
Definition: deviceConfig.hpp:44
fcf::devmgr::common::SUBSTATE_OP_ERROR
constexpr int SUBSTATE_OP_ERROR
Definition: deviceConfig.hpp:93
fcf::devmgr::lamp::CI_ACTIVE_LOW_SWITCH
constexpr auto CI_ACTIVE_LOW_SWITCH
Definition: lampConfig.hpp:33
fcf::devmgr::common::SUBSTATE_OP_ERROR_STR
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:96
fcf::devmgr::lamp::SubstateMap
const std::unordered_map< short, std::string > SubstateMap
Definition: lampConfig.hpp:75
fcf::devmgr::lamp::SUBSTATE_OP_ON
constexpr int SUBSTATE_OP_ON
Definition: lampConfig.hpp:59
fcf::devmgr::common::CI_STAT_SUBSTATE
constexpr auto CI_STAT_SUBSTATE
Definition: deviceConfig.hpp:50
fcf::devmgr::common::SUBSTATE_ERROR
constexpr int SUBSTATE_ERROR
Definition: deviceConfig.hpp:85
lampHwErrors.hpp
LampHwErrors header file.
fcf::devmgr::common::RPC_INIT
constexpr auto RPC_INIT
Definition: deviceConfig.hpp:43
fcf::devmgr::lamp::RPC_ON
const std::string RPC_ON
Definition: lampConfig.hpp:48
fcf::devmgr::common::DeviceConfig
Device Configuration class.
Definition: deviceConfig.hpp:125
fcf::devmgr::lamp::SUBSTATE_OP_WARMING_STR
constexpr auto SUBSTATE_OP_WARMING_STR
Definition: lampConfig.hpp:72
fcf::devmgr::lamp::cfgMapping
const std::vector< std::string > cfgMapping
Definition: lampConfig.hpp:91
fcf::devmgr::lamp::SUBSTATE_OP_WARMING
constexpr int SUBSTATE_OP_WARMING
Definition: lampConfig.hpp:61
fcf::devmgr::lamp::SUBSTATE_NOTREADY_STR
constexpr auto SUBSTATE_NOTREADY_STR
Definition: lampConfig.hpp:63
fcf::devmgr::lamp::CI_ANALOG_RANGE
constexpr auto CI_ANALOG_RANGE
Definition: lampConfig.hpp:37
fcf::devmgr::lamp::SUBSTATE_OP_OFF
constexpr int SUBSTATE_OP_OFF
Definition: lampConfig.hpp:56
fcf::devmgr::lamp::RPC_OFF
const std::string RPC_OFF
Definition: lampConfig.hpp:49
fcf::devmgr::common::SUBSTATE_ERROR_STR
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:90
fcf::devmgr::lamp::CI_INVERT_ANALOG
constexpr auto CI_INVERT_ANALOG
Definition: lampConfig.hpp:35
fcf::devmgr::common::RPC_RESET
constexpr auto RPC_RESET
Definition: deviceConfig.hpp:47
fcf::devmgr::lamp::SUBSTATE_OP_COOLING
constexpr int SUBSTATE_OP_COOLING
Definition: lampConfig.hpp:58