ifw-fcf 7.1.4
Loading...
Searching...
No Matches
piezoConfig.hpp
Go to the documentation of this file.
1
8#ifndef FCF_DEVMGR_DEVICE_PIEZO_CONFIG_HPP
9#define FCF_DEVMGR_DEVICE_PIEZO_CONFIG_HPP
10
11#include <string>
12
13#include <yaml-cpp/yaml.h>
14
15#include <ifw/core/utils/bat/logger.hpp>
16
21
22
24
25 constexpr auto LOGGER_NAME = "piezo";
26 // Constants for internal mapping
27 constexpr auto CI_MAX_ON = "max_on";
28 constexpr auto CI_NUM_AXIS = "num_axis";
29 constexpr auto CI_FULL_RANGE1 = "full_range1";
30 constexpr auto CI_FULL_RANGE2 = "full_range2";
31 constexpr auto CI_FULL_RANGE3 = "full_range3";
32 constexpr auto CI_HOME1 = "home1";
33 constexpr auto CI_HOME2 = "home2";
34 constexpr auto CI_HOME3 = "home3";
35 constexpr auto CI_LOWER_LIMIT1 = "lower_limit1";
36 constexpr auto CI_LOWER_LIMIT2 = "lower_limit2";
37 constexpr auto CI_LOWER_LIMIT3 = "lower_limit3";
38 constexpr auto CI_UPPER_LIMIT1 = "upper_limit1";
39 constexpr auto CI_UPPER_LIMIT2 = "upper_limit2";
40 constexpr auto CI_UPPER_LIMIT3 = "upper_limit3";
41 constexpr auto CI_USER_TO_BIT_INPUT1 = "user_to_bit_input1";
42 constexpr auto CI_USER_TO_BIT_INPUT2 = "user_to_bit_input2";
43 constexpr auto CI_USER_TO_BIT_INPUT3 = "user_to_bit_input3";
44 constexpr auto CI_USER_OFFSET_INPUT1 = "user_offset_input1";
45 constexpr auto CI_USER_OFFSET_INPUT2 = "user_offset_input2";
46 constexpr auto CI_USER_OFFSET_INPUT3 = "user_offset_input3";
47 constexpr auto CI_USER_TO_BIT_OUTPUT1 = "user_to_bit_output1";
48 constexpr auto CI_USER_TO_BIT_OUTPUT2 = "user_to_bit_output2";
49 constexpr auto CI_USER_TO_BIT_OUTPUT3 = "user_to_bit_output3";
50 constexpr auto CI_USER_OFFSET_OUTPUT1 = "user_offset_output1";
51 constexpr auto CI_USER_OFFSET_OUTPUT2 = "user_offset_output2";
52 constexpr auto CI_USER_OFFSET_OUTPUT3 = "user_offset_output3";
53
54 constexpr bool DEFAULT_MAX_ON = 0;
55 constexpr bool DEFAULT_NUM_AXIS = 2;
56 constexpr short DEFAULT_FULL_RANGE = 32767;
57 constexpr short DEFAULT_LOWER_LIMIT = 0;
58 constexpr short DEFAULT_UPPER_LIMIT = 32767;
59 constexpr short DEFAULT_USER_OFFSET = 0;
60 constexpr short DEFAULT_HOME = 0;
61 constexpr double DEFAULT_USER_TO_BIT = 32767/10.0;
62
63 // Specifics Piezo status values
64
65 // Specific Piezo RPC
66 constexpr auto RPC_AUTO = "rpcAuto";
67 constexpr auto RPC_HOME = "rpcHome";
68 constexpr auto RPC_POS = "rpcPos";
69 constexpr auto RPC_MOVEBITS = "rpcMoveBits";
70 constexpr auto RPC_MOVEUSER = "rpcMoveUser";
71
72 // Specific constant values for Piezo device state/substate
73 constexpr short SUBSTATE_OP_POS = 203;
74 constexpr short SUBSTATE_OP_AUTO = 204;
75
76 constexpr auto SUBSTATE_OP_POS_STR = "Pos";
77 constexpr auto SUBSTATE_OP_AUTO_STR = "Auto";
78
87
88 // Status configuration attributes
89 constexpr auto CI_STAT_ACTUAL_POS_BIT = "actual_pos_bit";
90 constexpr auto CI_STAT_ACTUAL_POS_BIT1 = "actual_pos_bit1";
91 constexpr auto CI_STAT_ACTUAL_POS_BIT2 = "actual_pos_bit2";
92 constexpr auto CI_STAT_ACTUAL_POS_BIT3 = "actual_pos_bit3";
93
94 constexpr auto CI_STAT_ACTUAL_POS_USER = "actual_pos_user";
95 constexpr auto CI_STAT_ACTUAL_POS_USER1 = "actual_pos_user1";
96 constexpr auto CI_STAT_ACTUAL_POS_USER2 = "actual_pos_user2";
97 constexpr auto CI_STAT_ACTUAL_POS_USER3 = "actual_pos_user3";
98
99 constexpr auto CI_STAT_MON_ACT_POS_BIT = "mon_act_pos_bit";
100 constexpr auto CI_STAT_MON_ACT_POS_BIT1 = "mon_act_pos_bit1";
101 constexpr auto CI_STAT_MON_ACT_POS_BIT2 = "mon_act_pos_bit2";
102 constexpr auto CI_STAT_MON_ACT_POS_BIT3 = "mon_act_pos_bit3";
103
104 constexpr auto CI_STAT_MON_ACT_POS_USR = "mon_act_pos_usr";
105 constexpr auto CI_STAT_MON_ACT_POS_USR1 = "mon_act_pos_usr1";
106 constexpr auto CI_STAT_MON_ACT_POS_USR2 = "mon_act_pos_usr2";
107 constexpr auto CI_STAT_MON_ACT_POS_USR3 = "mon_act_pos_usr3";
108
117 {
118
119 public:
120
126 PiezoConfig(const std::string filename,
127 const std::string name);
128
133 PiezoConfig(const std::string name);
134
138 virtual ~PiezoConfig() = default;
139
140 short GetNumAxes() const;
141
142 private:
143 log4cplus::Logger m_logger;
144 };
145
146} //namespace
147
148
149#endif //FCF_DEVMGR_DEVICE_PIEZO_CONFIG_H
Device Configuration class.
Definition deviceConfig.hpp:124
piezo Configuration class
Definition piezoConfig.hpp:117
PiezoConfig(const std::string name)
DeviceConfig constructor.
short GetNumAxes() const
Definition piezoConfig.cpp:20
virtual ~PiezoConfig()=default
DeviceConfig destructor.
PiezoConfig(const std::string filename, const std::string name)
DeviceConfig constructor.
Definition piezoConfig.cpp:13
constexpr int SUBSTATE_ERROR
Definition deviceConfig.hpp:97
constexpr auto SUBSTATE_INITIALISING_STR
Definition deviceConfig.hpp:100
constexpr auto SUBSTATE_ERROR_STR
Definition deviceConfig.hpp:102
constexpr int SUBSTATE_INITIALISING
Definition deviceConfig.hpp:96
constexpr auto SUBSTATE_NOTREADY_STR
Definition deviceConfig.hpp:99
constexpr int SUBSTATE_OP_ERROR
Definition deviceConfig.hpp:105
constexpr int SUBSTATE_NOTREADY
Definition deviceConfig.hpp:94
constexpr auto SUBSTATE_OP_ERROR_STR
Definition deviceConfig.hpp:108
Piezo class header file.
Definition piezo.hpp:17
constexpr auto CI_USER_OFFSET_OUTPUT1
Definition piezoConfig.hpp:50
constexpr auto CI_HOME3
Definition piezoConfig.hpp:34
constexpr auto CI_STAT_ACTUAL_POS_BIT2
Definition piezoConfig.hpp:91
constexpr auto RPC_HOME
Definition piezoConfig.hpp:67
constexpr auto CI_UPPER_LIMIT1
Definition piezoConfig.hpp:38
constexpr auto CI_LOWER_LIMIT2
Definition piezoConfig.hpp:36
constexpr auto CI_USER_TO_BIT_INPUT2
Definition piezoConfig.hpp:42
constexpr auto RPC_MOVEUSER
Definition piezoConfig.hpp:70
constexpr auto CI_USER_TO_BIT_INPUT3
Definition piezoConfig.hpp:43
constexpr auto CI_MAX_ON
Definition piezoConfig.hpp:27
constexpr auto CI_STAT_MON_ACT_POS_BIT2
Definition piezoConfig.hpp:101
constexpr auto SUBSTATE_OP_POS_STR
Definition piezoConfig.hpp:76
constexpr short SUBSTATE_OP_POS
Definition piezoConfig.hpp:73
constexpr auto CI_USER_OFFSET_OUTPUT3
Definition piezoConfig.hpp:52
constexpr short DEFAULT_FULL_RANGE
Definition piezoConfig.hpp:56
constexpr auto CI_FULL_RANGE3
Definition piezoConfig.hpp:31
constexpr auto CI_STAT_MON_ACT_POS_BIT
Definition piezoConfig.hpp:99
constexpr short SUBSTATE_OP_AUTO
Definition piezoConfig.hpp:74
constexpr short DEFAULT_USER_OFFSET
Definition piezoConfig.hpp:59
constexpr auto CI_USER_TO_BIT_OUTPUT1
Definition piezoConfig.hpp:47
constexpr auto CI_HOME1
Definition piezoConfig.hpp:32
constexpr auto CI_FULL_RANGE1
Definition piezoConfig.hpp:29
constexpr auto LOGGER_NAME
Definition piezoConfig.hpp:25
constexpr auto CI_LOWER_LIMIT1
Definition piezoConfig.hpp:35
constexpr auto CI_USER_TO_BIT_OUTPUT2
Definition piezoConfig.hpp:48
constexpr auto CI_USER_OFFSET_INPUT3
Definition piezoConfig.hpp:46
constexpr auto CI_USER_OFFSET_INPUT1
Definition piezoConfig.hpp:44
constexpr short DEFAULT_UPPER_LIMIT
Definition piezoConfig.hpp:58
constexpr auto CI_STAT_ACTUAL_POS_USER2
Definition piezoConfig.hpp:96
constexpr auto CI_STAT_MON_ACT_POS_USR2
Definition piezoConfig.hpp:106
constexpr auto CI_STAT_ACTUAL_POS_USER
Definition piezoConfig.hpp:94
constexpr auto CI_STAT_MON_ACT_POS_USR1
Definition piezoConfig.hpp:105
constexpr auto CI_STAT_ACTUAL_POS_BIT3
Definition piezoConfig.hpp:92
constexpr auto CI_LOWER_LIMIT3
Definition piezoConfig.hpp:37
constexpr auto CI_STAT_ACTUAL_POS_USER1
Definition piezoConfig.hpp:95
constexpr bool DEFAULT_NUM_AXIS
Definition piezoConfig.hpp:55
constexpr auto CI_UPPER_LIMIT3
Definition piezoConfig.hpp:40
constexpr auto CI_UPPER_LIMIT2
Definition piezoConfig.hpp:39
constexpr auto CI_NUM_AXIS
Definition piezoConfig.hpp:28
constexpr auto CI_HOME2
Definition piezoConfig.hpp:33
constexpr auto CI_USER_TO_BIT_INPUT1
Definition piezoConfig.hpp:41
constexpr auto CI_USER_OFFSET_OUTPUT2
Definition piezoConfig.hpp:51
const std::unordered_map< short, std::string > SUBSTATE_MAP
Definition piezoConfig.hpp:79
constexpr auto CI_STAT_ACTUAL_POS_USER3
Definition piezoConfig.hpp:97
constexpr auto CI_STAT_MON_ACT_POS_USR3
Definition piezoConfig.hpp:107
constexpr auto CI_STAT_MON_ACT_POS_BIT3
Definition piezoConfig.hpp:102
constexpr auto SUBSTATE_OP_AUTO_STR
Definition piezoConfig.hpp:77
constexpr auto CI_FULL_RANGE2
Definition piezoConfig.hpp:30
constexpr auto RPC_AUTO
Definition piezoConfig.hpp:66
constexpr short DEFAULT_HOME
Definition piezoConfig.hpp:60
constexpr double DEFAULT_USER_TO_BIT
Definition piezoConfig.hpp:61
constexpr short DEFAULT_LOWER_LIMIT
Definition piezoConfig.hpp:57
constexpr auto CI_STAT_MON_ACT_POS_BIT1
Definition piezoConfig.hpp:100
constexpr auto CI_STAT_MON_ACT_POS_USR
Definition piezoConfig.hpp:104
constexpr bool DEFAULT_MAX_ON
Definition piezoConfig.hpp:54
constexpr auto CI_USER_OFFSET_INPUT2
Definition piezoConfig.hpp:45
constexpr auto CI_USER_TO_BIT_OUTPUT3
Definition piezoConfig.hpp:49
constexpr auto CI_STAT_ACTUAL_POS_BIT
Definition piezoConfig.hpp:89
constexpr auto RPC_MOVEBITS
Definition piezoConfig.hpp:69
constexpr auto RPC_POS
Definition piezoConfig.hpp:68
constexpr auto CI_STAT_ACTUAL_POS_BIT1
Definition piezoConfig.hpp:90