9 #ifndef FCF_DEVMGR_COMMON_DEVICECONFIG_HPP_
10 #define FCF_DEVMGR_COMMON_DEVICECONFIG_HPP_
14 #include <unordered_map>
17 #include <yaml-cpp/yaml.h>
19 #include <fcf/common/iComm.hpp>
71 const std::unordered_map<short, std::string>
StateMap = {
133 DeviceConfig(
const std::string& filename,
const std::string& name);
163 virtual void GetConfig(fcf::common::VectorVariant& params);
226 std::string
GetNodeId(
const std::string& attrib);
238 std::string
GetProcId(
const std::string& attrib);
260 virtual void GetConfigList(std::vector<std::string>& cfg_list, std::string prefix);
330 #endif //FCF_DEVMGR_COMMON_DEVICECONFIG_HPP_
constexpr auto CI_TYPE
Definition: deviceConfig.hpp:33
constexpr auto CI_STAT_LOCAL
Definition: deviceConfig.hpp:53
virtual void GetConfig(fcf::common::VectorVariant ¶ms)
Obtain the list of configuration parameters.
Definition: deviceConfig.cpp:258
constexpr auto CI_MAP_FILE
Definition: deviceConfig.hpp:36
constexpr auto RPC_INIT
Definition: deviceConfig.hpp:43
constexpr auto CI_IGNORED
Definition: deviceConfig.hpp:30
constexpr auto FITS_PARAM_NAME
Definition: deviceConfig.hpp:99
constexpr auto CI_SIMULATED
Definition: deviceConfig.hpp:29
constexpr auto CAT_CFG
Definition: deviceConfig.hpp:60
constexpr int SUBSTATE_INITIALISING
Definition: deviceConfig.hpp:84
constexpr auto SUBSTATE_NOTREADY_STR
Definition: deviceConfig.hpp:87
bool m_simulated
Definition: deviceConfig.hpp:315
std::string m_address
Definition: deviceConfig.hpp:318
MapCfgInt m_map_cfg_int
Definition: deviceConfig.hpp:305
std::map< int, CfgShort > MapCfgShort
Definition: deviceConfig.hpp:113
constexpr auto CI_STAT_ERROR_STR
Definition: deviceConfig.hpp:55
std::string m_type
Device type.
Definition: deviceConfig.hpp:313
constexpr auto CAT_RPC
Definition: deviceConfig.hpp:61
int m_lcs_namespace
Definition: deviceConfig.hpp:322
MapCfgUInt m_map_cfg_uint
Definition: deviceConfig.hpp:306
std::string GetNodeId(const std::string &attrib)
Get node id.
Definition: deviceConfig.cpp:372
std::string m_identifier
Address space identifier.
Definition: deviceConfig.hpp:312
constexpr auto SUBSTATE_OP_DISABLING_STR
Definition: deviceConfig.hpp:95
const std::unordered_map< short, std::string > StateMap
Definition: deviceConfig.hpp:71
constexpr auto DB_CONTROLLER_PREFIX
Definition: deviceConfig.hpp:56
constexpr auto CI_ALIAS
Definition: deviceConfig.hpp:38
constexpr auto CI_STAT_SUBSTATE
Definition: deviceConfig.hpp:50
bool Init()
Initialises a device.
Definition: deviceConfig.cpp:43
constexpr auto RPC_DISABLE
Definition: deviceConfig.hpp:45
constexpr auto FITS_PARAM_ID
Definition: deviceConfig.hpp:98
MapCfgShort m_map_cfg_short
Definition: deviceConfig.hpp:304
constexpr int SUBSTATE_OP_DISABLING
Definition: deviceConfig.hpp:92
std::string GetProcId(const std::string &attrib)
Get procedure id.
Definition: deviceConfig.cpp:379
std::string m_sim_address
Definition: deviceConfig.hpp:319
MapCfgDouble m_map_cfg_double
Definition: deviceConfig.hpp:307
constexpr auto CAT_STAT
Definition: deviceConfig.hpp:59
std::string GetSimAddress()
Definition: deviceConfig.cpp:324
constexpr auto STATE_NOT_OPERATIONAL_STR
Definition: deviceConfig.hpp:67
constexpr int STATE_OPERATIONAL
Definition: deviceConfig.hpp:65
std::string GetType()
Definition: deviceConfig.cpp:343
constexpr auto FITS_PARAM_STAT
Definition: deviceConfig.hpp:100
virtual bool GetIgnored()
Get ignored flag.
Definition: deviceConfig.cpp:336
DeviceConfig(const std::string &filename, const std::string &name)
DeviceConfig constructor.
Definition: deviceConfig.cpp:28
constexpr auto CI_CTRL_CONFIG
Definition: deviceConfig.hpp:40
constexpr auto FITS_PARAM_DEVSIM
Definition: deviceConfig.hpp:101
constexpr auto STATE_UNAVAILABLE_STR
Definition: deviceConfig.hpp:69
YAML::Node m_config_node
YAML node object for configuration file.
Definition: deviceConfig.hpp:311
std::string GetAddress()
Definition: deviceConfig.cpp:318
virtual void GetConfigList(std::vector< std::string > &cfg_list, std::string prefix)
Get configuration list.
Definition: deviceConfig.cpp:392
MapCfgBool m_map_cfg_bool
Definition: deviceConfig.hpp:303
constexpr auto STATE_OPERATIONAL_STR
Definition: deviceConfig.hpp:68
configSet class header file.
std::map< int, CfgBool > MapCfgBool
Definition: deviceConfig.hpp:112
constexpr auto CI_ADDRESS
Definition: deviceConfig.hpp:31
std::string m_fits_prefix
Definition: deviceConfig.hpp:314
constexpr auto RPC_STOP
Definition: deviceConfig.hpp:46
std::string GetIdentifier()
Definition: deviceConfig.cpp:306
std::string GetAlias()
Definition: deviceConfig.cpp:367
constexpr auto CI_STAT_STATE
Definition: deviceConfig.hpp:51
virtual void SetIgnoreFlag(bool flag)
Set ignore flag.
Definition: deviceConfig.cpp:460
IDeviceConfig class header file.
constexpr int SUBSTATE_NOTREADY
Definition: deviceConfig.hpp:82
std::string m_name
device identifier
Definition: deviceConfig.hpp:310
std::string m_alias
Definition: deviceConfig.hpp:321
virtual void ReadConfig()
Read the configuration.
Definition: deviceConfig.cpp:154
constexpr auto CI_NAMESPACE
Definition: deviceConfig.hpp:35
constexpr auto CI_IDENTIFIER
Definition: deviceConfig.hpp:28
std::string GetName()
Definition: deviceConfig.cpp:362
std::map< int, CfgUInt > MapCfgUInt
Definition: deviceConfig.hpp:115
std::string m_filename
filename of device configuration file
Definition: deviceConfig.hpp:309
std::map< int, CfgInt > MapCfgInt
Definition: deviceConfig.hpp:114
constexpr auto SUBSTATE_OP_ERROR_STR
Definition: deviceConfig.hpp:96
std::string GetCfgFile()
GetCfgFile.
Definition: deviceConfig.cpp:450
constexpr auto SUBSTATE_INITIALISING_STR
Definition: deviceConfig.hpp:88
std::string m_map_file
Definition: deviceConfig.hpp:320
constexpr auto CI_PREFIX
Definition: deviceConfig.hpp:34
std::map< int, CfgDouble > MapCfgDouble
Definition: deviceConfig.hpp:116
constexpr auto SUBSTATE_READY_STR
Definition: deviceConfig.hpp:89
constexpr auto CI_STAT_STATU
Definition: deviceConfig.hpp:52
constexpr auto CI_SIM_ADDRESS
Definition: deviceConfig.hpp:32
constexpr int SUBSTATE_OP_ERROR
Definition: deviceConfig.hpp:93
const std::unordered_map< std::string, short > StateStrMap
Definition: deviceConfig.hpp:76
std::string GetPrefix()
Definition: deviceConfig.cpp:312
constexpr auto RPC_RESET
Definition: deviceConfig.hpp:47
virtual ~DeviceConfig()
DeviceConfig destructor.
Definition: deviceConfig.cpp:39
std::string GetObjId()
Get object id.
Definition: deviceConfig.cpp:385
Device Configuration class.
Definition: deviceConfig.hpp:125
constexpr auto FITS_PARAM_DEVIGN
Definition: deviceConfig.hpp:102
bool m_ignored
Definition: deviceConfig.hpp:316
constexpr auto CI_STAT_ERROR_CODE
Definition: deviceConfig.hpp:54
constexpr int SUBSTATE_ERROR
Definition: deviceConfig.hpp:85
std::string m_lcs_prefix
Definition: deviceConfig.hpp:317
virtual void SetSimulateFlag(bool flag)
Set simulation flag.
Definition: deviceConfig.cpp:455
constexpr auto CI_FITS_PREFIX
Definition: deviceConfig.hpp:37
Definition: configSet.hpp:17
constexpr auto CI_CFG_FILE
Definition: deviceConfig.hpp:39
constexpr auto RPC_ENABLE
Definition: deviceConfig.hpp:44
constexpr int STATE_NOT_OPERATIONAL
Definition: deviceConfig.hpp:64
std::string GetFitsPrefix()
Get Fits Prefix.
Definition: deviceConfig.cpp:349
int GetNamespace()
Definition: deviceConfig.cpp:355
Device Configuration class.
Definition: iDeviceConfig.hpp:32
virtual bool GetSimulated()
Get simulated flag.
Definition: deviceConfig.cpp:330
constexpr auto SUBSTATE_ERROR_STR
Definition: deviceConfig.hpp:90
constexpr int SUBSTATE_READY
Definition: deviceConfig.hpp:83
virtual std::string GetMapFile()
Get name of the device mapping file.
Definition: deviceConfig.cpp:465