|
ifw-fcf
2.0.0
|
Device Configuration class. More...
#include <deviceConfig.hpp>
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 ¶ms) |
| 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 |
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.
| fcf::devmgr::common::DeviceConfig::DeviceConfig | ( | const std::string & | filename, |
| const std::string & | name | ||
| ) |
DeviceConfig constructor.
| [in] | filename | filename of the device configuration file. |
| [in] | name | Device identifier. |
|
virtual |
DeviceConfig destructor.
|
virtual |
Implements fcf::devmgr::common::IDeviceConfig.
|
virtual |
Implements fcf::devmgr::common::IDeviceConfig.
| std::string fcf::devmgr::common::DeviceConfig::GetCfgFile | ( | ) |
GetCfgFile.
|
virtual |
Obtain the list of configuration parameters.
| [in,out] | params | output vector with the list of config parameters |
This methods prepare a vector with all the configuration parameters of a device with the purpose to write it into the controller.
Implements fcf::devmgr::common::IDeviceConfig.
Reimplemented in fcf::devmgr::motor::MotorConfig, fcf::devmgr::adc::AdcConfig, fcf::devmgr::sensor::SensorConfig, MyDeviceConfig, testShutter::MyDeviceConfig, testActuator::MyDeviceConfig, testPiezo::MyDeviceConfig, testDrot::MyDeviceConfig, testDeviceFacade::MyDeviceConfig, testSensor::MyDeviceConfig, testAdc::MyDeviceConfig, testMotor::MyDeviceConfig, testLamp::MyDeviceConfig, testSensorConfig::MyDeviceConfig, testAdcConfig::MyDeviceConfig, testDrotConfig::MyDeviceConfig, testLampConfig::MyDeviceConfig, testMotorConfig::MyDeviceConfig, testShutterConfig::MyDeviceConfig, testActuatorConfig::MyDeviceConfig, testPiezoConfig::MyDeviceConfig, testDeviceLcsIf::MyDeviceConfig, and MyDeviceConfig.
|
virtual |
Get configuration list.
| cfg_list | List of all configuration parameters. |
| prefix | Prefix 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.
|
virtual |
Implements fcf::devmgr::common::IDeviceConfig.
|
virtual |
Get ignored flag.
Implements fcf::devmgr::common::IDeviceConfig.
|
virtual |
Get name of the device mapping file.
Implements fcf::devmgr::common::IDeviceConfig.
Reimplemented in MyDeviceConfig, testShutter::MyDeviceConfig, testActuator::MyDeviceConfig, testDrot::MyDeviceConfig, testPiezo::MyDeviceConfig, testSensor::MyDeviceConfig, testAdc::MyDeviceConfig, testMotor::MyDeviceConfig, testLamp::MyDeviceConfig, testDeviceFacade::MyDeviceConfig, testAdcLcsIf::TestAdcConfig, testDrotLcsIf::TestDrotConfig, testMotorLcsIf::TestMotorConfig, testSensorLcsIf::TestSensorConfig, testSensorConfig::MyDeviceConfig, testAdcConfig::MyDeviceConfig, testDrotConfig::MyDeviceConfig, testActuatorLcsIf::TestActuatorConfig, testLampConfig::MyDeviceConfig, testMotorConfig::MyDeviceConfig, testPiezoLcsIf::TestPiezoConfig, testShutterConfig::MyDeviceConfig, testShutterLcsIf::TestShutterConfig, testActuatorConfig::MyDeviceConfig, testPiezoConfig::MyDeviceConfig, testLampLcsIf::TestLampConfig, testDeviceLcsIf::MyDeviceConfig, and MyDeviceConfig.
|
virtual |
Implements fcf::devmgr::common::IDeviceConfig.
|
virtual |
Implements fcf::devmgr::common::IDeviceConfig.
|
virtual |
Get node id.
| [in] | attrib | attribute to build the node id |
The NodeId is composed by the following: <namespace>,<prefix>.<attribute>
Implements fcf::devmgr::common::IDeviceConfig.
|
virtual |
Get object id.
This method returns the address space prefix for executing RPC calls.
<namespace>,<prefix>
Implements fcf::devmgr::common::IDeviceConfig.
|
virtual |
Implements fcf::devmgr::common::IDeviceConfig.
|
virtual |
Get procedure id.
| [in] | attrib | attribute to build the node 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.
|
virtual |
Implements fcf::devmgr::common::IDeviceConfig.
|
virtual |
Get simulated flag.
Implements fcf::devmgr::common::IDeviceConfig.
|
virtual |
Implements fcf::devmgr::common::IDeviceConfig.
| bool fcf::devmgr::common::DeviceConfig::Init | ( | ) |
Initialises a device.
|
virtual |
Read the configuration.
This reads the device configuration attributes in memory and check the presence of all attributes that are mandatory.
| std::runtime_error | in case of an error |
Implements fcf::devmgr::common::IDeviceConfig.
Reimplemented in fcf::devmgr::motor::MotorConfig, fcf::devmgr::adc::AdcConfig, fcf::devmgr::sensor::SensorConfig, testShutter::MyDeviceConfig, testActuator::MyDeviceConfig, testPiezo::MyDeviceConfig, testDrot::MyDeviceConfig, testDeviceFacade::MyDeviceConfig, testSensor::MyDeviceConfig, testAdc::MyDeviceConfig, testMotor::MyDeviceConfig, testLamp::MyDeviceConfig, MyDeviceConfig, testSensorConfig::MyDeviceConfig, testAdcConfig::MyDeviceConfig, testDrotConfig::MyDeviceConfig, testLampConfig::MyDeviceConfig, testMotorConfig::MyDeviceConfig, testShutterConfig::MyDeviceConfig, testActuatorConfig::MyDeviceConfig, testPiezoConfig::MyDeviceConfig, testDeviceLcsIf::MyDeviceConfig, and MyDeviceConfig.
|
virtual |
Set ignore flag.
Implements fcf::devmgr::common::IDeviceConfig.
|
virtual |
Set simulation flag.
Implements fcf::devmgr::common::IDeviceConfig.
|
protected |
|
protected |
|
protected |
YAML node object for configuration file.
|
protected |
filename of device configuration file
|
protected |
|
protected |
Address space identifier.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
device identifier
|
protected |
|
protected |
|
protected |
Device type.
1.8.5