ifw-fcf  3.0.0
Public Member Functions | Protected Attributes | List of all members
fcf::devmgr::adc::AdcConfig Class Reference

adc Configuration class More...

#include <adcConfig.hpp>

Inheritance diagram for fcf::devmgr::adc::AdcConfig:
fcf::devmgr::common::DeviceConfig fcf::devmgr::common::IDeviceConfig testAdc::MyDeviceConfig testAdcConfig::MyDeviceConfig testAdcLcsIf::TestAdcConfig

Public Member Functions

 AdcConfig (const std::string filename, const std::string name)
 DeviceConfig constructor. More...
 
 AdcConfig (const std::string name)
 DeviceConfig constructor. More...
 
virtual ~AdcConfig ()
 DeviceConfig destructor. More...
 
void InitConfig ()
 Define configuration parameters for adc device. More...
 
virtual void ReadConfig ()
 Read the configuration. More...
 
virtual void GetConfig (fcf::common::VectorVariant &params)
 Obtain the list of configuration parameters. More...
 
virtual void GetMotorConfig (fcf::common::VectorVariant &params)
 Obtain the list of ADC motor configuration parameters. More...
 
virtual void GetMotorConfig (const std::string motor, fcf::common::VectorVariant &params)
 
virtual void SetScaleFactor (const std::string motor, double scale_factor)
 
virtual void GetConfigList (std::vector< std::string > &cfg_list, std::string prefix)
 Get configuration list. More...
 
virtual std::string GetMotorMapFile ()
 
virtual std::string GetMotorType ()
 
virtual std::string GetMotorPrefix (const std::string motor)
 
void GetMotorNames (std::vector< std::string > &motor_names)
 
void GetMotorPrefixes (std::vector< std::string > &motor_prefixes)
 
double GetMotorVelocity (const int axis_num)
 
double GetMotorScaleFactor (const int axis_num)
 
double GetMotorScaleFactor (const std::string motor_name)
 
std::string GetMotorName (const std::string nodeid)
 
- Public Member Functions inherited from fcf::devmgr::common::DeviceConfig
 DeviceConfig (const std::string &filename, const std::string &name)
 DeviceConfig constructor. More...
 
 DeviceConfig (const std::string &name)
 DeviceConfig constructor. More...
 
virtual ~DeviceConfig ()
 DeviceConfig destructor. More...
 
bool Init ()
 Initialises a device. More...
 
void InitFromString (std::string config)
 Init the internal configuration from a string. More...
 
void InitFromFile (const std::string &filename)
 Init the internal configuration from a given file. More...
 
void CheckConfig ()
 Verify Configuration Data. More...
 
std::string GetIdentifier ()
 
std::string GetPrefix ()
 
std::string GetAddress ()
 
std::string GetSimAddress ()
 
std::string GetFitsPrefix ()
 Get Fits Prefix. More...
 
std::string GetType ()
 
int GetNamespace ()
 
std::string GetAlias ()
 
std::string GetName ()
 
std::string GetNodeId (const std::string &attrib)
 Get node id. More...
 
std::string GetProcId (const std::string &attrib)
 Get procedure id. More...
 
std::string GetObjId ()
 Get object id. More...
 
std::string GetCfgFile ()
 GetCfgFile. More...
 
std::string GetCfgAsString ()
 GetCfgAsString. More...
 
virtual void SetSimulateFlag (bool flag)
 Set simulation flag. More...
 
virtual void SetIgnoreFlag (bool flag)
 Set ignore flag. More...
 
virtual bool GetIgnored ()
 Get ignored flag. More...
 
virtual bool GetSimulated ()
 Get simulated flag. More...
 
virtual std::string GetMapFile ()
 Get name of the device mapping file. More...
 

Protected Attributes

fcf::devmgr::common::MapCfgBool m_map_cfg_bool
 
fcf::devmgr::common::MapCfgInt m_map_cfg_int
 
fcf::devmgr::common::MapCfgUInt m_map_cfg_uint
 
fcf::devmgr::common::MapCfgDouble m_map_cfg_double
 
int m_num_axis
 
std::map< std::string, std::unique_ptr< fcf::devmgr::motor::MotorConfig > > m_motor_config_map
 Maps of ADC axes configuration. More...
 
std::map< std::string, std::string > m_motor_prefix_map
 
- Protected Attributes inherited from fcf::devmgr::common::DeviceConfig
MapCfgBool m_map_cfg_bool
 
MapCfgShort m_map_cfg_short
 
MapCfgInt m_map_cfg_int
 
MapCfgUInt m_map_cfg_uint
 
MapCfgDouble m_map_cfg_double
 
std::string m_filename
 filename of device configuration file More...
 
std::string m_name
 device identifier More...
 
YAML::Node m_config_node
 YAML node object for configuration file. More...
 
std::string m_identifier
 Address space identifier. More...
 
std::string m_type
 Device type. More...
 
std::string m_fits_prefix
 
bool m_simulated
 
bool m_ignored
 
std::string m_lcs_prefix
 
std::string m_address
 
std::string m_sim_address
 
std::string m_map_file
 
std::string m_alias
 
int m_lcs_namespace
 

Detailed Description

adc Configuration class

This class manages the configuration of a adc. It reads the configuration file and provides the methods to obtain the parameters used by the auxiliary classes.

Constructor & Destructor Documentation

◆ AdcConfig() [1/2]

fcf::devmgr::adc::AdcConfig::AdcConfig ( const std::string  filename,
const std::string  name 
)

