ifw-fcf  3.0.0
piezoConfig.hpp
Go to the documentation of this file.
1 
10 #ifndef FCF_DEVMGR_DEVICE_PIEZO_CONFIG_HPP
11 #define FCF_DEVMGR_DEVICE_PIEZO_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 piezo {
29 
30  // Constants for internal mapping
31  constexpr auto CI_MAX_ON = "max_on";
32  constexpr auto CI_NUM_AXIS = "num_axis";
33  constexpr auto CI_FULL_RANGE1 = "full_range1";
34  constexpr auto CI_FULL_RANGE2 = "full_range2";
35  constexpr auto CI_FULL_RANGE3 = "full_range3";
36  constexpr auto CI_HOME1 = "home1";
37  constexpr auto CI_HOME2 = "home2";
38  constexpr auto CI_HOME3 = "home3";
39  constexpr auto CI_LOWER_LIMIT1 = "lower_limit1";
40  constexpr auto CI_LOWER_LIMIT2 = "lower_limit2";
41  constexpr auto CI_LOWER_LIMIT3 = "lower_limit3";
42  constexpr auto CI_UPPER_LIMIT1 = "upper_limit1";
43  constexpr auto CI_UPPER_LIMIT2 = "upper_limit2";
44  constexpr auto CI_UPPER_LIMIT3 = "upper_limit3";
45  constexpr auto CI_USER_TO_BIT_INPUT1 = "user_to_bit_input1";
46  constexpr auto CI_USER_TO_BIT_INPUT2 = "user_to_bit_input2";
47  constexpr auto CI_USER_TO_BIT_INPUT3 = "user_to_bit_input3";
48  constexpr auto CI_USER_OFFSET_INPUT1 = "user_offset_input1";
49  constexpr auto CI_USER_OFFSET_INPUT2 = "user_offset_input2";
50  constexpr auto CI_USER_OFFSET_INPUT3 = "user_offset_input3";
51  constexpr auto CI_USER_TO_BIT_OUTPUT1 = "user_to_bit_output1";
52  constexpr auto CI_USER_TO_BIT_OUTPUT2 = "user_to_bit_output2";
53  constexpr auto CI_USER_TO_BIT_OUTPUT3 = "user_to_bit_output3";
54  constexpr auto CI_USER_OFFSET_OUTPUT1 = "user_offset_output1";
55  constexpr auto CI_USER_OFFSET_OUTPUT2 = "user_offset_output2";
56  constexpr auto CI_USER_OFFSET_OUTPUT3 = "user_offset_output3";
57 
58  constexpr bool DEFAULT_MAX_ON = 0;
59  constexpr bool DEFAULT_NUM_AXIS = 2;
60  constexpr short DEFAULT_FULL_RANGE = 32767;
61  constexpr short DEFAULT_LOWER_LIMIT = 0;
62  constexpr short DEFAULT_UPPER_LIMIT = 32767;
63  constexpr short DEFAULT_USER_OFFSET = 0;
64  constexpr short DEFAULT_HOME = 0;
65  constexpr double DEFAULT_USER_TO_BIT = 32767/10.0;
66 
67 
68  // Specifics Piezo status values
69 
70  // Specific Piezo RPC
71  constexpr auto RPC_AUTO = "rpcAuto";
72  constexpr auto RPC_HOME = "rpcHome";
73  constexpr auto RPC_POS = "rpcPos";
74  constexpr auto RPC_MOVEBITS = "rpcMoveBits";
75  constexpr auto RPC_MOVEUSER = "rpcMoveUser";
76 
77 
78  // Specific constant values for Piezo device state/substate
79  constexpr short SUBSTATE_OP_POS = 203;
80  constexpr short SUBSTATE_OP_AUTO = 204;
81 
82  constexpr auto SUBSTATE_OP_POS_STR = "Pos";
83  constexpr auto SUBSTATE_OP_AUTO_STR = "Auto";
84 
85  const std::unordered_map<short, std::string> SubstateMap = {
92  };
93 
94  // Status configuration attributes
95  constexpr auto CI_STAT_ACTUAL_POS_BIT = "actual_pos_bit";
96  constexpr auto CI_STAT_ACTUAL_POS_BIT1 = "actual_pos_bit1";
97  constexpr auto CI_STAT_ACTUAL_POS_BIT2 = "actual_pos_bit2";
98  constexpr auto CI_STAT_ACTUAL_POS_BIT3 = "actual_pos_bit3";
99 
100  constexpr auto CI_STAT_ACTUAL_POS_USER = "actual_pos_user";
101  constexpr auto CI_STAT_ACTUAL_POS_USER1 = "actual_pos_user1";
102  constexpr auto CI_STAT_ACTUAL_POS_USER2 = "actual_pos_user2";
103  constexpr auto CI_STAT_ACTUAL_POS_USER3 = "actual_pos_user3";
104 
105  constexpr auto CI_STAT_MON_ACT_POS_BIT = "mon_act_pos_bit";
106  constexpr auto CI_STAT_MON_ACT_POS_BIT1 = "mon_act_pos_bit1";
107  constexpr auto CI_STAT_MON_ACT_POS_BIT2 = "mon_act_pos_bit2";
108  constexpr auto CI_STAT_MON_ACT_POS_BIT3 = "mon_act_pos_bit3";
109 
110  constexpr auto CI_STAT_MON_ACT_POS_USR = "mon_act_pos_usr";
111  constexpr auto CI_STAT_MON_ACT_POS_USR1 = "mon_act_pos_usr1";
112  constexpr auto CI_STAT_MON_ACT_POS_USR2 = "mon_act_pos_usr2";
113  constexpr auto CI_STAT_MON_ACT_POS_USR3 = "mon_act_pos_usr3";
114 
115  const std::vector<std::string> cfgMapping = {
116  };
117 
118  const std::vector<std::string> statMapping = {
129  };
130 
131  const std::vector<std::string> rpcMapping = {
137  RPC_POS,
138  RPC_AUTO,
139  RPC_HOME,
140  RPC_MOVEBITS,
142  };
143 
152  {
153 
154  // Enumerations of configuration paramters
155  enum {
156  CFG_MAX_ON = 0,
157  CFG_NUM_AXIS = 1,
158  CFG_FULL_RANGE1,
159  CFG_FULL_RANGE2,
160  CFG_FULL_RANGE3,
161  CFG_HOME1,
162  CFG_HOME2,
163  CFG_HOME3,
164  CFG_LOWER_LIMIT1,
165  CFG_LOWER_LIMIT2,
166  CFG_LOWER_LIMIT3,
167  CFG_UPPER_LIMIT1,
168  CFG_UPPER_LIMIT2,
169  CFG_UPPER_LIMIT3,
170  CFG_USER_TO_BIT_INPUT1,
171  CFG_USER_TO_BIT_INPUT2,
172  CFG_USER_TO_BIT_INPUT3,
173  CFG_USER_OFFSET_INPUT1,
174  CFG_USER_OFFSET_INPUT2,
175  CFG_USER_OFFSET_INPUT3,
176  CFG_USER_TO_BIT_OUTPUT1,
177  CFG_USER_TO_BIT_OUTPUT2,
178  CFG_USER_TO_BIT_OUTPUT3,
179  CFG_USER_OFFSET_OUTPUT1,
180  CFG_USER_OFFSET_OUTPUT2,
181  CFG_USER_OFFSET_OUTPUT3,
182  END_ENUM_PIEZO // WARNING: This should be always last enumerator.
183  };
184 
185 
186  public:
187 
193  PiezoConfig(const std::string filename,
194  const std::string name);
195 
200  PiezoConfig(const std::string name);
201 
205  virtual ~PiezoConfig();
206 
210  void InitConfig();
211 
212  short GetNumAxes() const;
213  private:
214 
215  };
216  }
217 }
218 }
219 
220 
221 #endif //FCF_DEVMGR_DEVICE_PIEZO_CONFIG_H
fcf::devmgr::piezo::CI_LOWER_LIMIT3
constexpr auto CI_LOWER_LIMIT3
Definition: piezoConfig.hpp:41
fcf::devmgr::piezo::RPC_MOVEBITS
constexpr auto RPC_MOVEBITS
Definition: piezoConfig.hpp:74
piezoHwErrors.hpp
PiezoHwErrors header file.
dataContext.hpp
DataContext class header file.
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_USER2
constexpr auto CI_STAT_ACTUAL_POS_USER2
Definition: piezoConfig.hpp:102
fcf::devmgr::piezo::CI_HOME3
constexpr auto CI_HOME3
Definition: piezoConfig.hpp:38
fcf::devmgr::piezo::CI_USER_TO_BIT_INPUT2
constexpr auto CI_USER_TO_BIT_INPUT2
Definition: piezoConfig.hpp:46
fcf::devmgr::piezo::DEFAULT_HOME
constexpr short DEFAULT_HOME
Definition: piezoConfig.hpp:64
fcf::devmgr::piezo::SUBSTATE_OP_AUTO_STR
constexpr auto SUBSTATE_OP_AUTO_STR
Definition: piezoConfig.hpp:83
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_USR
constexpr auto CI_STAT_MON_ACT_POS_USR
Definition: piezoConfig.hpp:110
fcf::devmgr::piezo::CI_UPPER_LIMIT2
constexpr auto CI_UPPER_LIMIT2
Definition: piezoConfig.hpp:43
fcf::devmgr::piezo::CI_FULL_RANGE2
constexpr auto CI_FULL_RANGE2
Definition: piezoConfig.hpp:34
fcf::devmgr::piezo::RPC_POS
constexpr auto RPC_POS
Definition: piezoConfig.hpp:73
fcf::devmgr::common::CI_STAT_ERROR_CODE
constexpr auto CI_STAT_ERROR_CODE
Definition: deviceConfig.hpp:54
fcf::devmgr::piezo::CI_USER_OFFSET_INPUT2
constexpr auto CI_USER_OFFSET_INPUT2
Definition: piezoConfig.hpp:49
fcf::devmgr::piezo::DEFAULT_UPPER_LIMIT
constexpr short DEFAULT_UPPER_LIMIT
Definition: piezoConfig.hpp:62
fcf::devmgr::piezo::SUBSTATE_OP_AUTO
constexpr short SUBSTATE_OP_AUTO
Definition: piezoConfig.hpp:80
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_USR3
constexpr auto CI_STAT_MON_ACT_POS_USR3
Definition: piezoConfig.hpp:113
fcf::devmgr::piezo::RPC_HOME
constexpr auto RPC_HOME
Definition: piezoConfig.hpp:72
fcf::devmgr::piezo::CI_FULL_RANGE1
constexpr auto CI_FULL_RANGE1
Definition: piezoConfig.hpp:33
fcf::devmgr::piezo::statMapping
const std::vector< std::string > statMapping
Definition: piezoConfig.hpp:118
fcf::devmgr::piezo::CI_LOWER_LIMIT2
constexpr auto CI_LOWER_LIMIT2
Definition: piezoConfig.hpp:40
fcf::devmgr::piezo::CI_USER_OFFSET_OUTPUT1
constexpr auto CI_USER_OFFSET_OUTPUT1
Definition: piezoConfig.hpp:54
deviceConfig.hpp
DeviceConfig class header file.
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_BIT
constexpr auto CI_STAT_ACTUAL_POS_BIT
Definition: piezoConfig.hpp:95
fcf::devmgr::common::CI_STAT_STATE
constexpr auto CI_STAT_STATE
Definition: deviceConfig.hpp:51
fcf::devmgr::piezo::RPC_AUTO
constexpr auto RPC_AUTO
Definition: piezoConfig.hpp:71
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_USR2
constexpr auto CI_STAT_MON_ACT_POS_USR2
Definition: piezoConfig.hpp:112
fcf::devmgr::common::CI_STAT_LOCAL
constexpr auto CI_STAT_LOCAL
Definition: deviceConfig.hpp:53
fcf::devmgr::piezo::CI_USER_TO_BIT_INPUT1
constexpr auto CI_USER_TO_BIT_INPUT1
Definition: piezoConfig.hpp:45
fcf::devmgr::piezo::CI_USER_OFFSET_INPUT1
constexpr auto CI_USER_OFFSET_INPUT1
Definition: piezoConfig.hpp:48
fcf::devmgr::piezo::SUBSTATE_OP_POS
constexpr short SUBSTATE_OP_POS
Definition: piezoConfig.hpp:79
fcf::devmgr::piezo::PiezoConfig::InitConfig
void InitConfig()
Define configuration parameters for piezo device.
Definition: piezoConfig.cpp:46
fcf::devmgr::piezo::CI_FULL_RANGE3
constexpr auto CI_FULL_RANGE3
Definition: piezoConfig.hpp:35
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_BIT3
constexpr auto CI_STAT_MON_ACT_POS_BIT3
Definition: piezoConfig.hpp:108
fcf::devmgr::piezo::CI_USER_TO_BIT_OUTPUT3
constexpr auto CI_USER_TO_BIT_OUTPUT3
Definition: piezoConfig.hpp:53
fcf::devmgr::common::RPC_STOP
constexpr auto RPC_STOP
Definition: deviceConfig.hpp:46
fcf::devmgr::piezo::CI_USER_TO_BIT_OUTPUT1
constexpr auto CI_USER_TO_BIT_OUTPUT1
Definition: piezoConfig.hpp:51
fcf::devmgr::common::RPC_DISABLE
constexpr auto RPC_DISABLE
Definition: deviceConfig.hpp:45
fcf::devmgr::piezo::CI_HOME1
constexpr auto CI_HOME1
Definition: piezoConfig.hpp:36
fcf::devmgr::piezo::DEFAULT_LOWER_LIMIT
constexpr short DEFAULT_LOWER_LIMIT
Definition: piezoConfig.hpp:61
fcf::devmgr::piezo::DEFAULT_USER_TO_BIT
constexpr double DEFAULT_USER_TO_BIT
Definition: piezoConfig.hpp:65
fcf::devmgr::piezo::DEFAULT_NUM_AXIS
constexpr bool DEFAULT_NUM_AXIS
Definition: piezoConfig.hpp:59
fcf::devmgr::piezo::PiezoConfig::GetNumAxes
short GetNumAxes() const
Definition: piezoConfig.cpp:131
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_USER1
constexpr auto CI_STAT_ACTUAL_POS_USER1
Definition: piezoConfig.hpp:101
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_BIT3
constexpr auto CI_STAT_ACTUAL_POS_BIT3
Definition: piezoConfig.hpp:98
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::piezo::PiezoConfig::~PiezoConfig
virtual ~PiezoConfig()
DeviceConfig destructor.
Definition: piezoConfig.cpp:42
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::piezo::CI_NUM_AXIS
constexpr auto CI_NUM_AXIS
Definition: piezoConfig.hpp:32
fcf::devmgr::common::SUBSTATE_INITIALISING
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:84
fcf::devmgr::piezo::CI_USER_OFFSET_OUTPUT2
constexpr auto CI_USER_OFFSET_OUTPUT2
Definition: piezoConfig.hpp:55
fcf::devmgr::piezo::rpcMapping
const std::vector< std::string > rpcMapping
Definition: piezoConfig.hpp:131
piezoRpcErrors.hpp
PiezoRpcErrors header file.
fcf::devmgr::piezo::SubstateMap
const std::unordered_map< short, std::string > SubstateMap
Definition: piezoConfig.hpp:85
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_BIT2
constexpr auto CI_STAT_MON_ACT_POS_BIT2
Definition: piezoConfig.hpp:107
fcf::devmgr::piezo::CI_HOME2
constexpr auto CI_HOME2
Definition: piezoConfig.hpp:37
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::piezo::CI_USER_OFFSET_INPUT3
constexpr auto CI_USER_OFFSET_INPUT3
Definition: piezoConfig.hpp:50
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_USER
constexpr auto CI_STAT_ACTUAL_POS_USER
Definition: piezoConfig.hpp:100
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_BIT
constexpr auto CI_STAT_MON_ACT_POS_BIT
Definition: piezoConfig.hpp:105
fcf::devmgr::piezo::CI_UPPER_LIMIT1
constexpr auto CI_UPPER_LIMIT1
Definition: piezoConfig.hpp:42
fcf::devmgr::common::SUBSTATE_OP_ERROR_STR
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:96
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_BIT1
constexpr auto CI_STAT_MON_ACT_POS_BIT1
Definition: piezoConfig.hpp:106
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_USER3
constexpr auto CI_STAT_ACTUAL_POS_USER3
Definition: piezoConfig.hpp:103
fcf::devmgr::piezo::CI_LOWER_LIMIT1
constexpr auto CI_LOWER_LIMIT1
Definition: piezoConfig.hpp:39
fcf::devmgr::piezo::SUBSTATE_OP_POS_STR
constexpr auto SUBSTATE_OP_POS_STR
Definition: piezoConfig.hpp:82
fcf::devmgr::piezo::CI_MAX_ON
constexpr auto CI_MAX_ON
Definition: piezoConfig.hpp:31
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::piezo::CI_UPPER_LIMIT3
constexpr auto CI_UPPER_LIMIT3
Definition: piezoConfig.hpp:44
fcf::devmgr::piezo::PiezoConfig::PiezoConfig
PiezoConfig(const std::string filename, const std::string name)
DeviceConfig constructor.
Definition: piezoConfig.cpp:26
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_BIT1
constexpr auto CI_STAT_ACTUAL_POS_BIT1
Definition: piezoConfig.hpp:96
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::piezo::CI_STAT_ACTUAL_POS_BIT2
constexpr auto CI_STAT_ACTUAL_POS_BIT2
Definition: piezoConfig.hpp:97
fcf::devmgr::piezo::PiezoConfig
piezo Configuration class
Definition: piezoConfig.hpp:152
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_USR1
constexpr auto CI_STAT_MON_ACT_POS_USR1
Definition: piezoConfig.hpp:111
fcf::devmgr::piezo::CI_USER_TO_BIT_INPUT3
constexpr auto CI_USER_TO_BIT_INPUT3
Definition: piezoConfig.hpp:47
fcf::devmgr::piezo::DEFAULT_USER_OFFSET
constexpr short DEFAULT_USER_OFFSET
Definition: piezoConfig.hpp:63
fcf::devmgr::piezo::CI_USER_TO_BIT_OUTPUT2
constexpr auto CI_USER_TO_BIT_OUTPUT2
Definition: piezoConfig.hpp:52
fcf::devmgr::piezo::DEFAULT_MAX_ON
constexpr bool DEFAULT_MAX_ON
Definition: piezoConfig.hpp:58
fcf::devmgr::common::SUBSTATE_ERROR_STR
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:90
fcf::devmgr::piezo::cfgMapping
const std::vector< std::string > cfgMapping
Definition: piezoConfig.hpp:115
fcf::devmgr::piezo::CI_USER_OFFSET_OUTPUT3
constexpr auto CI_USER_OFFSET_OUTPUT3
Definition: piezoConfig.hpp:56
fcf::devmgr::piezo::DEFAULT_FULL_RANGE
constexpr short DEFAULT_FULL_RANGE
Definition: piezoConfig.hpp:60
fcf::devmgr::common::RPC_RESET
constexpr auto RPC_RESET
Definition: deviceConfig.hpp:47
fcf::devmgr::piezo::RPC_MOVEUSER
constexpr auto RPC_MOVEUSER
Definition: piezoConfig.hpp:75