ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
199  virtual ~PiezoConfig();
200 
201 
202  short GetNumAxes() const;
203  private:
204 
205  };
206  }
207 }
208 }
209 
210 
211 #endif //FCF_DEVMGR_DEVICE_PIEZO_CONFIG_H
constexpr auto RPC_POS
Definition: piezoConfig.hpp:73
constexpr auto CI_STAT_LOCAL
Definition: deviceConfig.hpp:53
PiezoConfig(const std::string filename, const std::string name)
DeviceConfig constructor.
Definition: piezoConfig.cpp:26
constexpr auto CI_STAT_MON_ACT_POS_USR3
Definition: piezoConfig.hpp:113
constexpr auto CI_UPPER_LIMIT3
Definition: piezoConfig.hpp:44
constexpr double DEFAULT_USER_TO_BIT
Definition: piezoConfig.hpp:65
constexpr auto RPC_INIT
Definition: deviceConfig.hpp:43
constexpr auto CI_FULL_RANGE1
Definition: piezoConfig.hpp:33
constexpr auto CI_USER_TO_BIT_INPUT2
Definition: piezoConfig.hpp:46
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:84
constexpr auto CI_USER_OFFSET_INPUT3
Definition: piezoConfig.hpp:50
constexpr auto CI_STAT_ACTUAL_POS_USER
Definition: piezoConfig.hpp:100
constexpr auto CI_USER_TO_BIT_OUTPUT3
Definition: piezoConfig.hpp:53
constexpr auto CI_USER_TO_BIT_OUTPUT1
Definition: piezoConfig.hpp:51
constexpr auto SUBSTATE_NOTREADY_STR
Definition: deviceConfig.hpp:87
constexpr auto CI_USER_TO_BIT_INPUT1
Definition: piezoConfig.hpp:45
constexpr auto CI_UPPER_LIMIT2
Definition: piezoConfig.hpp:43
constexpr auto CI_STAT_ACTUAL_POS_USER2
Definition: piezoConfig.hpp:102
constexpr auto CI_STAT_MON_ACT_POS_BIT1
Definition: piezoConfig.hpp:106
constexpr auto CI_STAT_ACTUAL_POS_BIT1
Definition: piezoConfig.hpp:96
constexpr short SUBSTATE_OP_POS
Definition: piezoConfig.hpp:79
constexpr auto CI_LOWER_LIMIT1
Definition: piezoConfig.hpp:39
constexpr auto CI_STAT_MON_ACT_POS_BIT
Definition: piezoConfig.hpp:105
const std::vector< std::string > cfgMapping
Definition: piezoConfig.hpp:115
constexpr auto CI_USER_OFFSET_OUTPUT2
Definition: piezoConfig.hpp:55
constexpr auto CI_STAT_ACTUAL_POS_USER3
Definition: piezoConfig.hpp:103
constexpr auto CI_USER_OFFSET_INPUT2
Definition: piezoConfig.hpp:49
constexpr short DEFAULT_UPPER_LIMIT
Definition: piezoConfig.hpp:62
constexpr auto CI_STAT_MON_ACT_POS_BIT2
Definition: piezoConfig.hpp:107
constexpr auto RPC_MOVEUSER
Definition: piezoConfig.hpp:75
constexpr auto CI_USER_OFFSET_OUTPUT3
Definition: piezoConfig.hpp:56
constexpr auto CI_STAT_SUBSTATE
Definition: deviceConfig.hpp:50
constexpr auto RPC_DISABLE
Definition: deviceConfig.hpp:45
constexpr auto CI_HOME1
Definition: piezoConfig.hpp:36
constexpr auto CI_MAX_ON
Definition: piezoConfig.hpp:31
constexpr auto CI_STAT_ACTUAL_POS_BIT3
Definition: piezoConfig.hpp:98
constexpr auto CI_STAT_MON_ACT_POS_BIT3
Definition: piezoConfig.hpp:108
constexpr short DEFAULT_FULL_RANGE
Definition: piezoConfig.hpp:60
PiezoHwErrors header file.
constexpr auto CI_STAT_MON_ACT_POS_USR1
Definition: piezoConfig.hpp:111
constexpr auto CI_LOWER_LIMIT2
Definition: piezoConfig.hpp:40
constexpr auto SUBSTATE_OP_POS_STR
Definition: piezoConfig.hpp:82
const std::vector< std::string > rpcMapping
Definition: piezoConfig.hpp:131
constexpr auto RPC_HOME
Definition: piezoConfig.hpp:72
virtual ~PiezoConfig()
DeviceConfig destructor.
Definition: piezoConfig.cpp:115
constexpr auto SUBSTATE_OP_AUTO_STR
Definition: piezoConfig.hpp:83
configSet class header file.
constexpr auto CI_UPPER_LIMIT1
Definition: piezoConfig.hpp:42
constexpr short DEFAULT_LOWER_LIMIT
Definition: piezoConfig.hpp:61
constexpr auto RPC_STOP
Definition: deviceConfig.hpp:46
constexpr auto CI_USER_OFFSET_OUTPUT1
Definition: piezoConfig.hpp:54
constexpr auto CI_STAT_STATE
Definition: deviceConfig.hpp:51
constexpr auto RPC_AUTO
Definition: piezoConfig.hpp:71
constexpr auto CI_USER_TO_BIT_INPUT3
Definition: piezoConfig.hpp:47
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:82
constexpr auto CI_USER_TO_BIT_OUTPUT2
Definition: piezoConfig.hpp:52
DataContext class header file.
constexpr auto CI_FULL_RANGE3
Definition: piezoConfig.hpp:35
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:96
constexpr auto SUBSTATE_INITIALISING_STR
Definition: deviceConfig.hpp:88
constexpr auto CI_HOME3
Definition: piezoConfig.hpp:38
constexpr auto CI_STAT_MON_ACT_POS_USR
Definition: piezoConfig.hpp:110
constexpr auto CI_STAT_ACTUAL_POS_BIT
Definition: piezoConfig.hpp:95
constexpr auto CI_LOWER_LIMIT3
Definition: piezoConfig.hpp:41
constexpr short DEFAULT_USER_OFFSET
Definition: piezoConfig.hpp:63
constexpr auto CI_STAT_MON_ACT_POS_USR2
Definition: piezoConfig.hpp:112
constexpr int SUBSTATE_OP_ERROR
Definition: deviceConfig.hpp:93
constexpr auto CI_STAT_ACTUAL_POS_BIT2
Definition: piezoConfig.hpp:97
piezo Configuration class
Definition: piezoConfig.hpp:151
constexpr auto RPC_RESET
Definition: deviceConfig.hpp:47
constexpr bool DEFAULT_NUM_AXIS
Definition: piezoConfig.hpp:59
const std::vector< std::string > statMapping
Definition: piezoConfig.hpp:118
Device Configuration class.
Definition: deviceConfig.hpp:125
constexpr auto RPC_MOVEBITS
Definition: piezoConfig.hpp:74
PiezoRpcErrors header file.
constexpr auto CI_STAT_ERROR_CODE
Definition: deviceConfig.hpp:54
constexpr bool DEFAULT_MAX_ON
Definition: piezoConfig.hpp:58
constexpr int SUBSTATE_ERROR
Definition: deviceConfig.hpp:85
short GetNumAxes() const
Definition: piezoConfig.cpp:119
constexpr auto CI_STAT_ACTUAL_POS_USER1
Definition: piezoConfig.hpp:101
constexpr auto CI_FULL_RANGE2
Definition: piezoConfig.hpp:34
constexpr short SUBSTATE_OP_AUTO
Definition: piezoConfig.hpp:80
constexpr auto CI_USER_OFFSET_INPUT1
Definition: piezoConfig.hpp:48
constexpr auto RPC_ENABLE
Definition: deviceConfig.hpp:44
DeviceConfig class header file.
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:90
constexpr short DEFAULT_HOME
Definition: piezoConfig.hpp:64
constexpr auto CI_NUM_AXIS
Definition: piezoConfig.hpp:32
const std::unordered_map< short, std::string > SubstateMap
Definition: piezoConfig.hpp:85
constexpr auto CI_HOME2
Definition: piezoConfig.hpp:37