ifw  0.0.1-dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
testDeviceLcsIf::MyDeviceLcsIf Class Reference
Inheritance diagram for testDeviceLcsIf::MyDeviceLcsIf:
devmgr::common::DeviceLcsIf

Public Member Functions

 MyDeviceLcsIf (std::shared_ptr< testDeviceLcsIf::MyDeviceConfig > config)
 
void ReadConfig ()
 Read the configuration. More...
 
bool IsReady ()
 Check if controller is in Standby/Ready state. More...
 
bool IsOperational ()
 Check if controller is in Operational. More...
 
bool IsHwFailure ()
 Check if controller is in Hardware Failure. More...
 
void StartMonitoring ()
 Start monitoring of controller attributes. More...
 
void StopMonitoring ()
 Stop monitoring of controller attributes. More...
 
void Listener (fcf::common::VectorVariant &params)
 Callback for listening controller events. More...
 
std::string GetRpcError (short error_code) const
 Get associated message from the RPC error code. More...
 
std::string GetHwError (int &error_code, const bool update=false)
 Get error message. More...
 
- Public Member Functions inherited from devmgr::common::DeviceLcsIf
 DeviceLcsIf (std::shared_ptr< IDeviceConfig > config)
 DeviceLcsIf construm_data_ctx.GetConfig().GetServerId() + ".". More...
 
virtual void RegisterComm (std::shared_ptr< fcf::common::IComm > commIf, fcf::common::Dispatcher<> &failure, fcf::common::Dispatcher<> &normal)
 Register a communication interface. More...
 
virtual void Connect ()
 Connect to the controller or simulator. More...
 
virtual void Disconnect ()
 Disconnect from the controller of simulator. More...
 
virtual bool IsNotReady ()
 Check if controller is in Standby/NotReady state. More...
 
virtual bool IsDisabling ()
 Check if controller is in Disabling state. More...
 
virtual void Init ()
 Check if controller is in Hardware Failure. More...
 
virtual void Enable ()
 Executes the Enable RPC. More...
 
virtual void Disable ()
 Executes the Disable RPC. More...
 
virtual void Stop ()
 Executes the Stop RPC. More...
 
virtual void Reset ()
 Executes the Reset RPC. More...
 
std::string GetMapValue (std::string category, std::string key)
 Get mapping valLampConfigue. More...
 
fcf::common::Dispatcher
< fcf::common::VectorVariant & > & 
GetDispatcher ()
 
bool IsConfigLoaded () const
 Check if configuration was loaded. More...
 
bool IsConnected () const
 Check is the communication was established. More...
 
 DeviceLcsIf (std::shared_ptr< IDeviceConfig > config)
 DeviceLcsIf construm_data_ctx.GetConfig().GetServerId() + ".". More...
 
virtual void RegisterComm (std::shared_ptr< fcf::common::IComm > commIf, fcf::common::Dispatcher<> &failure, fcf::common::Dispatcher<> &normal)
 Register a communication interface. More...
 
virtual void Connect ()
 Connect to the controller or simulator. More...
 
virtual void Disconnect ()
 Disconnect from the controller of simulator. More...
 
virtual bool IsNotReady ()
 Check if controller is in Standby/NotReady state. More...
 
virtual bool IsDisabling ()
 Check if controller is in Disabling state. More...
 
virtual void Init ()
 Check if controller is in Hardware Failure. More...
 
virtual void Enable ()
 Executes the Enable RPC. More...
 
virtual void Disable ()
 Executes the Disable RPC. More...
 
virtual void Stop ()
 Executes the Stop RPC. More...
 
virtual void Reset ()
 Executes the Reset RPC. More...
 
std::string GetMapValue (std::string category, std::string key)
 Get mapping valLampConfigue. More...
 
fcf::common::Dispatcher
< fcf::common::VectorVariant & > & 
GetDispatcher ()
 
bool IsConfigLoaded () const
 Check if configuration was loaded. More...
 
bool IsConnected () const
 Check is the communication was established. More...
 
 DeviceLcsIf (std::shared_ptr< IDeviceConfig > config)
 DeviceLcsIf construm_data_ctx.GetConfig().GetServerId() + ".". More...
 
virtual void RegisterComm (std::shared_ptr< fcf::common::IComm > commIf, fcf::common::Dispatcher<> &failure, fcf::common::Dispatcher<> &normal)
 Register a communication interface. More...
 
virtual void Connect ()
 Connect to the controller or simulator. More...
 
virtual void Disconnect ()
 Disconnect from the controller of simulator. More...
 
virtual bool IsNotReady ()
 Check if controller is in Standby/NotReady state. More...
 
virtual bool IsDisabling ()
 Check if controller is in Disabling state. More...
 
virtual void Init ()
 Check if controller is in Hardware Failure. More...
 
virtual void Enable ()
 Executes the Enable RPC. More...
 
virtual void Disable ()
 Executes the Disable RPC. More...
 
