ifw-fcf  3.0.0
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
dataContext.hpp
DataContext class header file.
fcf::devmgr::shutter::ShutterConfig::CFG_LOWOPEN
@ CFG_LOWOPEN
Definition: shutterConfig.hpp:122
fcf::devmgr::shutter::SUBSTATE_OP_CLOSING
constexpr short SUBSTATE_OP_CLOSING
Definition: shutterConfig.hpp:58
fcf::devmgr::shutter::CI_IGNORE_CLOSED
constexpr auto CI_IGNORE_CLOSED
Definition: shutterConfig.hpp:33
fcf::devmgr::shutter::CI_ACTIVE_LOW_OPEN
constexpr auto CI_ACTIVE_LOW_OPEN
Definition: shutterConfig.hpp:31
fcf::devmgr::shutter::SUBSTATE_OP_OPENING_STR
constexpr auto SUBSTATE_OP_OPENING_STR
Definition: shutterConfig.hpp:67
fcf::devmgr::shutter::SUBSTATE_OP_OPENING
constexpr short SUBSTATE_OP_OPENING
Definition: shutterConfig.hpp:60
fcf::devmgr::shutter::CI_IGNORE_FAULT
constexpr auto CI_IGNORE_FAULT
Definition: shutterConfig.hpp:34
fcf::devmgr::shutter::CI_ACTIVE_LOW_SWITCH
constexpr auto CI_ACTIVE_LOW_SWITCH
Definition: shutterConfig.hpp:32
fcf::devmgr::shutter::SUBSTATE_OP_OPEN_STR
constexpr auto SUBSTATE_OP_OPEN_STR
Definition: shutterConfig.hpp:66
shutterHwErrors.hpp
ShutterHwErrors header file.
fcf::devmgr::shutter::SUBSTATE_READY_OPEN
constexpr short SUBSTATE_READY_OPEN
Definition: shutterConfig.hpp:56
fcf::devmgr::shutter::DEFAULT_ACTIVE_LOW_CLOSE
constexpr bool DEFAULT_ACTIVE_LOW_CLOSE
Definition: shutterConfig.hpp:39
fcf::devmgr::shutter::ShutterConfig::CFG_INITSTATE
@ CFG_INITSTATE
Definition: shutterConfig.hpp:124
fcf::devmgr::common::CI_STAT_ERROR_CODE
constexpr auto CI_STAT_ERROR_CODE
Definition: deviceConfig.hpp:54
fcf::devmgr::shutter::ShutterConfig::CFG_TIMEOUT
@ CFG_TIMEOUT
Definition: shutterConfig.hpp:125
fcf::devmgr::shutter::DEFAULT_INITIAL_STATE
constexpr bool DEFAULT_INITIAL_STATE
Definition: shutterConfig.hpp:46
fcf::devmgr::common::SUBSTATE_OP_DISABLING_STR
constexpr auto SUBSTATE_OP_DISABLING_STR
Definition: deviceConfig.hpp:95
fcf::devmgr::shutter::statMapping
const std::vector< std::string > statMapping
Definition: shutterConfig.hpp:89
deviceConfig.hpp
DeviceConfig class header file.
fcf::devmgr::shutter::SUBSTATE_OP_OPEN
constexpr short SUBSTATE_OP_OPEN
Definition: shutterConfig.hpp:59
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::shutter::SUBSTATE_OP_CLOSING_STR
constexpr auto SUBSTATE_OP_CLOSING_STR
Definition: shutterConfig.hpp:65
fcf::devmgr::shutter::ShutterConfig::CFG_LOWFAULT
@ CFG_LOWFAULT
Definition: shutterConfig.hpp:121
fcf::devmgr::shutter::RPC_CLOSE
constexpr auto RPC_CLOSE
Definition: shutterConfig.hpp:51
fcf::devmgr::shutter::CI_IGNORE_OPEN
constexpr auto CI_IGNORE_OPEN
Definition: shutterConfig.hpp:35
fcf::devmgr::shutter::DEFAULT_ACTIVE_LOW_SWITCH
constexpr bool DEFAULT_ACTIVE_LOW_SWITCH
Definition: shutterConfig.hpp:42
fcf::devmgr::shutter::SUBSTATE_READY_CLOSE
constexpr short SUBSTATE_READY_CLOSE
Definition: shutterConfig.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::shutter::cfgMapping
const std::vector< std::string > cfgMapping
Definition: shutterConfig.hpp:84
fcf::devmgr::shutter::rpcMapping
const std::vector< std::string > rpcMapping
Definition: shutterConfig.hpp:96
fcf::devmgr::common::SUBSTATE_OP_DISABLING
constexpr int SUBSTATE_OP_DISABLING
Definition: deviceConfig.hpp:92
fcf::devmgr::shutter::DEFAULT_TIMEOUT
constexpr unsigned int DEFAULT_TIMEOUT
Definition: shutterConfig.hpp:47
fcf::devmgr::shutter::DEFAULT_IGNORE_FAULT
constexpr bool DEFAULT_IGNORE_FAULT
Definition: shutterConfig.hpp:44
fcf::devmgr::shutter::DEFAULT_IGNORE_CLOSED
constexpr bool DEFAULT_IGNORE_CLOSED
Definition: shutterConfig.hpp:43
fcf::devmgr::shutter::ShutterConfig::CFG_LOWCLOSED
@ CFG_LOWCLOSED
Definition: shutterConfig.hpp:120
fcf::devmgr::shutter::ShutterConfig::END_ENUM_SHUTTER
@ END_ENUM_SHUTTER
Definition: shutterConfig.hpp:126
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::shutter::ShutterConfig::~ShutterConfig
virtual ~ShutterConfig()
ShutterConfig destructor.
Definition: shutterConfig.cpp:63
fcf::devmgr::common::SUBSTATE_NOTREADY
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:82
fcf::devmgr::shutter::ShutterConfig
Shutter Configuration class.
Definition: shutterConfig.hpp:113
fcf::devmgr::shutter::SUBSTATE_READY_CLOSE_STR
constexpr auto SUBSTATE_READY_CLOSE_STR
Definition: shutterConfig.hpp:62
fcf::devmgr::shutter::ShutterConfig::CFG_IGFAULT
@ CFG_IGFAULT
Definition: shutterConfig.hpp:118
fcf::devmgr::shutter::CI_ACTIVE_LOW_FAULT
constexpr auto CI_ACTIVE_LOW_FAULT
Definition: shutterConfig.hpp:30
fcf::devmgr::common::SUBSTATE_INITIALISING
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:84
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::shutter::SUBSTATE_READY_OPEN_STR
constexpr auto SUBSTATE_READY_OPEN_STR
Definition: shutterConfig.hpp:63
fcf::devmgr::shutter::DEFAULT_ACTIVE_LOW_FAULT
constexpr bool DEFAULT_ACTIVE_LOW_FAULT
Definition: shutterConfig.hpp:40
fcf::devmgr::common::SUBSTATE_OP_ERROR_STR
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:96
fcf::devmgr::shutter::CI_TIMEOUT
constexpr auto CI_TIMEOUT
Definition: shutterConfig.hpp:37
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::shutter::ShutterConfig::CFG_IGCLOSED
@ CFG_IGCLOSED
Definition: shutterConfig.hpp:117
fcf::devmgr::shutter::ShutterConfig::ShutterConfig
ShutterConfig(const std::string filename, const std::string name)
MotorConfig constructor.
Definition: shutterConfig.cpp:25
fcf::devmgr::common::RPC_INIT
constexpr auto RPC_INIT
Definition: deviceConfig.hpp:43
fcf::devmgr::common::DeviceConfig
Device Configuration class.
Definition: deviceConfig.hpp:125
fcf::devmgr::shutter::SUBSTATE_OP_CLOSE_STR
constexpr auto SUBSTATE_OP_CLOSE_STR
Definition: shutterConfig.hpp:64
fcf::devmgr::shutter::SubstateMap
const std::unordered_map< short, std::string > SubstateMap
Definition: shutterConfig.hpp:70
fcf::devmgr::shutter::DEFAULT_IGNORE_OPEN
constexpr bool DEFAULT_IGNORE_OPEN
Definition: shutterConfig.hpp:45
fcf::devmgr::shutter::ShutterConfig::CFG_LOWSWITCH
@ CFG_LOWSWITCH
Definition: shutterConfig.hpp:123
fcf::devmgr::common::SUBSTATE_ERROR_STR
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:90
fcf::devmgr::shutter::ShutterConfig::CFG_IGOPEN
@ CFG_IGOPEN
Definition: shutterConfig.hpp:119
fcf::devmgr::shutter::SUBSTATE_OP_CLOSE
constexpr short SUBSTATE_OP_CLOSE
Definition: shutterConfig.hpp:57
shutterRpcErrors.hpp
LampRpcErrors header file.
fcf::devmgr::shutter::RPC_OPEN
constexpr auto RPC_OPEN
Definition: shutterConfig.hpp:50
fcf::devmgr::shutter::CI_INITIAL_STATE
constexpr auto CI_INITIAL_STATE
Definition: shutterConfig.hpp:36
fcf::devmgr::shutter::CI_ACTIVE_LOW_CLOSED
constexpr auto CI_ACTIVE_LOW_CLOSED
Definition: shutterConfig.hpp:29
fcf::devmgr::shutter
Definition: shutter.hpp:21
fcf::devmgr::shutter::DEFAULT_ACTIVE_LOW_OPEN
constexpr bool DEFAULT_ACTIVE_LOW_OPEN
Definition: shutterConfig.hpp:41
fcf::devmgr::common::RPC_RESET
constexpr auto RPC_RESET
Definition: deviceConfig.hpp:47