ifw-fcf
5.0.0-pre2
|
sensor Configuration class More...
#include <iodevConfig.hpp>
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 ¶ms) 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< IODevChannel > | GetChannelConfig (const std::string &channel) const |
![]() | |
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 | |
![]() | |
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... | |
![]() | |
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... | |
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.
IODevConfig constructor.
[in] | filename | filename of the device configuration file. |
[in] | name | Device identifier.std::nullopt; |
fcf::devmgr::iodev::IODevConfig::IODevConfig | ( | const std::string | name | ) |
DeviceConfig constructor.
[in] | name | Device identifier. |
|
virtualdefault |
DeviceConfig destructor.
std::optional< IODevChannel > fcf::devmgr::iodev::IODevConfig::GetChannelConfig | ( | const std::string & | channel | ) | const |
std::string fcf::devmgr::iodev::IODevConfig::GetChannelDescription | ( | const std::string & | channel | ) | const |
std::string fcf::devmgr::iodev::IODevConfig::GetChannelNamedValue | ( | const std::string & | channel, |
const std::string & | value | ||
) | const |
std::string fcf::devmgr::iodev::IODevConfig::GetChannelType | ( | const std::string & | channel | ) | const |
|
overridevirtual |
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 sensor with the purpose to keep it in memory.
Reimplemented from fcf::devmgr::common::DeviceConfig.
|
overridevirtual |
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 from fcf::devmgr::common::DeviceConfig.
|
virtual |
Get input channel list.
[in,out] | channel_list | List of input channels |
This method returs the complete list of input channels in the configuration.
|
virtual |
Get output channel list.
[in,out] | channel_list | List of output channels |
This method returs the complete list of output channels in the configuration.
|
virtual |
Read the configuration.
This reads the sensor configuration attributes in memory and check the presence of all attributes that are mandatory.
std::runtime_error | in case of an error |
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.
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.
|
friend |
|
friend |