DeviceConfig constructor.

Parameters
[in]filenamefilename of the device configuration file.
[in]nameDevice identifier.

◆ AdcConfig() [2/2]

fcf::devmgr::adc::AdcConfig::AdcConfig ( const std::string  name)

DeviceConfig constructor.

Parameters
[in]nameDevice identifier.

◆ ~AdcConfig()

fcf::devmgr::adc::AdcConfig::~AdcConfig ( )
virtual

DeviceConfig destructor.

Member Function Documentation

◆ GetConfig()

void fcf::devmgr::adc::AdcConfig::GetConfig ( fcf::common::VectorVariant &  params)
virtual

Obtain the list of configuration parameters.

Parameters
[in,out]paramsoutput vector with the list of config parameters

This methods prepare a vector with all the configuration parameters of a adc with the purpose to write it into the controller.

Reimplemented from fcf::devmgr::common::DeviceConfig.

Reimplemented in testAdcConfig::MyDeviceConfig, and testAdc::MyDeviceConfig.

◆ GetConfigList()

void fcf::devmgr::adc::AdcConfig::GetConfigList ( std::vector< std::string > &  cfg_list,
std::string  prefix 
)
virtual

Get configuration list.

Parameters
cfg_listList of all configuration parameters.
prefixPrefix to be added to the attributes names.

This method returs the complete of configuration parameters handled by this class. This method is used to dump the list into the DB.

Reimplemented from fcf::devmgr::common::DeviceConfig.

◆ GetMotorConfig() [1/2]

void fcf::devmgr::adc::AdcConfig::GetMotorConfig ( const std::string  motor,
fcf::common::VectorVariant &  params 
)
virtual

◆ GetMotorConfig() [2/2]

void fcf::devmgr::adc::AdcConfig::GetMotorConfig ( fcf::common::VectorVariant &  params)
virtual

Obtain the list of ADC motor configuration parameters.

Parameters
[in,out]paramsoutput vector with the list of ADC motor config parameters

This methods prepare a vector with all ADC motor configuration parameters. These parameters have to be handled separately from the ADC normal configuration because they use a different mapping file.

◆ GetMotorMapFile()

string fcf::devmgr::adc::AdcConfig::GetMotorMapFile ( )
virtual
Returns
mapping file

◆ GetMotorName()

std::string fcf::devmgr::adc::AdcConfig::GetMotorName ( const std::string  nodeid)

◆ GetMotorNames()

void fcf::devmgr::adc::AdcConfig::GetMotorNames ( std::vector< std::string > &  motor_names)

◆ GetMotorPrefix()

std::string fcf::devmgr::adc::AdcConfig::GetMotorPrefix ( const std::string  motor)
virtual
Returns
ADC motor prefix

◆ GetMotorPrefixes()

void fcf::devmgr::adc::AdcConfig::GetMotorPrefixes ( std::vector< std::string > &  motor_prefixes)

◆ GetMotorScaleFactor() [1/2]

double fcf::devmgr::adc::AdcConfig::GetMotorScaleFactor ( const int  axis_num)

◆ GetMotorScaleFactor() [2/2]

double fcf::devmgr::adc::AdcConfig::GetMotorScaleFactor ( const std::string  motor_name)

◆ GetMotorType()

string fcf::devmgr::adc::AdcConfig::GetMotorType ( )
virtual
Returns
ADC motor type

◆ GetMotorVelocity()

double fcf::devmgr::adc::AdcConfig::GetMotorVelocity ( const int  axis_num)

◆ InitConfig()

void fcf::devmgr::adc::AdcConfig::InitConfig ( )

Define configuration parameters for adc device.

◆ ReadConfig()

void fcf::devmgr::adc::AdcConfig::ReadConfig ( )
virtual

Read the configuration.

This reads the adc configuration attributes in memory and check the presence of all attributes that are mandatory.

Exceptions
std::runtime_errorin case of an error

Reimplemented from fcf::devmgr::common::DeviceConfig.

Reimplemented in testAdcConfig::MyDeviceConfig, and testAdc::MyDeviceConfig.

◆ SetScaleFactor()

void fcf::devmgr::adc::AdcConfig::SetScaleFactor ( const std::string  motor,
double  scale_factor 
)
virtual

Member Data Documentation

◆ m_map_cfg_bool

fcf::devmgr::common::MapCfgBool fcf::devmgr::adc::AdcConfig::m_map_cfg_bool
protected

◆ m_map_cfg_double

fcf::devmgr::common::MapCfgDouble fcf::devmgr::adc::AdcConfig::m_map_cfg_double
protected

◆ m_map_cfg_int

fcf::devmgr::common::MapCfgInt fcf::devmgr::adc::AdcConfig::m_map_cfg_int
protected

◆ m_map_cfg_uint

fcf::devmgr::common::MapCfgUInt fcf::devmgr::adc::AdcConfig::m_map_cfg_uint
protected

◆ m_motor_config_map

std::map<std::string, std::unique_ptr<fcf::devmgr::motor::MotorConfig> > fcf::devmgr::adc::AdcConfig::m_motor_config_map
protected

Maps of ADC axes configuration.

◆ m_motor_prefix_map

std::map<std::string, std::string> fcf::devmgr::adc::AdcConfig::m_motor_prefix_map
protected

Map between motor prefix and motor name This is needed to map the correct motor name when receiving OPCUA events.

◆ m_num_axis

int fcf::devmgr::adc::AdcConfig::m_num_axis
protected

The documentation for this class was generated from the following files: