ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
shutterConfig.hpp
Go to the documentation of this file.
1 
10 #ifndef FCF_DEVMGR_DEVICE_SHUTTER_CONFIG_HPP
11 #define FCF_DEVMGR_DEVICE_SHUTTER_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::devmgr::shutter {
27 
28  // Constants for internal mapping
29  constexpr auto CI_ACTIVE_LOW_CLOSED = "low_closed";
30  constexpr auto CI_ACTIVE_LOW_FAULT = "low_fault";
31  constexpr auto CI_ACTIVE_LOW_OPEN = "low_open";
32  constexpr auto CI_ACTIVE_LOW_SWITCH = "low_switch";
33  constexpr auto CI_IGNORE_CLOSED = "ignore_closed";
34  constexpr auto CI_IGNORE_FAULT = "ignore_fault";
35  constexpr auto CI_IGNORE_OPEN = "ignore_open";
36  constexpr auto CI_INITIAL_STATE = "initial_state";
37  constexpr auto CI_TIMEOUT = "timeout";
38 
39  constexpr bool DEFAULT_ACTIVE_LOW_CLOSE = false;
40  constexpr bool DEFAULT_ACTIVE_LOW_FAULT = false;
41  constexpr bool DEFAULT_ACTIVE_LOW_OPEN = false;
42  constexpr bool DEFAULT_ACTIVE_LOW_SWITCH = false;
43  constexpr bool DEFAULT_IGNORE_CLOSED = false;
44  constexpr bool DEFAULT_IGNORE_FAULT = false;
45  constexpr bool DEFAULT_IGNORE_OPEN = false;
46  constexpr bool DEFAULT_INITIAL_STATE = false;
47  constexpr unsigned int DEFAULT_TIMEOUT = 10000;
48 
49  // Specific shutter RPC
50  constexpr auto RPC_OPEN = "rpcOpen";
51  constexpr auto RPC_CLOSE = "rpcClose";
52 
53  // Specific constant values for shutter device state/substate
54 
55  constexpr short SUBSTATE_READY_CLOSE = 105;
56  constexpr short SUBSTATE_READY_OPEN = 106;
57  constexpr short SUBSTATE_OP_CLOSE = 212;
58  constexpr short SUBSTATE_OP_CLOSING = 213;
59  constexpr short SUBSTATE_OP_OPEN = 214;
60  constexpr short SUBSTATE_OP_OPENING = 215;
61 
62  constexpr auto SUBSTATE_READY_CLOSE_STR = "Ready/Close";
63  constexpr auto SUBSTATE_READY_OPEN_STR = "Ready/Open";
64  constexpr auto SUBSTATE_OP_CLOSE_STR = "Close";
65  constexpr auto SUBSTATE_OP_CLOSING_STR = "Closing";
66  constexpr auto SUBSTATE_OP_OPEN_STR = "Open";
67  constexpr auto SUBSTATE_OP_OPENING_STR = "Opening";
68 
69 
70  const std::unordered_map<short, std::string> SubstateMap = {
82  };
83 
84  const std::vector<std::string> cfgMapping = {
87  };
88 
89  const std::vector<std::string> statMapping = {
94  };
95 
96  const std::vector<std::string> rpcMapping = {
102  RPC_CLOSE,
103  RPC_OPEN
104  };
105 
114  protected:
115  // Enumerations of configuration paramters
116  enum {
126  END_ENUM_SHUTTER // WARNING: This should be always last enumerator.
127  };
128 
129  public:
130 
136  ShutterConfig(const std::string filename,
137  const std::string name);
138 
142  virtual ~ShutterConfig();
143 
144 
145  };
146 }
147 
148 
149 #endif //FCF_DEVMGR_DEVICE_SHUTTER_CONFIG_HPP
constexpr auto CI_STAT_LOCAL
Definition: deviceConfig.hpp:53
constexpr auto CI_ACTIVE_LOW_CLOSED
Definition: shutterConfig.hpp:29
LampRpcErrors header file.
constexpr auto SUBSTATE_OP_OPEN_STR
Definition: shutterConfig.hpp:66
constexpr auto RPC_INIT
Definition: deviceConfig.hpp:43
constexpr bool DEFAULT_ACTIVE_LOW_CLOSE
Definition: shutterConfig.hpp:39
const std::vector< std::string > statMapping
Definition: shutterConfig.hpp:89
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:84
constexpr auto SUBSTATE_NOTREADY_STR
Definition: deviceConfig.hpp:87
constexpr bool DEFAULT_INITIAL_STATE
Definition: shutterConfig.hpp:46
constexpr short SUBSTATE_OP_OPENING
Definition: shutterConfig.hpp:60
Definition: shutterConfig.hpp:118
constexpr auto SUBSTATE_OP_DISABLING_STR
Definition: deviceConfig.hpp:95
Definition: shutterConfig.hpp:125
Definition: shutterConfig.hpp:117
constexpr auto CI_IGNORE_FAULT
Definition: shutterConfig.hpp:34
constexpr auto CI_ACTIVE_LOW_SWITCH
Definition: shutterConfig.hpp:32
constexpr auto CI_ACTIVE_LOW_OPEN
Definition: shutterConfig.hpp:31
ShutterHwErrors header file.
constexpr auto CI_STAT_SUBSTATE
Definition: deviceConfig.hpp:50
constexpr auto RPC_DISABLE
Definition: deviceConfig.hpp:45
constexpr short SUBSTATE_OP_OPEN
Definition: shutterConfig.hpp:59
constexpr auto CI_IGNORE_OPEN
Definition: shutterConfig.hpp:35
constexpr int SUBSTATE_OP_DISABLING
Definition: deviceConfig.hpp:92
constexpr bool DEFAULT_IGNORE_FAULT
Definition: shutterConfig.hpp:44
constexpr auto SUBSTATE_OP_CLOSING_STR
Definition: shutterConfig.hpp:65
const std::vector< std::string > cfgMapping
Definition: shutterConfig.hpp:84
constexpr auto SUBSTATE_READY_CLOSE_STR
Definition: shutterConfig.hpp:62
Definition: shutterConfig.hpp:122
constexpr bool DEFAULT_ACTIVE_LOW_SWITCH
Definition: shutterConfig.hpp:42
constexpr short SUBSTATE_READY_CLOSE
Definition: shutterConfig.hpp:55
Definition: shutterConfig.hpp:119
virtual ~ShutterConfig()
ShutterConfig destructor.
Definition: shutterConfig.cpp:63
configSet class header file.
constexpr auto RPC_CLOSE
Definition: shutterConfig.hpp:51
constexpr auto RPC_STOP
Definition: deviceConfig.hpp:46
Definition: shutterConfig.hpp:121
constexpr auto CI_ACTIVE_LOW_FAULT
Definition: shutterConfig.hpp:30
constexpr auto CI_STAT_STATE
Definition: deviceConfig.hpp:51
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:82
Shutter Configuration class.
Definition: shutterConfig.hpp:113
const std::vector< std::string > rpcMapping
Definition: shutterConfig.hpp:96
DataContext class header file.
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:96
constexpr unsigned int DEFAULT_TIMEOUT
Definition: shutterConfig.hpp:47
constexpr bool DEFAULT_IGNORE_CLOSED
Definition: shutterConfig.hpp:43
constexpr auto SUBSTATE_INITIALISING_STR
Definition: deviceConfig.hpp:88
constexpr short SUBSTATE_OP_CLOSE
Definition: shutterConfig.hpp:57
constexpr int SUBSTATE_OP_ERROR
Definition: deviceConfig.hpp:93
const std::unordered_map< short, std::string > SubstateMap
Definition: shutterConfig.hpp:70
constexpr bool DEFAULT_IGNORE_OPEN
Definition: shutterConfig.hpp:45
constexpr auto CI_TIMEOUT
Definition: shutterConfig.hpp:37
constexpr auto RPC_RESET
Definition: deviceConfig.hpp:47
Device Configuration class.
Definition: deviceConfig.hpp:125
constexpr auto SUBSTATE_READY_OPEN_STR
Definition: shutterConfig.hpp:63
constexpr auto RPC_OPEN
Definition: shutterConfig.hpp:50
constexpr bool DEFAULT_ACTIVE_LOW_FAULT
Definition: shutterConfig.hpp:40
constexpr auto CI_STAT_ERROR_CODE
Definition: deviceConfig.hpp:54
constexpr auto CI_INITIAL_STATE
Definition: shutterConfig.hpp:36
constexpr int SUBSTATE_ERROR
Definition: deviceConfig.hpp:85
constexpr bool DEFAULT_ACTIVE_LOW_OPEN
Definition: shutterConfig.hpp:41
constexpr short SUBSTATE_OP_CLOSING
Definition: shutterConfig.hpp:58
constexpr auto SUBSTATE_OP_OPENING_STR
Definition: shutterConfig.hpp:67
ShutterConfig(const std::string filename, const std::string name)
MotorConfig constructor.
Definition: shutterConfig.cpp:25
constexpr auto CI_IGNORE_CLOSED
Definition: shutterConfig.hpp:33
constexpr auto RPC_ENABLE
Definition: deviceConfig.hpp:44
DeviceConfig class header file.
constexpr short SUBSTATE_READY_OPEN
Definition: shutterConfig.hpp:56
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:90
constexpr auto SUBSTATE_OP_CLOSE_STR
Definition: shutterConfig.hpp:64