ifw-fcf  3.0.0
actuatorConfig.hpp
Go to the documentation of this file.
1 
10 #ifndef FCF_DEVMGR_DEVICE_ACTUATOR_CONFIG_HPP
11 #define FCF_DEVMGR_DEVICE_ACTUATOR_CONFIG_HPP
12 
13 // System headers
14 #include <string>
15 
16 // Third party headers
17 #include <yaml-cpp/yaml.h>
18 
19 #include "fcf/common/iComm.hpp"
25 
26 namespace fcf {
27  namespace devmgr {
28  namespace actuator {
29 
30  // Constants for internal mapping
31  constexpr auto CI_ACTIVE_LOW_ON = "low_on";
32  constexpr auto CI_ACTIVE_LOW_SWITCH = "low_switch";
33  constexpr auto CI_INVERT_ANALOG = "invert_analog";
34  constexpr auto CI_ANALOG_THRESHOLD = "analog_threshold";
35  constexpr auto CI_MAX_ON = "maxon";
36  constexpr auto CI_INITIAL_STATE = "initial_state";
37  constexpr auto CI_AUTO_OP = "auto_operational";
38  constexpr auto CI_TIMEOUT = "timeout";
39  constexpr auto CI_SIG_STABLE_PERIOD = "signal_stable_period";
40 
41  // Specific Actuator RPC
42  const std::string RPC_ON = "rpcSwitchOn";
43  const std::string RPC_OFF = "rpcSwitchOff";
44 
45  // Specific constant values for actuator device state/substate
46  constexpr int SUBSTATE_READY_OFF = 103;
47  constexpr int SUBSTATE_READY_ON = 104;
48  constexpr int SUBSTATE_SWITCHING_OFF = 109;
49  constexpr int SUBSTATE_SWITCHING_ON = 110;
50 
51  constexpr int SUBSTATE_OP_DISABLING = 205;
52  constexpr int SUBSTATE_OP_OFF = 206;
53  constexpr int SUBSTATE_OP_SWITCHING_OFF = 207;
54  constexpr int SUBSTATE_OP_ON = 209;
55  constexpr int SUBSTATE_OP_SWITCHING_ON = 210;
56 
57  constexpr auto SUBSTATE_NOTREADY_STR = "NotReady";
58  constexpr auto SUBSTATE_READY_OFF_STR = "Ready/Off";
59  constexpr auto SUBSTATE_READY_ON_STR = "Ready/On";
60  constexpr auto SUBSTATE_SWITCHING_OFF_STR = "Ready/Swit_off";
61  constexpr auto SUBSTATE_SWITCHING_ON_STR = "Ready/Swit_on";
62  constexpr auto SUBSTATE_OP_OFF_STR = "Off";
63  constexpr auto SUBSTATE_OP_SWITCHING_OFF_STR = "Switching_off";
64  constexpr auto SUBSTATE_OP_ON_STR = "On";
65  constexpr auto SUBSTATE_OP_SWITCHING_ON_STR = "Switching_on";
66 
67 
68  const std::unordered_map<short, std::string> SubstateMap = {
81  };
82 
83 
84  const std::vector<std::string> cfgMapping = {
85  };
86 
87  const std::vector<std::string> statMapping = {
92  };
93 
94  const std::vector<std::string> rpcMapping = {
100  RPC_OFF,
101  RPC_ON
102  };
103 
112  {
113 
114  // Enumerations of configuration paramters
115  enum {
116  CFG_LOWON = 1,
117  CFG_LOWSWITCH,
118  CFG_AUTO_OP,
119  CFG_INANALOG,
120  CFG_ANTHRES,
121  CFG_MAXON,
122  CFG_SIG_STABLE_PERIOD,
123  CFG_INITSTATE,
124  CFG_TIMEOUT
125  };
126 
127  public:
128 
134  ActuatorConfig(const std::string filename,
135  const std::string name);
136 
140  virtual ~ActuatorConfig();
141 
142 
143  private:
144 
145  };
146  }
147  }
148 }
149 
150 
151 #endif //FCF_DEVMGR_DEVICE_ACTUATOR_CONFIG_H
fcf::devmgr::actuator::SUBSTATE_READY_ON
constexpr int SUBSTATE_READY_ON
Definition: actuatorConfig.hpp:47
actuatorHwErrors.hpp
actuatorHwErrors header file.
fcf::devmgr::actuator::SUBSTATE_OP_SWITCHING_OFF
constexpr int SUBSTATE_OP_SWITCHING_OFF
Definition: actuatorConfig.hpp:53
fcf::devmgr::actuator::CI_AUTO_OP
constexpr auto CI_AUTO_OP
Definition: actuatorConfig.hpp:37
dataContext.hpp
DataContext class header file.
fcf::devmgr::actuator::statMapping
const std::vector< std::string > statMapping
Definition: actuatorConfig.hpp:87
fcf::devmgr::actuator::SubstateMap
const std::unordered_map< short, std::string > SubstateMap
Definition: actuatorConfig.hpp:68
fcf::devmgr::actuator::SUBSTATE_READY_OFF_STR
constexpr auto SUBSTATE_READY_OFF_STR
Definition: actuatorConfig.hpp:58
fcf::devmgr::common::CI_STAT_ERROR_CODE
constexpr auto CI_STAT_ERROR_CODE
Definition: deviceConfig.hpp:54
fcf::devmgr::actuator::SUBSTATE_NOTREADY_STR
constexpr auto SUBSTATE_NOTREADY_STR
Definition: actuatorConfig.hpp:57
fcf::devmgr::actuator::SUBSTATE_SWITCHING_ON
constexpr int SUBSTATE_SWITCHING_ON
Definition: actuatorConfig.hpp:49
fcf::devmgr::actuator::rpcMapping
const std::vector< std::string > rpcMapping
Definition: actuatorConfig.hpp:94
deviceConfig.hpp
DeviceConfig class header file.
fcf::devmgr::actuator::CI_INITIAL_STATE
constexpr auto CI_INITIAL_STATE
Definition: actuatorConfig.hpp:36
fcf::devmgr::actuator::ActuatorConfig::ActuatorConfig
ActuatorConfig(const std::string filename, const std::string name)
DeviceConfig constructor.
Definition: actuatorConfig.cpp:28
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::actuator::SUBSTATE_READY_ON_STR
constexpr auto SUBSTATE_READY_ON_STR
Definition: actuatorConfig.hpp:59
fcf::devmgr::actuator::SUBSTATE_OP_DISABLING
constexpr int SUBSTATE_OP_DISABLING
Definition: actuatorConfig.hpp:51
fcf::devmgr::actuator::SUBSTATE_OP_SWITCHING_ON
constexpr int SUBSTATE_OP_SWITCHING_ON
Definition: actuatorConfig.hpp:55
fcf::devmgr::common::RPC_STOP
constexpr auto RPC_STOP
Definition: deviceConfig.hpp:46
fcf::devmgr::common::RPC_DISABLE
constexpr auto RPC_DISABLE
Definition: deviceConfig.hpp:45
fcf::devmgr::actuator::CI_ANALOG_THRESHOLD
constexpr auto CI_ANALOG_THRESHOLD
Definition: actuatorConfig.hpp:34
fcf::devmgr::actuator::SUBSTATE_SWITCHING_ON_STR
constexpr auto SUBSTATE_SWITCHING_ON_STR
Definition: actuatorConfig.hpp:61
actuatorRpcErrors.hpp
actuatorRpcErrors header file.
fcf::devmgr::common::SUBSTATE_NOTREADY_STR
constexpr auto SUBSTATE_NOTREADY_STR
Definition: deviceConfig.hpp:87
fcf
Definition: actionMgr.cpp:29
configSet.hpp
configSet class header file.
fcf::devmgr::common::SUBSTATE_INITIALISING_STR
constexpr auto SUBSTATE_INITIALISING_STR
Definition: deviceConfig.hpp:88
fcf::devmgr::common::SUBSTATE_NOTREADY
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:82
fcf::devmgr::actuator::SUBSTATE_READY_OFF
constexpr int SUBSTATE_READY_OFF
Definition: actuatorConfig.hpp:46
fcf::devmgr::actuator::RPC_ON
const std::string RPC_ON
Definition: actuatorConfig.hpp:42
fcf::devmgr::actuator::CI_INVERT_ANALOG
constexpr auto CI_INVERT_ANALOG
Definition: actuatorConfig.hpp:33
fcf::devmgr::common::SUBSTATE_INITIALISING
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:84
fcf::devmgr::actuator::CI_SIG_STABLE_PERIOD
constexpr auto CI_SIG_STABLE_PERIOD
Definition: actuatorConfig.hpp:39
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::common::SUBSTATE_OP_ERROR_STR
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:96
fcf::devmgr::actuator::SUBSTATE_OP_OFF
constexpr int SUBSTATE_OP_OFF
Definition: actuatorConfig.hpp:52
fcf::devmgr::actuator::SUBSTATE_OP_OFF_STR
constexpr auto SUBSTATE_OP_OFF_STR
Definition: actuatorConfig.hpp:62
fcf::devmgr::actuator::SUBSTATE_OP_ON_STR
constexpr auto SUBSTATE_OP_ON_STR
Definition: actuatorConfig.hpp:64
fcf::devmgr::actuator::SUBSTATE_OP_SWITCHING_OFF_STR
constexpr auto SUBSTATE_OP_SWITCHING_OFF_STR
Definition: actuatorConfig.hpp:63
fcf::devmgr::actuator::SUBSTATE_SWITCHING_OFF
constexpr int SUBSTATE_SWITCHING_OFF
Definition: actuatorConfig.hpp:48
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
fcf::devmgr::actuator::SUBSTATE_OP_SWITCHING_ON_STR
constexpr auto SUBSTATE_OP_SWITCHING_ON_STR
Definition: actuatorConfig.hpp:65
fcf::devmgr::common::RPC_INIT
constexpr auto RPC_INIT
Definition: deviceConfig.hpp:43
fcf::devmgr::actuator::SUBSTATE_SWITCHING_OFF_STR
constexpr auto SUBSTATE_SWITCHING_OFF_STR
Definition: actuatorConfig.hpp:60
fcf::devmgr::common::DeviceConfig
Device Configuration class.
Definition: deviceConfig.hpp:125
fcf::devmgr::actuator::cfgMapping
const std::vector< std::string > cfgMapping
Definition: actuatorConfig.hpp:84
fcf::devmgr::actuator::CI_ACTIVE_LOW_ON
constexpr auto CI_ACTIVE_LOW_ON
Definition: actuatorConfig.hpp:31
fcf::devmgr::actuator::RPC_OFF
const std::string RPC_OFF
Definition: actuatorConfig.hpp:43
fcf::devmgr::actuator::ActuatorConfig
actuator Configuration class
Definition: actuatorConfig.hpp:112
fcf::devmgr::common::SUBSTATE_ERROR_STR
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:90
fcf::devmgr::actuator::SUBSTATE_OP_ON
constexpr int SUBSTATE_OP_ON
Definition: actuatorConfig.hpp:54
fcf::devmgr::actuator::CI_TIMEOUT
constexpr auto CI_TIMEOUT
Definition: actuatorConfig.hpp:38
fcf::devmgr::actuator::ActuatorConfig::~ActuatorConfig
virtual ~ActuatorConfig()
DeviceConfig destructor.
Definition: actuatorConfig.cpp:38
fcf::devmgr::actuator::CI_ACTIVE_LOW_SWITCH
constexpr auto CI_ACTIVE_LOW_SWITCH
Definition: actuatorConfig.hpp:32
fcf::devmgr::common::RPC_RESET
constexpr auto RPC_RESET
Definition: deviceConfig.hpp:47
fcf::devmgr::actuator::CI_MAX_ON
constexpr auto CI_MAX_ON
Definition: actuatorConfig.hpp:35