ifw-fcf  4.0.0
motorConfig.hpp
Go to the documentation of this file.
1 
10 #ifndef FCF_DEVMGR_DEVICE_MOTOR_CONFIG_HPP
11 #define FCF_DEVMGR_DEVICE_MOTOR_CONFIG_HPP
12 
13 // System headers
14 #include <string>
15 #include <unordered_map>
16 
17 // Third party headers
18 #include <yaml-cpp/yaml.h>
19 
20 #include <utils/bat/logger.hpp>
21 #include <fcf/common/iComm.hpp>
27 
28 
29 namespace fcf::devmgr::motor {
30 
31  constexpr auto LOGGER_NAME = "motor";
32  // Constants for internal mapping
33  constexpr auto CI_BRAKE = "brake";
34  constexpr auto CI_BACKLASH = "backlash";
35  constexpr auto CI_AXIS_TYPE = "axis_type";
36  constexpr auto CI_DEF_VEL = "velocity";
37  constexpr auto CI_MAX_POS = "max_pos";
38  constexpr auto CI_MIN_POS = "min_pos";
39 
40  constexpr auto CI_CHECK_INPOS = "check_inpos";
41  constexpr auto CI_LOCK = "lock";
42  constexpr auto CI_LOCK_POS = "lock_pos";
43  constexpr auto CI_LOCK_TOLERANCE = "lock_tolerance";
44  constexpr auto CI_DISABLE = "disable";
45 
46  constexpr auto CI_TIMEOUT_INIT = "tout_init";
47  constexpr auto CI_TIMEOUT_MOVE = "tout_move";
48  constexpr auto CI_TIMEOUT_SWITCH = "tout_switch";
49 
50  constexpr auto CI_ACTIVE_LOW_BRAKE = "low_brake";
51  constexpr auto CI_ACTIVE_LOW_INPOS = "low_inpos";
52  constexpr auto CI_ACTIVE_LOW_STOP = "active_low_lstop";
53  constexpr auto CI_ACTIVE_LOW_LHW = "active_low_lhw";
54  constexpr auto CI_ACTIVE_LOW_REF = "active_low_ref";
55  constexpr auto CI_ACTIVE_LOW_INDEX = "active_low_index";
56  constexpr auto CI_ACTIVE_LOW_UHW = "active_low_uhw";
57  constexpr auto CI_ACTIVE_LOW_USTOP = "active_low_ustop";
58 
59  constexpr auto CI_EXEC_PRE_INIT = "exec_pre_init";
60  constexpr auto CI_EXEC_POST_INIT = "exec_post_init";
61  constexpr auto CI_EXEC_PRE_MOVE = "exec_pre_move";
62  constexpr auto CI_EXEC_POST_MOVE = "exec_post_move";
63 
64  constexpr auto CI_INITIALISATION = "initialisation";
65  constexpr auto CI_INIT_SEQUENCE = "sequence";
66  constexpr auto CI_INIT_ACTION = "step";
67  constexpr auto CI_INIT_VALUE_1 = "value1";
68  constexpr auto CI_INIT_VALUE_2 = "value2";
69 
70 
71  // WS configuration keywords
72  // These configuration only matters for WS level
73  constexpr auto CI_POSITIONS = "positions";
74  constexpr auto CI_POS_NAME = "name";
75  constexpr auto CI_POS_VALUE = "value";
76  constexpr auto CI_NAME_POS_TOLERANCE = "tolerance";
77  constexpr auto CI_SCALE_FACTOR = "scale_factor";
78 
79  constexpr int CI_AXIS_TYPE_LINEAR = 1;
80  constexpr int CI_AXIS_TYPE_CIRCULAR = 2;
81  constexpr int CI_AXIS_TYPE_CIRCULAR_OPT = 3;
82 
83  constexpr auto CI_AXIS_TYPE_LINEAR_STR = "LINEAR";
84  constexpr auto CI_AXIS_TYPE_CIRCULAR_STR = "CIRCULAR";
85  constexpr auto CI_AXIS_TYPE_CIRCULAR_OPT_STR = "CIRCULAR_OPT";
86 
87  constexpr int CI_AXIS_MODE_INPOS = 0;
88  constexpr int CI_AXIS_MODE_INVEL = 1;
89 
90  constexpr auto CI_AXIS_MODE_INPOS_STR = "InPosition";
91  constexpr auto CI_AXIS_MODE_INVEL_STR = "InVelocity";
92 
93  const std::unordered_map<int, std::string> AxisModeMap = {
96  };
97 
98  constexpr int CI_MAX_INIT_STEPS = 10;
99 
100  constexpr auto CI_INIT_ACTION_END = "END";
101  constexpr auto CI_INIT_ACTION_FIND_INDEX = "FIND_INDEX";
102  constexpr auto CI_INIT_ACTION_FIND_REF_LE = "FIND_REF_LE";
103  constexpr auto CI_INIT_ACTION_FIND_REF_UE = "FIND_REF_UE";
104  constexpr auto CI_INIT_ACTION_FIND_LHW = "FIND_LHW";
105  constexpr auto CI_INIT_ACTION_FIND_UHW = "FIND_UHW";
106  constexpr auto CI_INIT_ACTION_DELAY = "DELAY";
107  constexpr auto CI_INIT_ACTION_MOVE_ABS = "MOVE_ABS";
108  constexpr auto CI_INIT_ACTION_MOVE_REL = "MOVE_REL";
109  constexpr auto CI_INIT_ACTION_CALIB_ABS = "CALIB_ABS";
110  constexpr auto CI_INIT_ACTION_CALIB_REL = "CALIB_REL";
111  constexpr auto CI_INIT_ACTION_CALIB_SWITCH = "CALIB_SWITCH";
112 
113  constexpr auto RPC_MOVE_ABS = "rpcMoveAbs";
114  constexpr auto RPC_MOVE_REL = "rpcMoveRel";
115  constexpr auto RPC_MOVE_VEL = "rpcMoveVel";
116 
117  constexpr int SUBSTATE_ABORTING = 107;
118  constexpr int SUBSTATE_OP_STANDSTILL = 216;
119  constexpr int SUBSTATE_OP_MOVING = 217;
120  constexpr int SUBSTATE_OP_SETTING_POS = 218;
121  constexpr int SUBSTATE_OP_STOPPING = 219;
122 
123  constexpr auto SUBSTATE_READY_STR = "Ready";
124  constexpr auto SUBSTATE_ABORTING_STR = "Aborting";
125  constexpr auto SUBSTATE_OP_STANDSTILL_STR = "Standstill";
126  constexpr auto SUBSTATE_OP_MOVING_STR = "Moving";
127  constexpr auto SUBSTATE_OP_SETTING_POS_STR = "SettingPos";
128  constexpr auto SUBSTATE_OP_STOPPING_STR = "Stopping";
129 
130  const std::unordered_map<short, std::string> SubstateMap = {
141  };
142 
143  // encoders are used only at the WS level
144  constexpr auto CI_STAT_ENC_POS = "pos_enc";
145  constexpr auto CI_STAT_TARGET_ENC = "target_enc";
146  constexpr auto CI_STAT_TARGET_POSNAME = "pos_target_name";
147  constexpr auto CI_STAT_ACTUAL_POSNAME = "pos_actual_name";
148  constexpr auto CI_STAT_TARGET_POS = "pos_target";
149  constexpr auto CI_STAT_ACTUAL_POS = "pos_actual";
150  constexpr auto CI_STAT_POS_ERROR = "pos_error";
151  constexpr auto CI_STAT_ACTUAL_VEL = "vel_actual";
152  constexpr auto CI_STAT_TARGET_VEL = "vel_target";
153  constexpr auto CI_STAT_SCALE_FACTOR = "scale_factor";
154  constexpr auto CI_STAT_BACKLASH_STEP = "backlash_step";
155  constexpr auto CI_STAT_MODE = "mode";
156  constexpr auto CI_STAT_INITIALISED = "initialised";
157  constexpr auto CI_STAT_INIT_STEP = "init_step";
158  constexpr auto CI_STAT_INIT_ACTION = "init_action";
159  constexpr auto CI_STAT_AXIS_READY = "axis_ready";
160  constexpr auto CI_STAT_AXIS_ENABLE = "axis_enable";
161  constexpr auto CI_STAT_AXIS_INPOS = "axis_inposition";
162  constexpr auto CI_STAT_AXIS_LOCK = "axis_lock";
163  constexpr auto CI_STAT_AXIS_BRAKE = "axis_brake";
164  constexpr auto CI_STAT_AXIS_STOP_NEG = "axis_stop_pos";
165  constexpr auto CI_STAT_AXIS_STOP_POS = "axis_stop_neg";
166  constexpr auto CI_STAT_AXIS_INFO_DATA_1 = "axis_info_data1";
167  constexpr auto CI_STAT_AXIS_INFO_DATA_2 = "axis_info_data2";
168 
169  constexpr auto CI_STAT_SIGNAL_LSTOP = "signal_lstop";
170  constexpr auto CI_STAT_SIGNAL_LHW = "signal_lhw";
171  constexpr auto CI_STAT_SIGNAL_REF = "signal_ref";
172  constexpr auto CI_STAT_SIGNAL_INDEX = "signal_index";
173  constexpr auto CI_STAT_SIGNAL_UHW = "signal_uhw";
174  constexpr auto CI_STAT_SIGNAL_USTOP = "signal_ustop";
175 
176  enum class Signal : short {LSTOP = 0,
177  LHW = 1,
178  REF = 2,
179  INDEX = 3,
180  UHW = 4,
181  USTOP = 5};
182 
183 
184  constexpr auto FITS_PARAM_POSNAME = "POSNAME";
185  constexpr auto FITS_PARAM_POS = "POS";
186  constexpr auto FITS_PARAM_BRAKE = "BRAKE";
187  constexpr auto FITS_PARAM_LOCK = "LOCK";
188 
189 
190  constexpr auto UndefinedNamedPos = "undefined";
191 
192 
193  // Map of Axis type to do the converstion between strings to numbers
194  const std::unordered_map<std::string, int> AxisTypeMap = {
198  };
199 
200  enum {
213  };
214 
215  // @TODO: replaced by boost bimaps
216  // Tried with boost bimap but I've got hundred of errors.
217  // I added temporaly two maps.
218 
219  // Map of motor initialisation steps
220  const std::unordered_map<std::string, int> InitActionsMap = {
233  };
234 
235  // Map of motor initialisation steps
236  const std::unordered_map<int, std::string> InitActions2Map = {
249  };
250 
251  struct InitAction {
252  int id;
253  double value1;
254  double value2;
255 
256  InitAction():id(0), value1(0.0), value2(0.0) {}
257  };
258 
259  class Sensor;
268  {
269  friend class Sensor;
270 
271  public:
272  enum {
299  END_ENUM_MOTOR // WARNING: This should be always last enumerator.
300  };
301 
302  public:
308  MotorConfig(const std::string filename,
309  const std::string name);
310 
315  MotorConfig(const std::string name);
316 
320  virtual ~MotorConfig() = default;
321 
322 
330  virtual void Init();
344  virtual void GetConfig(fcf::common::VectorVariant& params) const override;
345 
346 
356  virtual void GetConfigList(utils::bat::DbVector& cfg_list,
357  std::string prefix) const override;
358 
359 
360 
365  inline int GetNumberOfNamedPositions() const noexcept {return m_num_named_pos;};
366 
371  inline int GetNumberOfInitSteps() const noexcept {return m_init_sequence.size();};
372 
373 
378  double GetVelocity() const ;
379 
384  void SetScaleFactor(double scale);
385 
390  double GetScaleFactor() const;
391 
397  std::string GetNamedPosition(const int index) const;
398 
404  double GetNamedPositionValue(const int index) const;
405 
412  bool FindNamedPositionValue(const std::string named_pos,
413  double& position) const;
414 
421  bool FindNamedPositionValue(const double position,
422  std::string& name) const;
423 
428  double GetNpTolerance() const;
429 
430 
431  protected:
432 
433  // Map of motor init step to do the conversion between strings to numbers
434  std::vector<InitAction> m_init_sequence;
435 
436  private:
437  // dynamic configuration values
438  double m_scale_factor;
439  int m_num_named_pos;
440  double m_np_tolerance;
441 
442  // Map of motor named positions
443  std::unordered_map<std::string, double> m_named_positions;
444  log4cplus::Logger m_logger;
445 
446  };
447 
448 }
449 
450 
451 #endif //FCF_DEVMGR_DEVICE_MOTOR_CONFIG_H
fcf::devmgr::motor::SUBSTATE_OP_MOVING_STR
constexpr auto SUBSTATE_OP_MOVING_STR
Definition: motorConfig.hpp:126
fcf::devmgr::motor::INIT_ACTION_MOVE_REL
@ INIT_ACTION_MOVE_REL
Definition: motorConfig.hpp:209
fcf::devmgr::motor::MotorConfig::CFG_LOCK
@ CFG_LOCK
Definition: motorConfig.hpp:280
fcf::devmgr::motor::INIT_ACTION_FIND_UHW
@ INIT_ACTION_FIND_UHW
Definition: motorConfig.hpp:206
fcf::devmgr::motor::CI_STAT_BACKLASH_STEP
constexpr auto CI_STAT_BACKLASH_STEP
Definition: motorConfig.hpp:154
fcf::devmgr::motor::CI_STAT_SIGNAL_USTOP
constexpr auto CI_STAT_SIGNAL_USTOP
Definition: motorConfig.hpp:174
dataContext.hpp
DataContext class header file.
fcf::devmgr::motor::MotorConfig::GetScaleFactor
double GetScaleFactor() const
Definition: motorConfig.cpp:160
fcf::devmgr::motor::MotorConfig::GetNamedPosition
std::string GetNamedPosition(const int index) const
GetNamedPosition.
Definition: motorConfig.cpp:164
fcf::devmgr::motor::CI_AXIS_TYPE_CIRCULAR_OPT_STR
constexpr auto CI_AXIS_TYPE_CIRCULAR_OPT_STR
Definition: motorConfig.hpp:85
fcf::devmgr::motor::CI_INIT_SEQUENCE
constexpr auto CI_INIT_SEQUENCE
Definition: motorConfig.hpp:65
fcf::devmgr::motor::InitAction::InitAction
InitAction()
Definition: motorConfig.hpp:256
fcf::devmgr::motor::MotorConfig::CFG_ACTLOWINDEX
@ CFG_ACTLOWINDEX
Definition: motorConfig.hpp:292
fcf::devmgr::motor
Definition: motor.hpp:20
fcf::devmgr::motor::InitAction::value2
double value2
Definition: motorConfig.hpp:254
fcf::devmgr::motor::AxisTypeMap
const std::unordered_map< std::string, int > AxisTypeMap
Definition: motorConfig.hpp:194
fcf::devmgr::motor::CI_LOCK_POS
constexpr auto CI_LOCK_POS
Definition: motorConfig.hpp:42
fcf::devmgr::motor::MotorConfig::SetScaleFactor
void SetScaleFactor(double scale)
Set Scale Factor.
Definition: motorConfig.cpp:154
fcf::devmgr::motor::INIT_ACTION_DELAY
@ INIT_ACTION_DELAY
Definition: motorConfig.hpp:207
fcf::devmgr::motor::CI_STAT_INIT_ACTION
constexpr auto CI_STAT_INIT_ACTION
Definition: motorConfig.hpp:158
fcf::devmgr::motor::CI_STAT_TARGET_POSNAME
constexpr auto CI_STAT_TARGET_POSNAME
Definition: motorConfig.hpp:146
fcf::devmgr::motor::CI_SCALE_FACTOR
constexpr auto CI_SCALE_FACTOR
Definition: motorConfig.hpp:77
fcf::devmgr::motor::CI_INIT_ACTION_FIND_INDEX
constexpr auto CI_INIT_ACTION_FIND_INDEX
Definition: motorConfig.hpp:101
fcf::devmgr::motor::CI_STAT_INIT_STEP
constexpr auto CI_STAT_INIT_STEP
Definition: motorConfig.hpp:157
motorHwErrors.hpp
MotorHwErrors header file.
fcf::devmgr::motor::CI_BACKLASH
constexpr auto CI_BACKLASH
Definition: motorConfig.hpp:34
fcf::devmgr::motor::MotorConfig::CFG_ACTLOWUSTOP
@ CFG_ACTLOWUSTOP
Definition: motorConfig.hpp:294
fcf::devmgr::motor::CI_EXEC_PRE_INIT
constexpr auto CI_EXEC_PRE_INIT
Definition: motorConfig.hpp:59
fcf::devmgr::motor::FITS_PARAM_POSNAME
constexpr auto FITS_PARAM_POSNAME
Definition: motorConfig.hpp:184
fcf::devmgr::motor::CI_STAT_POS_ERROR
constexpr auto CI_STAT_POS_ERROR
Definition: motorConfig.hpp:150
m_logger
m_logger(log4cplus::Logger::getInstance(LOGGER_NAME))
Definition: {{cookiecutter.device_name}}.cpp:32
fcf::devmgr::motor::CI_ACTIVE_LOW_INDEX
constexpr auto CI_ACTIVE_LOW_INDEX
Definition: motorConfig.hpp:55
fcf::devmgr::motor::CI_ACTIVE_LOW_USTOP
constexpr auto CI_ACTIVE_LOW_USTOP
Definition: motorConfig.hpp:57
fcf::devmgr::motor::CI_INIT_ACTION_DELAY
constexpr auto CI_INIT_ACTION_DELAY
Definition: motorConfig.hpp:106
fcf::devmgr::motor::InitActions2Map
const std::unordered_map< int, std::string > InitActions2Map
Definition: motorConfig.hpp:236
fcf::devmgr::motor::CI_POSITIONS
constexpr auto CI_POSITIONS
Definition: motorConfig.hpp:73
fcf::devmgr::motor::CI_STAT_SIGNAL_INDEX
constexpr auto CI_STAT_SIGNAL_INDEX
Definition: motorConfig.hpp:172
fcf::devmgr::motor::LOGGER_NAME
constexpr auto LOGGER_NAME
Definition: motorConfig.hpp:31
const
std::string const
Definition: test{{cookiecutter.device_name|capitalize()}}.cpp:162
fcf::devmgr::motor::CI_EXEC_POST_MOVE
constexpr auto CI_EXEC_POST_MOVE
Definition: motorConfig.hpp:62
fcf::devmgr::motor::InitAction::value1
double value1
Definition: motorConfig.hpp:253
fcf::devmgr::motor::RPC_MOVE_VEL
constexpr auto RPC_MOVE_VEL
Definition: motorConfig.hpp:115
fcf::devmgr::motor::INIT_ACTION_END
@ INIT_ACTION_END
Definition: motorConfig.hpp:201
fcf::devmgr::motor::INIT_ACTION_CALIB_SWITCH
@ INIT_ACTION_CALIB_SWITCH
Definition: motorConfig.hpp:212
deviceConfig.hpp
DeviceConfig class header file.
fcf::devmgr::motor::CI_AXIS_TYPE_CIRCULAR
constexpr int CI_AXIS_TYPE_CIRCULAR
Definition: motorConfig.hpp:80
fcf::devmgr::motor::CI_AXIS_MODE_INPOS_STR
constexpr auto CI_AXIS_MODE_INPOS_STR
Definition: motorConfig.hpp:90
fcf::devmgr::motor::SUBSTATE_OP_MOVING
constexpr int SUBSTATE_OP_MOVING
Definition: motorConfig.hpp:119
fcf::devmgr::motor::MotorConfig::CFG_AUTODISABLE
@ CFG_AUTODISABLE
Definition: motorConfig.hpp:283
fcf::devmgr::motor::INIT_ACTION_FIND_REF_UE
@ INIT_ACTION_FIND_REF_UE
Definition: motorConfig.hpp:204
fcf::devmgr::motor::INIT_ACTION_FIND_LHW
@ INIT_ACTION_FIND_LHW
Definition: motorConfig.hpp:205
fcf::devmgr::motor::INIT_ACTION_CALIB_ABS
@ INIT_ACTION_CALIB_ABS
Definition: motorConfig.hpp:210
fcf::devmgr::motor::CI_INITIALISATION
constexpr auto CI_INITIALISATION
Definition: motorConfig.hpp:64
fcf::devmgr::motor::CI_AXIS_MODE_INVEL_STR
constexpr auto CI_AXIS_MODE_INVEL_STR
Definition: motorConfig.hpp:91
fcf::devmgr::motor::CI_EXEC_PRE_MOVE
constexpr auto CI_EXEC_PRE_MOVE
Definition: motorConfig.hpp:61
fcf::devmgr::motor::MotorConfig::CFG_SWITCHTOUT
@ CFG_SWITCHTOUT
Definition: motorConfig.hpp:286
fcf::devmgr::motor::CI_MIN_POS
constexpr auto CI_MIN_POS
Definition: motorConfig.hpp:38
fcf::devmgr::motor::CI_STAT_SIGNAL_REF
constexpr auto CI_STAT_SIGNAL_REF
Definition: motorConfig.hpp:171
fcf::devmgr::motor::CI_STAT_TARGET_VEL
constexpr auto CI_STAT_TARGET_VEL
Definition: motorConfig.hpp:152
fcf::devmgr::motor::CI_STAT_AXIS_STOP_NEG
constexpr auto CI_STAT_AXIS_STOP_NEG
Definition: motorConfig.hpp:164
fcf::devmgr::motor::CI_ACTIVE_LOW_INPOS
constexpr auto CI_ACTIVE_LOW_INPOS
Definition: motorConfig.hpp:51
fcf::devmgr::motor::CI_STAT_TARGET_POS
constexpr auto CI_STAT_TARGET_POS
Definition: motorConfig.hpp:148
fcf::devmgr::motor::CI_STAT_AXIS_READY
constexpr auto CI_STAT_AXIS_READY
Definition: motorConfig.hpp:159
fcf::devmgr::motor::SUBSTATE_ABORTING
constexpr int SUBSTATE_ABORTING
Definition: motorConfig.hpp:117
fcf::devmgr::motor::MotorConfig::CFG_EXECPREMOVE
@ CFG_EXECPREMOVE
Definition: motorConfig.hpp:297
fcf::devmgr::motor::CI_INIT_ACTION_FIND_UHW
constexpr auto CI_INIT_ACTION_FIND_UHW
Definition: motorConfig.hpp:105
fcf::devmgr::motor::CI_STAT_SCALE_FACTOR
constexpr auto CI_STAT_SCALE_FACTOR
Definition: motorConfig.hpp:153
fcf::devmgr::motor::CI_DISABLE
constexpr auto CI_DISABLE
Definition: motorConfig.hpp:44
fcf::devmgr::motor::CI_BRAKE
constexpr auto CI_BRAKE
Definition: motorConfig.hpp:33
fcf::devmgr::motor::Signal
Signal
Definition: motorConfig.hpp:176
fcf::devmgr::motor::UndefinedNamedPos
constexpr auto UndefinedNamedPos
Definition: motorConfig.hpp:190
fcf::devmgr::motor::CI_INIT_ACTION_FIND_REF_LE
constexpr auto CI_INIT_ACTION_FIND_REF_LE
Definition: motorConfig.hpp:102
fcf::devmgr::motor::CI_CHECK_INPOS
constexpr auto CI_CHECK_INPOS
Definition: motorConfig.hpp:40
fcf::devmgr::motor::MotorConfig::CFG_ACTLOWBRAKE
@ CFG_ACTLOWBRAKE
Definition: motorConfig.hpp:287
motorRpcErrors.hpp
LampRpcErrors header file.
fcf::devmgr::motor::FITS_PARAM_POS
constexpr auto FITS_PARAM_POS
Definition: motorConfig.hpp:185
fcf::devmgr::motor::CI_INIT_ACTION_MOVE_REL
constexpr auto CI_INIT_ACTION_MOVE_REL
Definition: motorConfig.hpp:108
fcf::devmgr::motor::CI_MAX_POS
constexpr auto CI_MAX_POS
Definition: motorConfig.hpp:37
fcf::devmgr::motor::MotorConfig::CFG_MINPOS
@ CFG_MINPOS
Definition: motorConfig.hpp:278
fcf::devmgr::motor::MotorConfig::CFG_ACTLOWINPOS
@ CFG_ACTLOWINPOS
Definition: motorConfig.hpp:288
fcf::devmgr::motor::CI_POS_NAME
constexpr auto CI_POS_NAME
Definition: motorConfig.hpp:74
fcf::devmgr::motor::MotorConfig::GetConfigList
virtual void GetConfigList(utils::bat::DbVector &cfg_list, std::string prefix) const override
Get configuration list.
Definition: motorConfig.cpp:220
fcf::devmgr::motor::MotorConfig::CFG_BACKLASH
@ CFG_BACKLASH
Definition: motorConfig.hpp:274
fcf::devmgr::motor::SUBSTATE_OP_STANDSTILL_STR
constexpr auto SUBSTATE_OP_STANDSTILL_STR
Definition: motorConfig.hpp:125
fcf::devmgr::motor::MotorConfig::MotorConfig
MotorConfig(const std::string filename, const std::string name)
MotorConfig constructor.
Definition: motorConfig.cpp:25
fcf::devmgr::motor::CI_POS_VALUE
constexpr auto CI_POS_VALUE
Definition: motorConfig.hpp:75
fcf::devmgr::motor::MotorConfig::CFG_INITTOUT
@ CFG_INITTOUT
Definition: motorConfig.hpp:284
fcf::devmgr::motor::MotorConfig::Sensor
friend class Sensor
Definition: motorConfig.hpp:269
fcf::devmgr::motor::CI_INIT_ACTION_MOVE_ABS
constexpr auto CI_INIT_ACTION_MOVE_ABS
Definition: motorConfig.hpp:107
fcf::devmgr::motor::CI_AXIS_TYPE_CIRCULAR_STR
constexpr auto CI_AXIS_TYPE_CIRCULAR_STR
Definition: motorConfig.hpp:84
fcf::devmgr::motor::CI_STAT_ENC_POS
constexpr auto CI_STAT_ENC_POS
Definition: motorConfig.hpp:144
fcf::devmgr::motor::CI_STAT_AXIS_LOCK
constexpr auto CI_STAT_AXIS_LOCK
Definition: motorConfig.hpp:162
fcf::devmgr::motor::MotorConfig::CFG_MOVETOUT
@ CFG_MOVETOUT
Definition: motorConfig.hpp:285
fcf::devmgr::motor::CI_INIT_ACTION_END
constexpr auto CI_INIT_ACTION_END
Definition: motorConfig.hpp:100
fcf::devmgr::motor::MotorConfig::CFG_CHECKINPOS
@ CFG_CHECKINPOS
Definition: motorConfig.hpp:279
fcf::devmgr::motor::CI_ACTIVE_LOW_REF
constexpr auto CI_ACTIVE_LOW_REF
Definition: motorConfig.hpp:54
fcf::devmgr::motor::MotorConfig::CFG_MAXPOS
@ CFG_MAXPOS
Definition: motorConfig.hpp:277
fcf::devmgr::motor::MotorConfig::CFG_BRAKE
@ CFG_BRAKE
Definition: motorConfig.hpp:273
fcf::devmgr::motor::CI_LOCK
constexpr auto CI_LOCK
Definition: motorConfig.hpp:41
fcf::devmgr::motor::MotorConfig::CFG_LOCKPOS
@ CFG_LOCKPOS
Definition: motorConfig.hpp:281
fcf::devmgr::motor::MotorConfig::CFG_EXECPOSTINIT
@ CFG_EXECPOSTINIT
Definition: motorConfig.hpp:296
fcf::devmgr::motor::CI_AXIS_TYPE
constexpr auto CI_AXIS_TYPE
Definition: motorConfig.hpp:35
fcf::devmgr::common::SUBSTATE_NOTREADY_STR
constexpr auto SUBSTATE_NOTREADY_STR
Definition: deviceConfig.hpp:99
fcf::devmgr::motor::MotorConfig::GetNumberOfNamedPositions
int GetNumberOfNamedPositions() const noexcept
Definition: motorConfig.hpp:365
configSet.hpp
configSet class header file.
fcf::devmgr::motor::Signal::LSTOP
@ LSTOP
fcf::devmgr::motor::MotorConfig::CFG_DEFVEL
@ CFG_DEFVEL
Definition: motorConfig.hpp:276
fcf::devmgr::common::SUBSTATE_INITIALISING_STR
constexpr auto SUBSTATE_INITIALISING_STR
Definition: deviceConfig.hpp:100
fcf::devmgr::common::SUBSTATE_NOTREADY
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:94
fcf::devmgr::motor::CI_AXIS_TYPE_CIRCULAR_OPT
constexpr int CI_AXIS_TYPE_CIRCULAR_OPT
Definition: motorConfig.hpp:81
fcf::devmgr::motor::MotorConfig::m_init_sequence
std::vector< InitAction > m_init_sequence
Definition: motorConfig.hpp:434
fcf::devmgr::motor::CI_STAT_ACTUAL_POSNAME
constexpr auto CI_STAT_ACTUAL_POSNAME
Definition: motorConfig.hpp:147
fcf::devmgr::motor::CI_INIT_ACTION_CALIB_SWITCH
constexpr auto CI_INIT_ACTION_CALIB_SWITCH
Definition: motorConfig.hpp:111
fcf::devmgr::motor::CI_STAT_ACTUAL_POS
constexpr auto CI_STAT_ACTUAL_POS
Definition: motorConfig.hpp:149
fcf::devmgr::motor::CI_STAT_ACTUAL_VEL
constexpr auto CI_STAT_ACTUAL_VEL
Definition: motorConfig.hpp:151
fcf::devmgr::motor::CI_TIMEOUT_MOVE
constexpr auto CI_TIMEOUT_MOVE
Definition: motorConfig.hpp:47
fcf::devmgr::common::SUBSTATE_INITIALISING
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:96
fcf::devmgr::motor::CI_ACTIVE_LOW_LHW
constexpr auto CI_ACTIVE_LOW_LHW
Definition: motorConfig.hpp:53
fcf::devmgr::motor::MotorConfig::CFG_ACTLOWLHW
@ CFG_ACTLOWLHW
Definition: motorConfig.hpp:290
fcf::devmgr::motor::MotorConfig::CFG_ACTLOWUHW
@ CFG_ACTLOWUHW
Definition: motorConfig.hpp:293
fcf::devmgr::motor::CI_ACTIVE_LOW_BRAKE
constexpr auto CI_ACTIVE_LOW_BRAKE
Definition: motorConfig.hpp:50
fcf::devmgr::motor::MotorConfig::GetNumberOfInitSteps
int GetNumberOfInitSteps() const noexcept
Get number of initialisations steps.
Definition: motorConfig.hpp:371
fcf::devmgr::motor::MotorConfig::CFG_ACTLOWLSTOP
@ CFG_ACTLOWLSTOP
Definition: motorConfig.hpp:289
fcf::devmgr::common::SUBSTATE_OP_ERROR
constexpr int SUBSTATE_OP_ERROR
Definition: deviceConfig.hpp:105
fcf::devmgr::motor::CI_INIT_ACTION_FIND_LHW
constexpr auto CI_INIT_ACTION_FIND_LHW
Definition: motorConfig.hpp:104
fcf::devmgr::motor::CI_LOCK_TOLERANCE
constexpr auto CI_LOCK_TOLERANCE
Definition: motorConfig.hpp:43
fcf::devmgr::motor::RPC_MOVE_ABS
constexpr auto RPC_MOVE_ABS
Definition: motorConfig.hpp:113
fcf::devmgr::motor::CI_STAT_AXIS_INFO_DATA_1
constexpr auto CI_STAT_AXIS_INFO_DATA_1
Definition: motorConfig.hpp:166
fcf::devmgr::motor::MotorConfig::CFG_EXECPOSTMOVE
@ CFG_EXECPOSTMOVE
Definition: motorConfig.hpp:298
fcf::devmgr::motor::CI_STAT_AXIS_ENABLE
constexpr auto CI_STAT_AXIS_ENABLE
Definition: motorConfig.hpp:160
fcf::devmgr::motor::AxisModeMap
const std::unordered_map< int, std::string > AxisModeMap
Definition: motorConfig.hpp:93
fcf::devmgr::motor::CI_STAT_SIGNAL_UHW
constexpr auto CI_STAT_SIGNAL_UHW
Definition: motorConfig.hpp:173
fcf::devmgr::motor::MotorConfig::CFG_AXISTYPE
@ CFG_AXISTYPE
Definition: motorConfig.hpp:275
fcf::devmgr::motor::SUBSTATE_OP_SETTING_POS
constexpr int SUBSTATE_OP_SETTING_POS
Definition: motorConfig.hpp:120
fcf::devmgr::motor::CI_INIT_ACTION_CALIB_REL
constexpr auto CI_INIT_ACTION_CALIB_REL
Definition: motorConfig.hpp:110
fcf::devmgr::common::SUBSTATE_OP_ERROR_STR
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:108
fcf::devmgr::motor::CI_INIT_VALUE_2
constexpr auto CI_INIT_VALUE_2
Definition: motorConfig.hpp:68
fcf::devmgr::motor::CI_EXEC_POST_INIT
constexpr auto CI_EXEC_POST_INIT
Definition: motorConfig.hpp:60
fcf::devmgr::motor::RPC_MOVE_REL
constexpr auto RPC_MOVE_REL
Definition: motorConfig.hpp:114
fcf::devmgr::motor::CI_STAT_AXIS_INPOS
constexpr auto CI_STAT_AXIS_INPOS
Definition: motorConfig.hpp:161
fcf::devmgr::motor::INIT_ACTION_FIND_REF_LE
@ INIT_ACTION_FIND_REF_LE
Definition: motorConfig.hpp:203
fcf::devmgr::motor::CI_STAT_AXIS_BRAKE
constexpr auto CI_STAT_AXIS_BRAKE
Definition: motorConfig.hpp:163
fcf::devmgr::motor::MotorConfig::GetNpTolerance
double GetNpTolerance() const
Get named position tolerance.
Definition: motorConfig.cpp:258
fcf::devmgr::motor::MotorConfig::FindNamedPositionValue
bool FindNamedPositionValue(const std::string named_pos, double &position) const
Find value associated to a named position.
Definition: motorConfig.cpp:188
fcf::devmgr::motor::MotorConfig::END_ENUM_MOTOR
@ END_ENUM_MOTOR
Definition: motorConfig.hpp:299
fcf::devmgr::motor::CI_INIT_ACTION_FIND_REF_UE
constexpr auto CI_INIT_ACTION_FIND_REF_UE
Definition: motorConfig.hpp:103
fcf::devmgr::common::SUBSTATE_ERROR
constexpr int SUBSTATE_ERROR
Definition: deviceConfig.hpp:97
fcf::devmgr::motor::FITS_PARAM_BRAKE
constexpr auto FITS_PARAM_BRAKE
Definition: motorConfig.hpp:186
fcf::devmgr::motor::InitAction::id
int id
Definition: motorConfig.hpp:252
fcf::devmgr::motor::CI_DEF_VEL
constexpr auto CI_DEF_VEL
Definition: motorConfig.hpp:36
fcf::devmgr::motor::SUBSTATE_READY_STR
constexpr auto SUBSTATE_READY_STR
Definition: motorConfig.hpp:123
fcf::devmgr::motor::MotorConfig::Init
virtual void Init()
Read the configuration.
Definition: motorConfig.cpp:47
fcf::devmgr::motor::MotorConfig::CFG_ACTLOWREF
@ CFG_ACTLOWREF
Definition: motorConfig.hpp:291
fcf::devmgr::motor::CI_STAT_TARGET_ENC
constexpr auto CI_STAT_TARGET_ENC
Definition: motorConfig.hpp:145
fcf::devmgr::motor::SUBSTATE_ABORTING_STR
constexpr auto SUBSTATE_ABORTING_STR
Definition: motorConfig.hpp:124
fcf::devmgr::motor::MotorConfig::~MotorConfig
virtual ~MotorConfig()=default
MotorConfig destructor.
fcf::devmgr::common::DeviceConfig
Device Configuration class.
Definition: deviceConfig.hpp:123
fcf::devmgr::motor::MotorConfig
Motor Configuration class.
Definition: motorConfig.hpp:268
fcf::devmgr::motor::MotorConfig::GetConfig
virtual void GetConfig(fcf::common::VectorVariant &params) const override
Obtain the list of configuration parameters.
Definition: motorConfig.cpp:101
fcf::devmgr::motor::CI_STAT_SIGNAL_LHW
constexpr auto CI_STAT_SIGNAL_LHW
Definition: motorConfig.hpp:170
fcf::devmgr::motor::CI_STAT_INITIALISED
constexpr auto CI_STAT_INITIALISED
Definition: motorConfig.hpp:156
fcf::devmgr::motor::MotorConfig::CFG_LOCKTOL
@ CFG_LOCKTOL
Definition: motorConfig.hpp:282
fcf::devmgr::motor::CI_AXIS_TYPE_LINEAR_STR
constexpr auto CI_AXIS_TYPE_LINEAR_STR
Definition: motorConfig.hpp:83
fcf::devmgr::motor::CI_ACTIVE_LOW_STOP
constexpr auto CI_ACTIVE_LOW_STOP
Definition: motorConfig.hpp:52
fcf::devmgr::common::SUBSTATE_READY_STR
constexpr auto SUBSTATE_READY_STR
Definition: deviceConfig.hpp:101
fcf::devmgr::motor::CI_INIT_ACTION
constexpr auto CI_INIT_ACTION
Definition: motorConfig.hpp:66
fcf::devmgr::common::SUBSTATE_READY
constexpr int SUBSTATE_READY
Definition: deviceConfig.hpp:95
fcf::devmgr::motor::INIT_ACTION_FIND_INDEX
@ INIT_ACTION_FIND_INDEX
Definition: motorConfig.hpp:202
fcf::devmgr::motor::CI_AXIS_MODE_INVEL
constexpr int CI_AXIS_MODE_INVEL
Definition: motorConfig.hpp:88
fcf::devmgr::motor::InitAction
Definition: motorConfig.hpp:251
fcf::devmgr::motor::INIT_ACTION_MOVE_ABS
@ INIT_ACTION_MOVE_ABS
Definition: motorConfig.hpp:208
fcf::devmgr::motor::CI_STAT_AXIS_INFO_DATA_2
constexpr auto CI_STAT_AXIS_INFO_DATA_2
Definition: motorConfig.hpp:167
fcf::devmgr::motor::CI_TIMEOUT_INIT
constexpr auto CI_TIMEOUT_INIT
Definition: motorConfig.hpp:46
fcf::devmgr::motor::CI_AXIS_MODE_INPOS
constexpr int CI_AXIS_MODE_INPOS
Definition: motorConfig.hpp:87
fcf::devmgr::motor::MotorConfig::GetNamedPositionValue
double GetNamedPositionValue(const int index) const
GetNamedPositionValue.
Definition: motorConfig.cpp:177
fcf::devmgr::motor::CI_ACTIVE_LOW_UHW
constexpr auto CI_ACTIVE_LOW_UHW
Definition: motorConfig.hpp:56
fcf::devmgr::motor::SUBSTATE_OP_SETTING_POS_STR
constexpr auto SUBSTATE_OP_SETTING_POS_STR
Definition: motorConfig.hpp:127
fcf::devmgr::motor::CI_MAX_INIT_STEPS
constexpr int CI_MAX_INIT_STEPS
Definition: motorConfig.hpp:98
fcf::devmgr::motor::MotorConfig::CFG_EXECPREINIT
@ CFG_EXECPREINIT
Definition: motorConfig.hpp:295
fcf::devmgr::motor::INIT_ACTION_CALIB_REL
@ INIT_ACTION_CALIB_REL
Definition: motorConfig.hpp:211
fcf::devmgr::motor::CI_STAT_SIGNAL_LSTOP
constexpr auto CI_STAT_SIGNAL_LSTOP
Definition: motorConfig.hpp:169
fcf::devmgr::motor::FITS_PARAM_LOCK
constexpr auto FITS_PARAM_LOCK
Definition: motorConfig.hpp:187
fcf::devmgr::motor::CI_INIT_ACTION_CALIB_ABS
constexpr auto CI_INIT_ACTION_CALIB_ABS
Definition: motorConfig.hpp:109
fcf::devmgr::motor::SUBSTATE_OP_STOPPING
constexpr int SUBSTATE_OP_STOPPING
Definition: motorConfig.hpp:121
fcf::devmgr::motor::InitActionsMap
const std::unordered_map< std::string, int > InitActionsMap
Definition: motorConfig.hpp:220
fcf::devmgr::motor::SUBSTATE_OP_STOPPING_STR
constexpr auto SUBSTATE_OP_STOPPING_STR
Definition: motorConfig.hpp:128
fcf::devmgr::common::SUBSTATE_ERROR_STR
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:102
fcf::devmgr::motor::CI_STAT_AXIS_STOP_POS
constexpr auto CI_STAT_AXIS_STOP_POS
Definition: motorConfig.hpp:165
fcf::devmgr::motor::CI_INIT_VALUE_1
constexpr auto CI_INIT_VALUE_1
Definition: motorConfig.hpp:67
fcf::devmgr::motor::CI_STAT_MODE
constexpr auto CI_STAT_MODE
Definition: motorConfig.hpp:155
fcf::devmgr::motor::MotorConfig::GetVelocity
double GetVelocity() const
Definition: motorConfig.cpp:142
fcf::devmgr::motor::CI_AXIS_TYPE_LINEAR
constexpr int CI_AXIS_TYPE_LINEAR
Definition: motorConfig.hpp:79
fcf::devmgr::motor::SUBSTATE_OP_STANDSTILL
constexpr int SUBSTATE_OP_STANDSTILL
Definition: motorConfig.hpp:118
fcf::devmgr::motor::SubstateMap
const std::unordered_map< short, std::string > SubstateMap
Definition: motorConfig.hpp:130
fcf::devmgr::motor::CI_TIMEOUT_SWITCH
constexpr auto CI_TIMEOUT_SWITCH
Definition: motorConfig.hpp:48
fcf::devmgr::motor::CI_NAME_POS_TOLERANCE
constexpr auto CI_NAME_POS_TOLERANCE
Definition: motorConfig.hpp:76