10 #ifndef DEVMGR_DEVICE_MOTOR_CONFIG_HPP
11 #define DEVMGR_DEVICE_MOTOR_CONFIG_HPP
15 #include <unordered_map>
18 #include <yaml-cpp/yaml.h>
20 #include <fcf/common/iComm.hpp>
21 #include <devmgr/common/deviceConfig.hpp>
22 #include <devmgr/common/configSet.hpp>
23 #include <devmgr/common/dataContext.hpp>
24 #include <devmgr/devices/motorRpcErrors.hpp>
25 #include <devmgr/devices/motorHwErrors.hpp>
32 const std::string
CI_BRAKE =
"brake";
40 const std::string
CI_LOCK =
"lock";
91 const std::unordered_map<int, std::string>
AxisModeMap = {
141 const std::unordered_map<short, std::string>
SubstateMap = {
255 const std::unordered_map<std::string, int>
AxisTypeMap = {
370 const std::string
name);
395 virtual void GetConfig(fcf::common::VectorVariant& params);
412 virtual void GetConfigList(std::vector<std::string>& cfg_list,
492 double m_scale_factor;
494 double m_np_tolerance ;
497 std::unordered_map<std::string, double> m_named_positions;
500 std::unordered_map<int, InitAction> m_init_sequence_map;
507 #endif //DEVMGR_DEVICE_MOTOR_CONFIG_H
const std::string CI_STAT_SIGNAL_REF
Definition: motorConfig.hpp:182
Definition: motorConfig.hpp:264
optional bool index
Definition: topics.proto:34
const std::string UndefinedNamedPos
Definition: motorConfig.hpp:201
const std::string CI_LOCK_TOLERANCE
Definition: motorConfig.hpp:42
MotorConfig(const std::string filename, const std::string name)
MotorConfig constructor.
Definition: motorConfig.cpp:26
const std::string CI_STAT_TARGET_POSNAME
Definition: motorConfig.hpp:157
const std::unordered_map< short, std::string > SubstateMap
Definition: motorConfig.hpp:141
const std::string RPC_STOP
Definition: deviceConfig.hpp:45
const std::string RPC_MOVE_ABS
Definition: motorConfig.hpp:112
const std::string CI_SCALE_FACTOR
Definition: motorConfig.hpp:75
const std::string SUBSTATE_READY_STR
Definition: motorConfig.hpp:131
const short SUBSTATE_OP_SETTING_POS
Definition: motorConfig.hpp:125
const std::string CI_STAT_MODE
Definition: motorConfig.hpp:166
const std::unordered_map< std::string, int > InitActionsMap
Definition: motorConfig.hpp:281
Definition: motorConfig.hpp:273
const std::string CI_DEF_VEL
Definition: motorConfig.hpp:35
const std::string CI_TIMEOUT_SWITCH
Definition: motorConfig.hpp:47
const std::vector< std::string > statMapping
Definition: motorConfig.hpp:217
const std::string CI_STAT_AXIS_ENABLE
Definition: motorConfig.hpp:171
double value2
Definition: motorConfig.hpp:315
const std::string CI_BACKLASH
Definition: motorConfig.hpp:33
const std::string CI_DISABLE
Definition: motorConfig.hpp:43
const std::string CI_INIT_ACTION_CALIB_REL
Definition: motorConfig.hpp:108
const std::string CI_ACTIVE_LOW_STOP
Definition: motorConfig.hpp:51
std::map< int, CfgBool > MapCfgBool
Definition: deviceConfig.hpp:104
const std::string CI_INIT_ACTION_END
Definition: motorConfig.hpp:98
const int CI_MAX_INIT_STEPS
Definition: motorConfig.hpp:96
const std::string RPC_DISABLE
Definition: deviceConfig.hpp:44
const std::string CI_ACTIVE_LOW_LHW
Definition: motorConfig.hpp:52
const std::string CI_STAT_AXIS_INFO_DATA_1
Definition: motorConfig.hpp:177
Signal
Definition: motorConfig.hpp:187
const std::string CI_STAT_ERROR_CODE
Definition: deviceConfig.hpp:53
devmgr::common::MapCfgInt m_map_cfg_int
Map for {{cookiecutter.device_name}} integer parameters.
Definition: {{cookiecutter.device_name}}Config.hpp:132
const std::string CI_STAT_SIGNAL_LHW
Definition: motorConfig.hpp:181
const std::string CI_AXIS_TYPE_CIRCULAR_OPT_STR
Definition: motorConfig.hpp:83
Definition: motorConfig.hpp:265
Definition: motorConfig.hpp:269
const std::string CI_INIT_ACTION_DELAY
Definition: motorConfig.hpp:104
const short SUBSTATE_READY
Definition: motorConfig.hpp:119
const std::string CI_STAT_SUBSTATE
Definition: deviceConfig.hpp:49
const short SUBSTATE_OP_MOVING
Definition: motorConfig.hpp:124
void SetScaleFactor(double scale)
Set Scale Factor.
Definition: motorConfig.cpp:296
const std::string CI_POS_NAMES
Definition: motorConfig.hpp:73
double GetVelocity()
Definition: motorConfig.cpp:285
const std::string CI_BRAKE
Definition: motorConfig.hpp:32
InitAction()
Definition: motorConfig.hpp:317
const short SUBSTATE_OP_STOPPING
Definition: motorConfig.hpp:126
const std::string CI_EXEC_POST_INIT
Definition: motorConfig.hpp:59
const std::string CI_STAT_AXIS_INFO_DATA_2
Definition: motorConfig.hpp:178
const std::string CI_INIT_ACTION_FIND_REF_UE
Definition: motorConfig.hpp:101
Definition: motorConfig.hpp:262
const std::string CI_AXIS_MODE_INVEL_STR
Definition: motorConfig.hpp:89
virtual void ReadConfig()
Read the configuration.
Definition: motorConfig.cpp:88
virtual ~MotorConfig()
MotorConfig destructor.
Definition: motorConfig.cpp:84
const std::string CI_STAT_AXIS_INPOS
Definition: motorConfig.hpp:172
virtual void GetConfig(fcf::common::VectorVariant ¶ms)
Obtain the list of configuration parameters.
Definition: motorConfig.cpp:223
const std::string CI_LOCK
Definition: motorConfig.hpp:40
Definition: motorConfig.hpp:270
const std::string CI_POSITIONS
Definition: motorConfig.hpp:72
const std::string CI_INIT_SEQUENCE
Definition: motorConfig.hpp:64
const int CI_AXIS_TYPE_CIRCULAR_OPT
Definition: motorConfig.hpp:79
const std::string CI_INIT_ACTION
Definition: motorConfig.hpp:65
devmgr::common::MapCfgBool m_map_cfg_bool
Map for {{cookiecutter.device_name}} boolean paramaters.
Definition: {{cookiecutter.device_name}}Config.hpp:131
const std::string CI_INITIALISATION
Definition: motorConfig.hpp:63
Device Configuration class.
Definition: deviceConfig.hpp:116
const std::string RPC_INIT
Definition: deviceConfig.hpp:42
const std::string CI_AXIS_TYPE_LINEAR_STR
Definition: motorConfig.hpp:81
const std::string CI_AXIS_MODE_INPOS_STR
Definition: motorConfig.hpp:88
const std::string CI_ACTIVE_LOW_INPOS
Definition: motorConfig.hpp:50
const std::string CI_STAT_TARGET_POS
Definition: motorConfig.hpp:159
const std::string CI_EXEC_POST_MOVE
Definition: motorConfig.hpp:61
const std::string RPC_MOVE_REL
Definition: motorConfig.hpp:113
friend class Sensor
Definition: motorConfig.hpp:330
const std::string SUBSTATE_OP_STANDSTILL_STR
Definition: motorConfig.hpp:135
const short SUBSTATE_NOTREADY
Definition: motorConfig.hpp:117
const std::string SUBSTATE_INITIALISING_STR
Definition: motorConfig.hpp:130
const std::string CI_STAT_SIGNAL_LSTOP
Definition: motorConfig.hpp:180
const short SUBSTATE_ABORTING
Definition: motorConfig.hpp:121
double GetScaleFactor() const
Definition: motorConfig.cpp:302
const std::string FITS_PARAM_BRAKE
Definition: motorConfig.hpp:197
Definition: motorConfig.hpp:272
const std::string CI_STAT_TARGET_ENC
Definition: motorConfig.hpp:156
const std::string CI_INIT_ACTION_FIND_LHW
Definition: motorConfig.hpp:102
Definition: motorConfig.hpp:271
const std::string CI_INIT_ACTION_MOVE_REL
Definition: motorConfig.hpp:106
const std::string RPC_RESET
Definition: deviceConfig.hpp:46
const std::string CI_STAT_SIGNAL_INDEX
Definition: motorConfig.hpp:183
const std::string CI_NAME_POS_TOLERANCE
Definition: motorConfig.hpp:74
const std::string CI_TIMEOUT_INIT
Definition: motorConfig.hpp:45
virtual void GetConfigList(std::vector< std::string > &cfg_list, std::string prefix)
Get configuration list.
Definition: motorConfig.cpp:382
Definition: motorConfig.hpp:268
const std::string CI_INIT_VALUE_1
Definition: motorConfig.hpp:66
std::map< int, CfgInt > MapCfgInt
Definition: deviceConfig.hpp:105
double value1
Definition: motorConfig.hpp:314
const std::string CI_STAT_ACTUAL_POSNAME
Definition: motorConfig.hpp:158
const short SUBSTATE_OP_STANDSTILL
Definition: motorConfig.hpp:123
const std::string CI_INIT_ACTION_CALIB_ABS
Definition: motorConfig.hpp:107
int GetNumberOfNamedPositions()
Definition: motorConfig.cpp:451
devmgr::common::MapCfgUInt m_map_cfg_uint
Map for {{cookiecutter.device_name}} unsigned int parameters.
Definition: {{cookiecutter.device_name}}Config.hpp:133
const std::string CI_INIT_ACTION_MOVE_ABS
Definition: motorConfig.hpp:105
const std::string SUBSTATE_NOTREADY_STR
Definition: motorConfig.hpp:129
Definition: motorConfig.hpp:266
const std::string CI_CHECK_INPOS
Definition: motorConfig.hpp:39
const std::string CI_STAT_INIT_ACTION
Definition: motorConfig.hpp:169
int id
Definition: motorConfig.hpp:313
const std::string CI_STAT_LOCAL
Definition: deviceConfig.hpp:52
const std::unordered_map< std::string, int > AxisTypeMap
Definition: motorConfig.hpp:255
const std::string CI_STAT_POS_ERROR
Definition: motorConfig.hpp:161
const std::string CI_STAT_ACTUAL_POS
Definition: motorConfig.hpp:160
const short SUBSTATE_OP_FAILURE
Definition: motorConfig.hpp:127
bool FindNamedPositionValue(const std::string named_pos, double &position)
Find value associated to a named position.
Definition: motorConfig.cpp:350
const std::vector< std::string > cfgMapping
Definition: motorConfig.hpp:203
const std::string CI_STAT_BACKLASH_STEP
Definition: motorConfig.hpp:165
const std::string FITS_PARAM_LOCK
Definition: motorConfig.hpp:198
const int CI_AXIS_TYPE_LINEAR
Definition: motorConfig.hpp:77
const std::string CI_AXIS_TYPE
Definition: motorConfig.hpp:34
const std::string CI_ACTIVE_LOW_USTOP
Definition: motorConfig.hpp:56
const std::string CI_TIMEOUT_MOVE
Definition: motorConfig.hpp:46
const std::string CI_STAT_AXIS_STOP_POS
Definition: motorConfig.hpp:176
const std::string FITS_PARAM_POS
Definition: motorConfig.hpp:196
const short SUBSTATE_FAILURE
Definition: motorConfig.hpp:120
const std::string CI_ACTIVE_LOW_BRAKE
Definition: motorConfig.hpp:49
const std::string SUBSTATE_OP_STOPPING_STR
Definition: motorConfig.hpp:138
const std::string FITS_PARAM_POSNAME
Definition: motorConfig.hpp:195
const std::string CI_STAT_INIT_STEP
Definition: motorConfig.hpp:168
const std::string CI_INIT_ACTION_CALIB_SWITCH
Definition: motorConfig.hpp:109
const std::string SUBSTATE_FAILURE_STR
Definition: motorConfig.hpp:132
const std::string CI_INIT_VALUE_2
Definition: motorConfig.hpp:67
const std::string SUBSTATE_OP_FAILURE_STR
Definition: motorConfig.hpp:139
const std::string CI_STAT_INITIALISED
Definition: motorConfig.hpp:167
const std::string CI_STAT_AXIS_BRAKE
Definition: motorConfig.hpp:174
const int CI_AXIS_TYPE_CIRCULAR
Definition: motorConfig.hpp:78
const std::string CI_ACTIVE_LOW_INDEX
Definition: motorConfig.hpp:54
std::map< int, CfgUInt > MapCfgUInt
Definition: deviceConfig.hpp:106
const std::string CI_STAT_ACTUAL_VEL
Definition: motorConfig.hpp:162
const std::string SUBSTATE_OP_MOVING_STR
Definition: motorConfig.hpp:136
const std::string RPC_MOVE_VEL
Definition: motorConfig.hpp:114
const std::string CI_INIT_ACTION_FIND_INDEX
Definition: motorConfig.hpp:99
Definition: motorConfig.hpp:267
const std::string CI_ACTIVE_LOW_UHW
Definition: motorConfig.hpp:55
const std::string CI_ACTIVE_LOW_REF
Definition: motorConfig.hpp:53
const std::string SUBSTATE_ABORTING_STR
Definition: motorConfig.hpp:133
const std::string CI_STAT_AXIS_LOCK
Definition: motorConfig.hpp:173
const std::string CI_STAT_SCALE_FACTOR
Definition: motorConfig.hpp:164
const std::string CI_STAT_STATE
Definition: deviceConfig.hpp:50
const std::string CI_EXEC_PRE_INIT
Definition: motorConfig.hpp:58
const std::string CI_LOCK_POS
Definition: motorConfig.hpp:41
const std::vector< std::string > rpcMapping
Definition: motorConfig.hpp:243
const std::string CI_STAT_SIGNAL_UHW
Definition: motorConfig.hpp:184
const std::string GetNamedPosition(const int index)
GetNamedPosition.
Definition: motorConfig.cpp:314
const std::string CI_AXIS_TYPE_CIRCULAR_STR
Definition: motorConfig.hpp:82
const std::string RPC_ENABLE
Definition: deviceConfig.hpp:43
const int CI_AXIS_MODE_INVEL
Definition: motorConfig.hpp:86
const std::unordered_map< int, std::string > InitActions2Map
Definition: motorConfig.hpp:297
const std::string CI_EXEC_PRE_MOVE
Definition: motorConfig.hpp:60
std::map< int, CfgDouble > MapCfgDouble
Definition: deviceConfig.hpp:107
const std::string CI_MIN_POS
Definition: motorConfig.hpp:37
const std::string CI_STAT_SIGNAL_USTOP
Definition: motorConfig.hpp:185
const std::string CI_INIT_ACTION_FIND_UHW
Definition: motorConfig.hpp:103
const std::string CI_MAX_POS
Definition: motorConfig.hpp:36
Definition: motorConfig.hpp:263
const std::unordered_map< int, std::string > AxisModeMap
Definition: motorConfig.hpp:91
const std::string CI_STAT_AXIS_STOP_NEG
Definition: motorConfig.hpp:175
const std::string CI_STAT_AXIS_READY
Definition: motorConfig.hpp:170
optional string name
Definition: topics.proto:50
const short SUBSTATE_INITIALISING
Definition: motorConfig.hpp:118
const std::string CI_INIT_ACTION_FIND_REF_LE
Definition: motorConfig.hpp:100
const std::string CI_STAT_ENC_POS
Definition: motorConfig.hpp:155
const std::string SUBSTATE_OP_SETTING_POS_STR
Definition: motorConfig.hpp:137
const int CI_AXIS_MODE_INPOS
Definition: motorConfig.hpp:85
const std::string CI_STAT_TARGET_VEL
Definition: motorConfig.hpp:163
double GetNpTolerance() const
Get named position tolerance.
Definition: motorConfig.cpp:456
const double GetNamedPositionValue(const std::string named_pos)
GetNamedPositionValue.
Definition: motorConfig.cpp:329
virtual std::string GetMapFile()
Definition: motorConfig.cpp:306