ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
fcf::devmgr::common::DeviceConfig Class Reference

Device Configuration class. More...

#include <deviceConfig.hpp>

Inheritance diagram for fcf::devmgr::common::DeviceConfig:
fcf::devmgr::common::IDeviceConfig fcf::devmgr::actuator::ActuatorConfig fcf::devmgr::adc::AdcConfig fcf::devmgr::lamp::LampConfig fcf::devmgr::motor::MotorConfig fcf::devmgr::piezo::PiezoConfig fcf::devmgr::sensor::SensorConfig fcf::devmgr::shutter::ShutterConfig MyDeviceConfig MyDeviceConfig testDeviceFacade::MyDeviceConfig testDeviceLcsIf::MyDeviceConfig

Public Member Functions

 DeviceConfig (const std::string &filename, const std::string &name)
 DeviceConfig constructor. More...
 
virtual ~DeviceConfig ()
 DeviceConfig destructor. More...
 
bool Init ()
 Initialises a device. More...
 
virtual void ReadConfig ()
 Read the configuration. More...
 
virtual void GetConfig (fcf::common::VectorVariant &params)
 Obtain the list of configuration parameters. 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...
 
virtual void GetConfigList (std::vector< std::string > &cfg_list, std::string prefix)
 Get configuration list. More...
 
std::string GetCfgFile ()
 GetCfgFile. 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

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

Device Configuration class.

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

Constructor & Destructor Documentation

fcf::devmgr::common::DeviceConfig::DeviceConfig ( const std::string &  filename,
const std::string &  name 
)

DeviceConfig constructor.

Parameters
[in]filenamefilename of the device configuration file.
[in]nameDevice identifier.
fcf::devmgr::common::DeviceConfig::~DeviceConfig ( )
virtual

DeviceConfig destructor.

Member Function Documentation

std::string fcf::devmgr::common::DeviceConfig::GetAddress ( )
virtual
Returns
device address

Implements fcf::devmgr::common::IDeviceConfig.

std::string fcf::devmgr::common::DeviceConfig::GetAlias ( )
virtual
Returns
namespace

Implements fcf::devmgr::common::IDeviceConfig.

std::string fcf::devmgr::common::DeviceConfig::GetCfgFile ( )

GetCfgFile.

Returns
void fcf::devmgr::common::DeviceConfig::GetConfig ( fcf::common::VectorVariant &  params)
virtual
void fcf::devmgr::common::DeviceConfig::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 in fcf::devmgr::motor::MotorConfig, fcf::devmgr::adc::AdcConfig, and fcf::devmgr::sensor::SensorConfig.

std::string fcf::devmgr::common::DeviceConfig::GetFitsPrefix ( )

Get Fits Prefix.

std::string fcf::devmgr::common::DeviceConfig::GetIdentifier ( )
virtual
Returns
addres space identifier

Implements fcf::devmgr::common::IDeviceConfig.

bool fcf::devmgr::common::DeviceConfig::GetIgnored ( )
virtual

Get ignored flag.

Implements fcf::devmgr::common::IDeviceConfig.

std::string fcf::devmgr::common::DeviceConfig::GetMapFile ( )
virtual
std::string fcf::devmgr::common::DeviceConfig::GetName ( )
virtual
Returns
device name

Implements fcf::devmgr::common::IDeviceConfig.

int fcf::devmgr::common::DeviceConfig::GetNamespace ( )
virtual
Returns
namespace

Implements fcf::devmgr::common::IDeviceConfig.

std::string fcf::devmgr::common::DeviceConfig::GetNodeId ( const std::string &  attrib)
virtual

Get node id.

Parameters
[in]attribattribute to build the node id
Returns
Node id of the attribute given

The NodeId is composed by the following: <namespace>,<prefix>.<attribute>

Implements fcf::devmgr::common::IDeviceConfig.

std::string fcf::devmgr::common::DeviceConfig::GetObjId ( )
virtual

Get object id.

Returns
string with object id

This method returns the address space prefix for executing RPC calls.

<namespace>,<prefix>

Implements fcf::devmgr::common::IDeviceConfig.

std::string fcf::devmgr::common::DeviceConfig::GetPrefix ( )
virtual
Returns
device prefix

Implements fcf::devmgr::common::IDeviceConfig.

std::string fcf::devmgr::common::DeviceConfig::GetProcId ( const std::string &  attrib)
virtual

Get procedure id.

Parameters
[in]attribattribute to build the node id
Returns
string with procedure id

The procedure id is the NodeId for RPC calls and it is composed by the following:

<namespace>,<prefix>#<attribute>

Implements fcf::devmgr::common::IDeviceConfig.

std::string fcf::devmgr::common::DeviceConfig::GetSimAddress ( )
virtual
Returns
device simulation address

Implements fcf::devmgr::common::IDeviceConfig.

bool fcf::devmgr::common::DeviceConfig::GetSimulated ( )
virtual

Get simulated flag.

Implements fcf::devmgr::common::IDeviceConfig.

std::string fcf::devmgr::common::DeviceConfig::GetType ( )
virtual
Returns
device type

Implements fcf::devmgr::common::IDeviceConfig.

bool fcf::devmgr::common::DeviceConfig::Init ( )

Initialises a device.

Returns
true if initialisation finished without error, false otherwise.
void fcf::devmgr::common::DeviceConfig::ReadConfig ( )
virtual
void fcf::devmgr::common::DeviceConfig::SetIgnoreFlag ( bool  flag)
virtual

Set ignore flag.

Implements fcf::devmgr::common::IDeviceConfig.

void fcf::devmgr::common::DeviceConfig::SetSimulateFlag ( bool  flag)
virtual

Set simulation flag.

Implements fcf::devmgr::common::IDeviceConfig.

Member Data Documentation

std::string fcf::devmgr::common::DeviceConfig::m_address
protected
std::string fcf::devmgr::common::DeviceConfig::m_alias
protected
YAML::Node fcf::devmgr::common::DeviceConfig::m_config_node
protected

YAML node object for configuration file.

std::string fcf::devmgr::common::DeviceConfig::m_filename
protected

filename of device configuration file

std::string fcf::devmgr::common::DeviceConfig::m_fits_prefix
protected
std::string fcf::devmgr::common::DeviceConfig::m_identifier
protected

Address space identifier.

bool fcf::devmgr::common::DeviceConfig::m_ignored
protected
int fcf::devmgr::common::DeviceConfig::m_lcs_namespace
protected
std::string fcf::devmgr::common::DeviceConfig::m_lcs_prefix
protected
MapCfgBool fcf::devmgr::common::DeviceConfig::m_map_cfg_bool
protected
MapCfgDouble fcf::devmgr::common::DeviceConfig::m_map_cfg_double
protected
MapCfgInt fcf::devmgr::common::DeviceConfig::m_map_cfg_int
protected
MapCfgShort fcf::devmgr::common::DeviceConfig::m_map_cfg_short
protected
MapCfgUInt fcf::devmgr::common::DeviceConfig::m_map_cfg_uint
protected
std::string fcf::devmgr::common::DeviceConfig::m_map_file
protected
std::string fcf::devmgr::common::DeviceConfig::m_name
protected

device identifier

std::string fcf::devmgr::common::DeviceConfig::m_sim_address
protected
bool fcf::devmgr::common::DeviceConfig::m_simulated
protected
std::string fcf::devmgr::common::DeviceConfig::m_type
protected

Device type.


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