ifw
0.0.1-dev
|
Namespaces | |
common | |
lamp | |
motor | |
sensor | |
shutter | |
Enumerations | |
enum | { STAT_LOCAL = 1, STAT_ERROR = 2, STAT_STATE = 3, STAT_SUBSTATE = 4 } |
Functions | |
virtual virtual void | ReadConfig () |
DeviceConfig constructor. More... | |
virtual void | GetConfig (fcf::common::VectorVariant ¶ms) |
Obtain the list of configuration parameters. More... | |
virtual std::string | GetMapFile () |
virtual void | GetConfigList (std::vector< std::string > &cfg_list, std::string prefix) |
Get configuration list. More... | |
m_data_ctx (data_ctx) | |
virtual bool | IsReady () |
{{cookiecutter.device_name}}LcsIf constructor. More... | |
virtual bool | IsOperational () |
Check if controller is in Operational. More... | |
bool | IsHwFailure () |
Check if {{cookiecutter.device_name|capitalize()}} is in hardware error. More... | |
virtual void | ReadStatus ({{cookiecutter.device_name|capitalize()}}ControllerData &status) |
Read status from the controller. More... | |
void | StartMonitoring () |
Start monitoring of controller attributes. More... | |
void | StopMonitoring () |
Stop monitoring of controller attributes. More... | |
void | Listener (fcf::common::VectorVariant ¶ms) |
Callback to manage changes on the monitored items. More... | |
virtual std::string | GetRpcError (const short error_code) const |
virtual std::string | GetHwError () |
Get error message. More... | |
Variables | |
const short | SUBSTATE_INITIALISING = 101 |
const short | SUBSTATE_STANDBY_FAILURE = 104 |
const std::string | SUBSTATE_NOTREADY_STR = "NotReady" |
const std::string | SUBSTATE_INITIALISING_STR = "Initialising" |
const std::unordered_map < short, std::string > | SubstateMap |
const std::vector< std::string > | cfgMapping |
const std::vector< std::string > | statMapping |
const std::vector< std::string > | rpcMapping |
class { | |
} | upper |
{{cookiecutter.device_name}} Configuration class More... | |
devmgr::common::MapCfgBool | m_map_cfg_bool |
Map for {{cookiecutter.device_name}} boolean paramaters. More... | |
devmgr::common::MapCfgInt | m_map_cfg_int |
Map for {{cookiecutter.device_name}} integer parameters. More... | |
devmgr::common::MapCfgUInt | m_map_cfg_uint |
Map for {{cookiecutter.device_name}} unsigned int parameters. More... | |
const std::unordered_map < short, std::string > | hw_errors |
class { | |
} | enum |
{{cookiecutter.device_name|capitalize()}} Local Control System (LCS) Interface (IF) class More... | |
std::unordered_map < std::string, short > | m_status_map |
devmgr::common::DataContext & | m_data_ctx |
reference to the data context. More... | |
const std::unordered_map < short, std::string > | rpc_errors |
anonymous enum |
|
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 {{cookiecutter.device_name}} with the purpose to write it into the controller.
|
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.
|
virtual |
Get error message.
|
virtual |
|
virtual |
error_code | Error code |
bool devmgr::IsHwFailure | ( | ) |
Check if {{cookiecutter.device_name|capitalize()}} is in hardware error.
|
virtual |
Check if controller is in Operational.
|
virtual |
{{cookiecutter.device_name}}LcsIf constructor.
[in,out] | config | Shared pointer to the device configuration. |
[in,out] | data_ctx | Reference to the data context object. Check if controller is in Standby/Ready state |
void devmgr::Listener | ( | fcf::common::VectorVariant & | params | ) |
Callback to manage changes on the monitored items.
[in] | params | Vector containing the list of atributes that have changed |
This method implement the actions associated to the events originated from the monitoring of attributes.
This method is storing in the database the values that have changed. It also publish the events for the clients via zeroMQ.
devmgr::m_data_ctx | ( | data_ctx | ) |
|
virtual |
DeviceConfig constructor.
Read the configuration.
[in] | filename | filename of the device configuration file. |
[in] | name | Device identifier. DeviceConfig destructor Read the configuration |
This reads the {{cookiecutter.device_name}} configuration attributes in memory and check the presence of all attributes that are mandatory.
std::runtime_error | in case of an error |
This class reads the mapping configuration of the device.
|
virtual |
Read status from the controller.
status | structure containing the status of the controller. |
void devmgr::StartMonitoring | ( | ) |
Start monitoring of controller attributes.
This methods take cares of registering the attributes that will be monitored by the communication class. Most of the communication will be OPCUA and this monitoring means OPCUA subscription.
void devmgr::StopMonitoring | ( | ) |
Stop monitoring of controller attributes.
This method will inform the communication interface to stop monitoring the {{cookiecutter.device_name|capitalize()}} attributes.
const std::vector<std::string> devmgr::cfgMapping |
class { ... } devmgr::enum |
{{cookiecutter.device_name|capitalize()}} Local Control System (LCS) Interface (IF) class
This class manages the {{cookiecutter.device_name|capitalize()}} connection to the LCS encapsulating all basic communication with the controller or the simulator.
Each RPC call is synchronous but it only starts the action in the controller. The controller will return succesfully if the action can be started, not that the action was completed.
The completion of the action must be monitored by reading the status of the controller but this is out of the scope of this class.
const std::unordered_map<short, std::string> devmgr::hw_errors |
devmgr::common::DataContext& devmgr::m_data_ctx |
reference to the data context.
devmgr::common::MapCfgBool devmgr::m_map_cfg_bool |
Map for {{cookiecutter.device_name}} boolean paramaters.
devmgr::common::MapCfgInt devmgr::m_map_cfg_int |
Map for {{cookiecutter.device_name}} integer parameters.
devmgr::common::MapCfgUInt devmgr::m_map_cfg_uint |
Map for {{cookiecutter.device_name}} unsigned int parameters.
std::unordered_map<std::string, short> devmgr::m_status_map |
const std::unordered_map<short, std::string> devmgr::rpc_errors |
const std::vector<std::string> devmgr::rpcMapping |
const std::vector<std::string> devmgr::statMapping |
const short devmgr::SUBSTATE_INITIALISING = 101 |
const std::string devmgr::SUBSTATE_INITIALISING_STR = "Initialising" |
const std::string devmgr::SUBSTATE_NOTREADY_STR = "NotReady" |
const short devmgr::SUBSTATE_STANDBY_FAILURE = 104 |
const std::unordered_map<short, std::string> devmgr::SubstateMap |
class { ... } devmgr::upper |
{{cookiecutter.device_name}} Configuration class
This class manages the configuration of a {{cookiecutter.device_name}}. It reads the configuration file and provides the methods to obtain the parameters used by the auxiliary classes.