ifw-fcf  4.1.0-pre2
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 <utils/bat/logger.hpp>
20 #include "fcf/common/iComm.hpp"
26 
27 namespace fcf::devmgr::piezo {
28 
29  constexpr auto LOGGER_NAME = "piezo";
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  // Specifics Piezo status values
68 
69  // Specific Piezo RPC
70  constexpr auto RPC_AUTO = "rpcAuto";
71  constexpr auto RPC_HOME = "rpcHome";
72  constexpr auto RPC_POS = "rpcPos";
73  constexpr auto RPC_MOVEBITS = "rpcMoveBits";
74  constexpr auto RPC_MOVEUSER = "rpcMoveUser";
75 
76  // Specific constant values for Piezo device state/substate
77  constexpr short SUBSTATE_OP_POS = 203;
78  constexpr short SUBSTATE_OP_AUTO = 204;
79 
80  constexpr auto SUBSTATE_OP_POS_STR = "Pos";
81  constexpr auto SUBSTATE_OP_AUTO_STR = "Auto";
82 
83  const std::unordered_map<short, std::string> SubstateMap = {
90  };
91 
92  // Status configuration attributes
93  constexpr auto CI_STAT_ACTUAL_POS_BIT = "actual_pos_bit";
94  constexpr auto CI_STAT_ACTUAL_POS_BIT1 = "actual_pos_bit1";
95  constexpr auto CI_STAT_ACTUAL_POS_BIT2 = "actual_pos_bit2";
96  constexpr auto CI_STAT_ACTUAL_POS_BIT3 = "actual_pos_bit3";
97 
98  constexpr auto CI_STAT_ACTUAL_POS_USER = "actual_pos_user";
99  constexpr auto CI_STAT_ACTUAL_POS_USER1 = "actual_pos_user1";
100  constexpr auto CI_STAT_ACTUAL_POS_USER2 = "actual_pos_user2";
101  constexpr auto CI_STAT_ACTUAL_POS_USER3 = "actual_pos_user3";
102 
103  constexpr auto CI_STAT_MON_ACT_POS_BIT = "mon_act_pos_bit";
104  constexpr auto CI_STAT_MON_ACT_POS_BIT1 = "mon_act_pos_bit1";
105  constexpr auto CI_STAT_MON_ACT_POS_BIT2 = "mon_act_pos_bit2";
106  constexpr auto CI_STAT_MON_ACT_POS_BIT3 = "mon_act_pos_bit3";
107 
108  constexpr auto CI_STAT_MON_ACT_POS_USR = "mon_act_pos_usr";
109  constexpr auto CI_STAT_MON_ACT_POS_USR1 = "mon_act_pos_usr1";
110  constexpr auto CI_STAT_MON_ACT_POS_USR2 = "mon_act_pos_usr2";
111  constexpr auto CI_STAT_MON_ACT_POS_USR3 = "mon_act_pos_usr3";
112 
121  {
122 
123  public:
124 
130  PiezoConfig(const std::string filename,
131  const std::string name);
132 
137  PiezoConfig(const std::string name);
138 
142  virtual ~PiezoConfig() = default;
143 
144  short GetNumAxes() const;
145 
146  private:
147  log4cplus::Logger m_logger;
148  };
149 
150 } //namespace
151 
152 
153 #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:73
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:100
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:81
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_USR
constexpr auto CI_STAT_MON_ACT_POS_USR
Definition: piezoConfig.hpp:108
fcf::devmgr::piezo::LOGGER_NAME
constexpr auto LOGGER_NAME
Definition: piezoConfig.hpp:29
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:72
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:78
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_USR3
constexpr auto CI_STAT_MON_ACT_POS_USR3
Definition: piezoConfig.hpp:111
fcf::devmgr::piezo::RPC_HOME
constexpr auto RPC_HOME
Definition: piezoConfig.hpp:71
fcf::devmgr::piezo::CI_FULL_RANGE1
constexpr auto CI_FULL_RANGE1
Definition: piezoConfig.hpp:33
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
fcf::devmgr::piezo::PiezoConfig::PiezoConfig
PiezoConfig(const std::string name)
DeviceConfig constructor.
deviceConfig.hpp
DeviceConfig class header file.
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_BIT
constexpr auto CI_STAT_ACTUAL_POS_BIT
Definition: piezoConfig.hpp:93
fcf::devmgr::piezo::RPC_AUTO
constexpr auto RPC_AUTO
Definition: piezoConfig.hpp:70
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_USR2
constexpr auto CI_STAT_MON_ACT_POS_USR2
Definition: piezoConfig.hpp:110
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:77
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:106
fcf::devmgr::piezo::CI_USER_TO_BIT_OUTPUT3
constexpr auto CI_USER_TO_BIT_OUTPUT3
Definition: piezoConfig.hpp:53
fcf::devmgr::piezo::CI_USER_TO_BIT_OUTPUT1
constexpr auto CI_USER_TO_BIT_OUTPUT1
Definition: piezoConfig.hpp:51
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
Definition: piezo.hpp:21
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:22
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_USER1
constexpr auto CI_STAT_ACTUAL_POS_USER1
Definition: piezoConfig.hpp:99
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_BIT3
constexpr auto CI_STAT_ACTUAL_POS_BIT3
Definition: piezoConfig.hpp:96
fcf::devmgr::common::SUBSTATE_NOTREADY_STR
constexpr auto SUBSTATE_NOTREADY_STR
Definition: deviceConfig.hpp:103
configSet.hpp
configSet class header file.
fcf::devmgr::common::SUBSTATE_INITIALISING_STR
constexpr auto SUBSTATE_INITIALISING_STR
Definition: deviceConfig.hpp:104
fcf::devmgr::common::SUBSTATE_NOTREADY
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:98
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:100
fcf::devmgr::piezo::CI_USER_OFFSET_OUTPUT2
constexpr auto CI_USER_OFFSET_OUTPUT2
Definition: piezoConfig.hpp:55
piezoRpcErrors.hpp
PiezoRpcErrors header file.
fcf::devmgr::piezo::SubstateMap
const std::unordered_map< short, std::string > SubstateMap
Definition: piezoConfig.hpp:83
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_BIT2
constexpr auto CI_STAT_MON_ACT_POS_BIT2
Definition: piezoConfig.hpp:105
fcf::devmgr::piezo::CI_HOME2
constexpr auto CI_HOME2
Definition: piezoConfig.hpp:37
fcf::devmgr::common::SUBSTATE_OP_ERROR
constexpr int SUBSTATE_OP_ERROR
Definition: deviceConfig.hpp:109
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:98
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_BIT
constexpr auto CI_STAT_MON_ACT_POS_BIT
Definition: piezoConfig.hpp:103
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:112
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_BIT1
constexpr auto CI_STAT_MON_ACT_POS_BIT1
Definition: piezoConfig.hpp:104
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_USER3
constexpr auto CI_STAT_ACTUAL_POS_USER3
Definition: piezoConfig.hpp:101
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:80
fcf::devmgr::piezo::CI_MAX_ON
constexpr auto CI_MAX_ON
Definition: piezoConfig.hpp:31
fcf::devmgr::common::SUBSTATE_ERROR
constexpr int SUBSTATE_ERROR
Definition: deviceConfig.hpp:101
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:15
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_BIT1
constexpr auto CI_STAT_ACTUAL_POS_BIT1
Definition: piezoConfig.hpp:94
fcf::devmgr::common::DeviceConfig
Device Configuration class.
Definition: deviceConfig.hpp:127
fcf::devmgr::piezo::CI_STAT_ACTUAL_POS_BIT2
constexpr auto CI_STAT_ACTUAL_POS_BIT2
Definition: piezoConfig.hpp:95
fcf::devmgr::piezo::PiezoConfig
piezo Configuration class
Definition: piezoConfig.hpp:121
fcf::devmgr::piezo::PiezoConfig::~PiezoConfig
virtual ~PiezoConfig()=default
DeviceConfig destructor.
fcf::devmgr::piezo::CI_STAT_MON_ACT_POS_USR1
constexpr auto CI_STAT_MON_ACT_POS_USR1
Definition: piezoConfig.hpp:109
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:106
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::piezo::RPC_MOVEUSER
constexpr auto RPC_MOVEUSER
Definition: piezoConfig.hpp:74