Go to the documentation of this file.
10 #ifndef FCF_DEVMGR_DEVICE_MOTOR_CONFIG_HPP
11 #define FCF_DEVMGR_DEVICE_MOTOR_CONFIG_HPP
15 #include <unordered_map>
18 #include <yaml-cpp/yaml.h>
20 #include <utils/bat/logger.hpp>
21 #include <fcf/common/iComm.hpp>
309 const std::string name);
344 virtual void GetConfig(fcf::common::VectorVariant& params)
const override;
357 std::string prefix)
const override;
413 double& position)
const;
422 std::string& name)
const;
438 double m_scale_factor;
440 double m_np_tolerance;
443 std::unordered_map<std::string, double> m_named_positions;
451 #endif //FCF_DEVMGR_DEVICE_MOTOR_CONFIG_H
constexpr auto SUBSTATE_OP_MOVING_STR
Definition: motorConfig.hpp:126
@ INIT_ACTION_MOVE_REL
Definition: motorConfig.hpp:209
@ CFG_LOCK
Definition: motorConfig.hpp:280
@ INIT_ACTION_FIND_UHW
Definition: motorConfig.hpp:206
constexpr auto CI_STAT_BACKLASH_STEP
Definition: motorConfig.hpp:154
constexpr auto CI_STAT_SIGNAL_USTOP
Definition: motorConfig.hpp:174
DataContext class header file.
double GetScaleFactor() const
Definition: motorConfig.cpp:160
std::string GetNamedPosition(const int index) const
GetNamedPosition.
Definition: motorConfig.cpp:164
constexpr auto CI_AXIS_TYPE_CIRCULAR_OPT_STR
Definition: motorConfig.hpp:85
constexpr auto CI_INIT_SEQUENCE
Definition: motorConfig.hpp:65
InitAction()
Definition: motorConfig.hpp:256
@ CFG_ACTLOWINDEX
Definition: motorConfig.hpp:292
double value2
Definition: motorConfig.hpp:254
const std::unordered_map< std::string, int > AxisTypeMap
Definition: motorConfig.hpp:194
constexpr auto CI_LOCK_POS
Definition: motorConfig.hpp:42
void SetScaleFactor(double scale)
Set Scale Factor.
Definition: motorConfig.cpp:154
@ INIT_ACTION_DELAY
Definition: motorConfig.hpp:207
constexpr auto CI_STAT_INIT_ACTION
Definition: motorConfig.hpp:158
constexpr auto CI_STAT_TARGET_POSNAME
Definition: motorConfig.hpp:146
constexpr auto CI_SCALE_FACTOR
Definition: motorConfig.hpp:77
constexpr auto CI_INIT_ACTION_FIND_INDEX
Definition: motorConfig.hpp:101
constexpr auto CI_STAT_INIT_STEP
Definition: motorConfig.hpp:157
MotorHwErrors header file.
constexpr auto CI_BACKLASH
Definition: motorConfig.hpp:34
@ CFG_ACTLOWUSTOP
Definition: motorConfig.hpp:294
constexpr auto CI_EXEC_PRE_INIT
Definition: motorConfig.hpp:59
constexpr auto FITS_PARAM_POSNAME
Definition: motorConfig.hpp:184
constexpr auto CI_STAT_POS_ERROR
Definition: motorConfig.hpp:150
m_logger(log4cplus::Logger::getInstance(LOGGER_NAME))
Definition: {{cookiecutter.device_name}}.cpp:32
constexpr auto CI_ACTIVE_LOW_INDEX
Definition: motorConfig.hpp:55
constexpr auto CI_ACTIVE_LOW_USTOP
Definition: motorConfig.hpp:57
constexpr auto CI_INIT_ACTION_DELAY
Definition: motorConfig.hpp:106
const std::unordered_map< int, std::string > InitActions2Map
Definition: motorConfig.hpp:236
constexpr auto CI_POSITIONS
Definition: motorConfig.hpp:73
constexpr auto CI_STAT_SIGNAL_INDEX
Definition: motorConfig.hpp:172
constexpr auto LOGGER_NAME
Definition: motorConfig.hpp:31
std::string const
Definition: test{{cookiecutter.device_name|capitalize()}}.cpp:162
constexpr auto CI_EXEC_POST_MOVE
Definition: motorConfig.hpp:62
double value1
Definition: motorConfig.hpp:253
constexpr auto RPC_MOVE_VEL
Definition: motorConfig.hpp:115
@ INIT_ACTION_END
Definition: motorConfig.hpp:201
@ INIT_ACTION_CALIB_SWITCH
Definition: motorConfig.hpp:212
DeviceConfig class header file.
constexpr int CI_AXIS_TYPE_CIRCULAR
Definition: motorConfig.hpp:80
constexpr auto CI_AXIS_MODE_INPOS_STR
Definition: motorConfig.hpp:90
constexpr int SUBSTATE_OP_MOVING
Definition: motorConfig.hpp:119
@ CFG_AUTODISABLE
Definition: motorConfig.hpp:283
@ INIT_ACTION_FIND_REF_UE
Definition: motorConfig.hpp:204
@ INIT_ACTION_FIND_LHW
Definition: motorConfig.hpp:205
@ INIT_ACTION_CALIB_ABS
Definition: motorConfig.hpp:210
constexpr auto CI_INITIALISATION
Definition: motorConfig.hpp:64
constexpr auto CI_AXIS_MODE_INVEL_STR
Definition: motorConfig.hpp:91
constexpr auto CI_EXEC_PRE_MOVE
Definition: motorConfig.hpp:61
@ CFG_SWITCHTOUT
Definition: motorConfig.hpp:286
constexpr auto CI_MIN_POS
Definition: motorConfig.hpp:38
constexpr auto CI_STAT_SIGNAL_REF
Definition: motorConfig.hpp:171
constexpr auto CI_STAT_TARGET_VEL
Definition: motorConfig.hpp:152
constexpr auto CI_STAT_AXIS_STOP_NEG
Definition: motorConfig.hpp:164
constexpr auto CI_ACTIVE_LOW_INPOS
Definition: motorConfig.hpp:51
constexpr auto CI_STAT_TARGET_POS
Definition: motorConfig.hpp:148
constexpr auto CI_STAT_AXIS_READY
Definition: motorConfig.hpp:159
constexpr int SUBSTATE_ABORTING
Definition: motorConfig.hpp:117
@ CFG_EXECPREMOVE
Definition: motorConfig.hpp:297
constexpr auto CI_INIT_ACTION_FIND_UHW
Definition: motorConfig.hpp:105
constexpr auto CI_STAT_SCALE_FACTOR
Definition: motorConfig.hpp:153
constexpr auto CI_DISABLE
Definition: motorConfig.hpp:44
constexpr auto CI_BRAKE
Definition: motorConfig.hpp:33
Signal
Definition: motorConfig.hpp:176
constexpr auto UndefinedNamedPos
Definition: motorConfig.hpp:190
constexpr auto CI_INIT_ACTION_FIND_REF_LE
Definition: motorConfig.hpp:102
constexpr auto CI_CHECK_INPOS
Definition: motorConfig.hpp:40
@ CFG_ACTLOWBRAKE
Definition: motorConfig.hpp:287
LampRpcErrors header file.
constexpr auto FITS_PARAM_POS
Definition: motorConfig.hpp:185
constexpr auto CI_INIT_ACTION_MOVE_REL
Definition: motorConfig.hpp:108
constexpr auto CI_MAX_POS
Definition: motorConfig.hpp:37
@ CFG_MINPOS
Definition: motorConfig.hpp:278
@ CFG_ACTLOWINPOS
Definition: motorConfig.hpp:288
constexpr auto CI_POS_NAME
Definition: motorConfig.hpp:74
virtual void GetConfigList(utils::bat::DbVector &cfg_list, std::string prefix) const override
Get configuration list.
Definition: motorConfig.cpp:220
@ CFG_BACKLASH
Definition: motorConfig.hpp:274
constexpr auto SUBSTATE_OP_STANDSTILL_STR
Definition: motorConfig.hpp:125
MotorConfig(const std::string filename, const std::string name)
MotorConfig constructor.
Definition: motorConfig.cpp:25
constexpr auto CI_POS_VALUE
Definition: motorConfig.hpp:75
@ CFG_INITTOUT
Definition: motorConfig.hpp:284
friend class Sensor
Definition: motorConfig.hpp:269
constexpr auto CI_INIT_ACTION_MOVE_ABS
Definition: motorConfig.hpp:107
constexpr auto CI_AXIS_TYPE_CIRCULAR_STR
Definition: motorConfig.hpp:84
constexpr auto CI_STAT_ENC_POS
Definition: motorConfig.hpp:144
constexpr auto CI_STAT_AXIS_LOCK
Definition: motorConfig.hpp:162
@ CFG_MOVETOUT
Definition: motorConfig.hpp:285
constexpr auto CI_INIT_ACTION_END
Definition: motorConfig.hpp:100
@ CFG_CHECKINPOS
Definition: motorConfig.hpp:279
constexpr auto CI_ACTIVE_LOW_REF
Definition: motorConfig.hpp:54
@ CFG_MAXPOS
Definition: motorConfig.hpp:277
@ CFG_BRAKE
Definition: motorConfig.hpp:273
constexpr auto CI_LOCK
Definition: motorConfig.hpp:41
@ CFG_LOCKPOS
Definition: motorConfig.hpp:281
@ CFG_EXECPOSTINIT
Definition: motorConfig.hpp:296
constexpr auto CI_AXIS_TYPE
Definition: motorConfig.hpp:35
constexpr auto SUBSTATE_NOTREADY_STR
Definition: deviceConfig.hpp:99
int GetNumberOfNamedPositions() const noexcept
Definition: motorConfig.hpp:365
configSet class header file.
@ CFG_DEFVEL
Definition: motorConfig.hpp:276
constexpr auto SUBSTATE_INITIALISING_STR
Definition: deviceConfig.hpp:100
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:94
constexpr int CI_AXIS_TYPE_CIRCULAR_OPT
Definition: motorConfig.hpp:81
std::vector< InitAction > m_init_sequence
Definition: motorConfig.hpp:434
constexpr auto CI_STAT_ACTUAL_POSNAME
Definition: motorConfig.hpp:147
constexpr auto CI_INIT_ACTION_CALIB_SWITCH
Definition: motorConfig.hpp:111
constexpr auto CI_STAT_ACTUAL_POS
Definition: motorConfig.hpp:149
constexpr auto CI_STAT_ACTUAL_VEL
Definition: motorConfig.hpp:151
constexpr auto CI_TIMEOUT_MOVE
Definition: motorConfig.hpp:47
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:96
constexpr auto CI_ACTIVE_LOW_LHW
Definition: motorConfig.hpp:53
@ CFG_ACTLOWLHW
Definition: motorConfig.hpp:290
@ CFG_ACTLOWUHW
Definition: motorConfig.hpp:293
constexpr auto CI_ACTIVE_LOW_BRAKE
Definition: motorConfig.hpp:50
int GetNumberOfInitSteps() const noexcept
Get number of initialisations steps.
Definition: motorConfig.hpp:371
@ CFG_ACTLOWLSTOP
Definition: motorConfig.hpp:289
constexpr int SUBSTATE_OP_ERROR
Definition: deviceConfig.hpp:105
constexpr auto CI_INIT_ACTION_FIND_LHW
Definition: motorConfig.hpp:104
constexpr auto CI_LOCK_TOLERANCE
Definition: motorConfig.hpp:43
constexpr auto RPC_MOVE_ABS
Definition: motorConfig.hpp:113
constexpr auto CI_STAT_AXIS_INFO_DATA_1
Definition: motorConfig.hpp:166
@ CFG_EXECPOSTMOVE
Definition: motorConfig.hpp:298
constexpr auto CI_STAT_AXIS_ENABLE
Definition: motorConfig.hpp:160
const std::unordered_map< int, std::string > AxisModeMap
Definition: motorConfig.hpp:93
constexpr auto CI_STAT_SIGNAL_UHW
Definition: motorConfig.hpp:173
@ CFG_AXISTYPE
Definition: motorConfig.hpp:275
constexpr int SUBSTATE_OP_SETTING_POS
Definition: motorConfig.hpp:120
constexpr auto CI_INIT_ACTION_CALIB_REL
Definition: motorConfig.hpp:110
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:108
constexpr auto CI_INIT_VALUE_2
Definition: motorConfig.hpp:68
constexpr auto CI_EXEC_POST_INIT
Definition: motorConfig.hpp:60
constexpr auto RPC_MOVE_REL
Definition: motorConfig.hpp:114
constexpr auto CI_STAT_AXIS_INPOS
Definition: motorConfig.hpp:161
@ INIT_ACTION_FIND_REF_LE
Definition: motorConfig.hpp:203
constexpr auto CI_STAT_AXIS_BRAKE
Definition: motorConfig.hpp:163
double GetNpTolerance() const
Get named position tolerance.
Definition: motorConfig.cpp:258
bool FindNamedPositionValue(const std::string named_pos, double &position) const
Find value associated to a named position.
Definition: motorConfig.cpp:188
@ END_ENUM_MOTOR
Definition: motorConfig.hpp:299
constexpr auto CI_INIT_ACTION_FIND_REF_UE
Definition: motorConfig.hpp:103
constexpr int SUBSTATE_ERROR
Definition: deviceConfig.hpp:97
constexpr auto FITS_PARAM_BRAKE
Definition: motorConfig.hpp:186
int id
Definition: motorConfig.hpp:252
constexpr auto CI_DEF_VEL
Definition: motorConfig.hpp:36
constexpr auto SUBSTATE_READY_STR
Definition: motorConfig.hpp:123
virtual void Init()
Read the configuration.
Definition: motorConfig.cpp:47
@ CFG_ACTLOWREF
Definition: motorConfig.hpp:291
constexpr auto CI_STAT_TARGET_ENC
Definition: motorConfig.hpp:145
constexpr auto SUBSTATE_ABORTING_STR
Definition: motorConfig.hpp:124
virtual ~MotorConfig()=default
MotorConfig destructor.
Device Configuration class.
Definition: deviceConfig.hpp:123
Motor Configuration class.
Definition: motorConfig.hpp:268
virtual void GetConfig(fcf::common::VectorVariant ¶ms) const override
Obtain the list of configuration parameters.
Definition: motorConfig.cpp:101
constexpr auto CI_STAT_SIGNAL_LHW
Definition: motorConfig.hpp:170
constexpr auto CI_STAT_INITIALISED
Definition: motorConfig.hpp:156
@ CFG_LOCKTOL
Definition: motorConfig.hpp:282
constexpr auto CI_AXIS_TYPE_LINEAR_STR
Definition: motorConfig.hpp:83
constexpr auto CI_ACTIVE_LOW_STOP
Definition: motorConfig.hpp:52
constexpr auto SUBSTATE_READY_STR
Definition: deviceConfig.hpp:101
constexpr auto CI_INIT_ACTION
Definition: motorConfig.hpp:66
constexpr int SUBSTATE_READY
Definition: deviceConfig.hpp:95
@ INIT_ACTION_FIND_INDEX
Definition: motorConfig.hpp:202
constexpr int CI_AXIS_MODE_INVEL
Definition: motorConfig.hpp:88
Definition: motorConfig.hpp:251
@ INIT_ACTION_MOVE_ABS
Definition: motorConfig.hpp:208
constexpr auto CI_STAT_AXIS_INFO_DATA_2
Definition: motorConfig.hpp:167
constexpr auto CI_TIMEOUT_INIT
Definition: motorConfig.hpp:46
constexpr int CI_AXIS_MODE_INPOS
Definition: motorConfig.hpp:87
double GetNamedPositionValue(const int index) const
GetNamedPositionValue.
Definition: motorConfig.cpp:177
constexpr auto CI_ACTIVE_LOW_UHW
Definition: motorConfig.hpp:56
constexpr auto SUBSTATE_OP_SETTING_POS_STR
Definition: motorConfig.hpp:127
constexpr int CI_MAX_INIT_STEPS
Definition: motorConfig.hpp:98
@ CFG_EXECPREINIT
Definition: motorConfig.hpp:295
@ INIT_ACTION_CALIB_REL
Definition: motorConfig.hpp:211
constexpr auto CI_STAT_SIGNAL_LSTOP
Definition: motorConfig.hpp:169
constexpr auto FITS_PARAM_LOCK
Definition: motorConfig.hpp:187
constexpr auto CI_INIT_ACTION_CALIB_ABS
Definition: motorConfig.hpp:109
constexpr int SUBSTATE_OP_STOPPING
Definition: motorConfig.hpp:121
const std::unordered_map< std::string, int > InitActionsMap
Definition: motorConfig.hpp:220
constexpr auto SUBSTATE_OP_STOPPING_STR
Definition: motorConfig.hpp:128
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:102
constexpr auto CI_STAT_AXIS_STOP_POS
Definition: motorConfig.hpp:165
constexpr auto CI_INIT_VALUE_1
Definition: motorConfig.hpp:67
constexpr auto CI_STAT_MODE
Definition: motorConfig.hpp:155
double GetVelocity() const
Definition: motorConfig.cpp:142
constexpr int CI_AXIS_TYPE_LINEAR
Definition: motorConfig.hpp:79
constexpr int SUBSTATE_OP_STANDSTILL
Definition: motorConfig.hpp:118
const std::unordered_map< short, std::string > SubstateMap
Definition: motorConfig.hpp:130
constexpr auto CI_TIMEOUT_SWITCH
Definition: motorConfig.hpp:48
constexpr auto CI_NAME_POS_TOLERANCE
Definition: motorConfig.hpp:76