ifw-fcf  5.0.0-pre2
Public Member Functions | Friends | List of all members
fcf::devmgr::iodev::IODevConfig Class Reference

sensor Configuration class More...

#include <iodevConfig.hpp>

Inheritance diagram for fcf::devmgr::iodev::IODevConfig:
fcf::devmgr::common::DeviceConfig fcf::devmgr::common::IDeviceConfig TestIODev::MyDeviceConfig testIODevConfig::MyDeviceConfig testIODevLcsIf::TestIODevConfig

Public Member Functions

 IODevConfig (const std::string filename, const std::string name)
 IODevConfig constructor. More...
 
 IODevConfig (const std::string name)
 DeviceConfig constructor. More...
 
virtual ~IODevConfig ()=default
 DeviceConfig destructor. More...
 
virtual void Init ()
 Read the configuration. More...
 
virtual void GetConfig (protocol::base::VectorVariant &params) const override
 Obtain the list of configuration parameters. More...
 
virtual void GetConfigList (utils::bat::DbVector &cfg_list, std::string prefix) const override
 Get configuration list. More...
 
virtual void GetInputList (std::vector< std::string > &channel_list) const
 Get input channel list. More...
 
virtual void GetOutputList (std::vector< std::pair< std::string, std::string >> &channel_list) const
 Get output channel list. More...
 
bool IsNoRpc () const
 Get NO RPC flag. More...
 
bool IsSensor () const
 Get Sensor flag. More...
 
std::string GetChannelType (const std::string &channel) const
 
std::string GetChannelDescription (const std::string &channel) const
 
std::string GetChannelNamedValue (const std::string &channel, const std::string &value) const
 
std::optional< IODevChannelGetChannelConfig (const std::string &channel) const
 
- 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...
 
std::string GetIdentifier () const
 
std::string GetPrefix () const
 
std::string GetAddress () const
 
std::string GetSimAddress () const
 
std::string GetFitsPrefix () const
 Get Fits Prefix. More...
 
std::string GetType () const
 
int GetNamespace () const
 
std::string GetAlias () const
 
std::string GetId () const
 
std::string GetOverview () const
 
std::string GetDescription () const
 
std::string GetName () const noexcept
 
std::string GetLogName () const noexcept
 
std::string GetNodeId (const std::string &attrib) const
 Get node id. More...
 
std::string GetProcId (const std::string &attrib) const
 Get procedure id. More...
 
std::string GetObjId () const
 Get object id. More...
 
std::string GetCfgFile () const
 GetCfgFile. More...
 
std::string GetCfgAsString () const
 GetCfgAsString. More...
 
virtual void SetSimulateFlag (const bool flag)
 Set simulation flag. More...
 
virtual void SetIgnoreFlag (const bool flag)
 Set ignore flag. More...
 
virtual bool GetIgnored () const
 Get ignored flag. More...
 
virtual bool GetSimulated () const
 Get simulated flag. More...
 
virtual std::string GetMapFile () const
 Get name of the device mapping file. More...
 
void CheckConfig () const
 Validates the document configuration. More...
 

Friends

class IODev
 
class IODevLcsIf
 

Additional Inherited Members

- Protected Member Functions inherited from fcf::devmgr::common::DeviceConfig
void MergeConfig (const elt::configng::CiiConfigDocument &doc, bool check=true)
 Merges a configuration file. More...
 
bool GetVariantValue (const elt::configng::CiiConfigInstanceNode node, protocol::base::Variant &value) const
 Obtain the variant value with the correct type. More...
 
- Protected Attributes inherited from fcf::devmgr::common::DeviceConfig
std::string m_filename
 filename of device configuration file More...
 
std::string m_name
 device identifier 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
 
std::unique_ptr< elt::configng::CiiConfigDocument > m_config_doc
 Internal configuration document object. More...
 

Detailed Description

sensor Configuration class

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

Constructor & Destructor Documentation

◆ IODevConfig() [1/2]

fcf::devmgr::iodev::IODevConfig::IODevConfig ( const std::string  filename,
const std::string  name 
)

IODevConfig constructor.

Parameters
[in]filenamefilename of the device configuration file.
[in]nameDevice identifier.std::nullopt;

◆ IODevConfig() [2/2]

fcf::devmgr::iodev::IODevConfig::IODevConfig ( const std::string  name)

DeviceConfig constructor.

Parameters
[in]nameDevice identifier.

◆ ~IODevConfig()

virtual fcf::devmgr::iodev::IODevConfig::~IODevConfig ( )
virtualdefault

DeviceConfig destructor.

Member Function Documentation

◆ GetChannelConfig()

std::optional< IODevChannel > fcf::devmgr::iodev::IODevConfig::GetChannelConfig ( const std::string &  channel) const

◆ GetChannelDescription()

std::string fcf::devmgr::iodev::IODevConfig::GetChannelDescription ( const std::string &  channel) const

◆ GetChannelNamedValue()

std::string fcf::devmgr::iodev::IODevConfig::GetChannelNamedValue ( const std::string &  channel,
const std::string &  value 
) const

◆ GetChannelType()

std::string fcf::devmgr::iodev::IODevConfig::GetChannelType ( const std::string &  channel) const

◆ GetConfig()

void fcf::devmgr::iodev::IODevConfig::GetConfig ( protocol::base::VectorVariant &  params) const
overridevirtual

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 sensor with the purpose to keep it in memory.

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

◆ GetConfigList()

void fcf::devmgr::iodev::IODevConfig::GetConfigList ( utils::bat::DbVector &  cfg_list,
std::string  prefix 
) const
overridevirtual

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.

◆ GetInputList()

void fcf::devmgr::iodev::IODevConfig::GetInputList ( std::vector< std::string > &  channel_list) const
virtual

Get input channel list.

Parameters
[in,out]channel_listList of input channels

This method returs the complete list of input channels in the configuration.

◆ GetOutputList()

void fcf::devmgr::iodev::IODevConfig::GetOutputList ( std::vector< std::pair< std::string, std::string >> &  channel_list) const
virtual

Get output channel list.

Parameters
[in,out]channel_listList of output channels

This method returs the complete list of output channels in the configuration.

◆ Init()

void fcf::devmgr::iodev::IODevConfig::Init ( )
virtual

Read the configuration.

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

Exceptions
std::runtime_errorin case of an error

◆ IsNoRpc()

bool fcf::devmgr::iodev::IODevConfig::IsNoRpc ( ) const

Get NO RPC flag.

This method returns the flag that disables the execution of RPCs. When this flag is active, it means all RPC calls will be skipped and the server assumes the controller is Operational/Monitoring.

This flag shall be used for commercial controllers with embedded OPCUA servers like the Rittal PDUs.

◆ IsSensor()

bool fcf::devmgr::iodev::IODevConfig::IsSensor ( ) const

Get Sensor flag.

This method returns the flag that indicates IODev behaves like a sensor device and therfore only input channels are allowed.

Friends And Related Function Documentation

◆ IODev

friend class IODev
friend

◆ IODevLcsIf

friend class IODevLcsIf
friend

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