virtual void Stop ()
 Executes the Stop RPC. More...
 
virtual void Reset ()
 Executes the Reset RPC. More...
 
std::string GetMapValue (std::string category, std::string key)
 Get mapping valLampConfigue. More...
 
fcf::common::Dispatcher
< fcf::common::VectorVariant & > & 
GetDispatcher ()
 
bool IsConfigLoaded () const
 Check if configuration was loaded. More...
 
bool IsConnected () const
 Check is the communication was established. More...
 

Additional Inherited Members

- Protected Member Functions inherited from devmgr::common::DeviceLcsIf
void LoadConfig ()
 Load the YAML configuration. More...
 
void GetStates (short &state, short &substate)
 Get states (state and substate) of the controller. More...
 
void LoadConfig ()
 Load the YAML configuration. More...
 
void GetStates (short &state, short &substate)
 Get states (state and substate) of the controller. More...
 
void LoadConfig ()
 Load the YAML configuration. More...
 
void GetStates (short &state, short &substate)
 Get states (state and substate) of the controller. More...
 
- Protected Attributes inherited from devmgr::common::DeviceLcsIf
YAML::Node m_config_node
 YAML node for the device mapping file. More...
 
std::shared_ptr
< fcf::common::IComm > 
m_comm
 Shared pointer to the communication object. More...
 
std::shared_ptr< IDeviceConfigm_config
 Shared pointer to the device config object. More...
 
fcf::common::Dispatcher
< fcf::common::VectorVariant & > 
m_dispatcher
 Dispatcher for managing subscription events. More...
 
fcf::common::Dispatcher m_failure
 Dispatcher for managing failures in the communication. More...
 
fcf::common::Dispatcher m_normal
 Dispatcher for managing recovery of communication failures. More...
 
short m_state
 Actual controller state. More...
 
short m_substate
 Actual controller substate. More...
 
bool m_config_loaded
 Flag indicating whether the configuration was succesfully loaded. More...
 
bool m_connected
 Flag indicating whether the LCS is connected. More...
 

Constructor & Destructor Documentation

testDeviceLcsIf::MyDeviceLcsIf::MyDeviceLcsIf ( std::shared_ptr< testDeviceLcsIf::MyDeviceConfig config)
inlineexplicit

Member Function Documentation

std::string testDeviceLcsIf::MyDeviceLcsIf::GetHwError ( int &  error_code,
const bool  update = false 
)
inlinevirtual

Get error message.

Returns
error message associated to the error code read from the PLC.

This methods does a read to the PLC to obtain the error code.

Implements devmgr::common::DeviceLcsIf.

std::string testDeviceLcsIf::MyDeviceLcsIf::GetRpcError ( short  error_code) const
inlinevirtual

Get associated message from the RPC error code.

Parameters
[in]error_code
Returns
string with the associated error message.

Implements devmgr::common::DeviceLcsIf.

bool testDeviceLcsIf::MyDeviceLcsIf::IsHwFailure ( )
inlinevirtual

Check if controller is in Hardware Failure.

Returns
true if condition is met, false otherwise.

Sometimes the controller may enter into a failure state triggerd by a hardware error. The controller will enter into a specific state to signal this condition. This method is checking if this condition is met.

This method reads the substate attribute from the PLC.

Implements devmgr::common::DeviceLcsIf.

bool testDeviceLcsIf::MyDeviceLcsIf::IsOperational ( )
inlinevirtual

Check if controller is in Operational.

Returns
true if condition is met, false otherwise.

Implements devmgr::common::DeviceLcsIf.

bool testDeviceLcsIf::MyDeviceLcsIf::IsReady ( )
inlinevirtual

Check if controller is in Standby/Ready state.

Returns
true if condition is met, false otherwise.

Implements devmgr::common::DeviceLcsIf.

void testDeviceLcsIf::MyDeviceLcsIf::Listener ( fcf::common::VectorVariant &  params)
inlinevirtual

Callback for listening controller events.

Parameters
paramslist of paramaters to be monitored.

Abstract method to be implemented by specific classes.

Implements devmgr::common::DeviceLcsIf.

void testDeviceLcsIf::MyDeviceLcsIf::ReadConfig ( )
inlinevirtual

Read the configuration.

Exceptions
anexception if an error ocurrs.

This is an abstract method that need to be implemented by concrete device classes.

Implements devmgr::common::DeviceLcsIf.

void testDeviceLcsIf::MyDeviceLcsIf::StartMonitoring ( )
inlinevirtual

Start monitoring of controller attributes.

Exceptions
anexception if an error ocurrs.

Abstract method to be implemented by specific classes.

Implements devmgr::common::DeviceLcsIf.

void testDeviceLcsIf::MyDeviceLcsIf::StopMonitoring ( )
inlinevirtual

Stop monitoring of controller attributes.

Exceptions
anexception if an error ocurrs.

Abstract method to be implemented by specific classes.

Implements devmgr::common::DeviceLcsIf.


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