ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
constexpr int SUBSTATE_OP_SWITCHING_OFF
Definition: actuatorConfig.hpp:53
constexpr auto CI_STAT_LOCAL
Definition: deviceConfig.hpp:53
constexpr auto RPC_INIT
Definition: deviceConfig.hpp:43
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:84
constexpr int SUBSTATE_OP_ON
Definition: actuatorConfig.hpp:54
constexpr auto SUBSTATE_NOTREADY_STR
Definition: deviceConfig.hpp:87
constexpr auto CI_TIMEOUT
Definition: actuatorConfig.hpp:38
constexpr auto SUBSTATE_NOTREADY_STR
Definition: actuatorConfig.hpp:57
constexpr int SUBSTATE_READY_ON
Definition: actuatorConfig.hpp:47
const std::vector< std::string > statMapping
Definition: actuatorConfig.hpp:87
constexpr int SUBSTATE_OP_DISABLING
Definition: actuatorConfig.hpp:51
constexpr auto CI_STAT_SUBSTATE
Definition: deviceConfig.hpp:50
constexpr auto RPC_DISABLE
Definition: deviceConfig.hpp:45
const std::unordered_map< short, std::string > SubstateMap
Definition: actuatorConfig.hpp:68
constexpr auto CI_INITIAL_STATE
Definition: actuatorConfig.hpp:36
constexpr auto SUBSTATE_READY_OFF_STR
Definition: actuatorConfig.hpp:58
const std::vector< std::string > rpcMapping
Definition: actuatorConfig.hpp:94
constexpr int SUBSTATE_OP_SWITCHING_ON
Definition: actuatorConfig.hpp:55
virtual ~ActuatorConfig()
DeviceConfig destructor.
Definition: actuatorConfig.cpp:38
constexpr int SUBSTATE_SWITCHING_ON
Definition: actuatorConfig.hpp:49
constexpr auto SUBSTATE_READY_ON_STR
Definition: actuatorConfig.hpp:59
actuatorHwErrors header file.
configSet class header file.
constexpr auto RPC_STOP
Definition: deviceConfig.hpp:46
constexpr auto SUBSTATE_OP_OFF_STR
Definition: actuatorConfig.hpp:62
constexpr auto SUBSTATE_OP_ON_STR
Definition: actuatorConfig.hpp:64
constexpr auto CI_ANALOG_THRESHOLD
Definition: actuatorConfig.hpp:34
constexpr auto CI_STAT_STATE
Definition: deviceConfig.hpp:51
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:82
constexpr auto CI_SIG_STABLE_PERIOD
Definition: actuatorConfig.hpp:39
constexpr auto CI_INVERT_ANALOG
Definition: actuatorConfig.hpp:33
actuatorRpcErrors header file.
DataContext class header file.
constexpr int SUBSTATE_READY_OFF
Definition: actuatorConfig.hpp:46
constexpr int SUBSTATE_OP_OFF
Definition: actuatorConfig.hpp:52
constexpr auto CI_ACTIVE_LOW_ON
Definition: actuatorConfig.hpp:31
const std::string RPC_ON
Definition: actuatorConfig.hpp:42
constexpr auto SUBSTATE_SWITCHING_ON_STR
Definition: actuatorConfig.hpp:61
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:96
constexpr auto SUBSTATE_INITIALISING_STR
Definition: deviceConfig.hpp:88
ActuatorConfig(const std::string filename, const std::string name)
DeviceConfig constructor.
Definition: actuatorConfig.cpp:28
actuator Configuration class
Definition: actuatorConfig.hpp:111
constexpr auto SUBSTATE_SWITCHING_OFF_STR
Definition: actuatorConfig.hpp:60
constexpr auto SUBSTATE_OP_SWITCHING_OFF_STR
Definition: actuatorConfig.hpp:63
const std::vector< std::string > cfgMapping
Definition: actuatorConfig.hpp:84
constexpr int SUBSTATE_OP_ERROR
Definition: deviceConfig.hpp:93
constexpr auto RPC_RESET
Definition: deviceConfig.hpp:47
constexpr auto CI_ACTIVE_LOW_SWITCH
Definition: actuatorConfig.hpp:32
constexpr int SUBSTATE_SWITCHING_OFF
Definition: actuatorConfig.hpp:48
constexpr auto SUBSTATE_OP_SWITCHING_ON_STR
Definition: actuatorConfig.hpp:65
Device Configuration class.
Definition: deviceConfig.hpp:125
constexpr auto CI_STAT_ERROR_CODE
Definition: deviceConfig.hpp:54
constexpr int SUBSTATE_ERROR
Definition: deviceConfig.hpp:85
const std::string RPC_OFF
Definition: actuatorConfig.hpp:43
constexpr auto RPC_ENABLE
Definition: deviceConfig.hpp:44
DeviceConfig class header file.
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:90
constexpr auto CI_MAX_ON
Definition: actuatorConfig.hpp:35
constexpr auto CI_AUTO_OP
Definition: actuatorConfig.hpp:37