ifw-fcf 7.1.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MyDeviceLcsIf Class Reference
Inheritance diagram for MyDeviceLcsIf:
ifw::fcf::devmgr::common::DeviceLcsIf

Public Member Functions

 MyDeviceLcsIf (std::shared_ptr< ifw::fcf::devmgr::common::IDeviceConfig > config, ifw::fcf::devmgr::common::DataContext &data_ctx)
 
void Init ()
 Executes the Init RPC.
 
void Enable ()
 Executes the Enable RPC.
 
void Disable ()
 Executes the Disable RPC.
 
void ReadConfig ()
 
bool IsReady ()
 
bool IsOperational ()
 
bool IsHwFailure ()
 
void StartMonitoring ()
 Start monitoring of controller attributes.
 
void StopMonitoring ()
 Stop monitoring of controller attributes.
 
void Listener (ifw::core::protocol::base::VectorVariant &params)
 Callback for listening controller events.
 
std::string GetRpcError (short error_code) const
 Get associated message from the RPC error code.
 
std::string GetHwError (int &error_code, const bool update=false)
 Get error message.
 
- Public Member Functions inherited from ifw::fcf::devmgr::common::DeviceLcsIf
 DeviceLcsIf (std::shared_ptr< IDeviceConfig > config, DataContext &data_ctx)
 DeviceLcsIf constructor.
 
virtual void InitObject ()
 Initialize object.
 
virtual void RegisterComm (std::shared_ptr< ifw::core::protocol::base::IComm > comm_if, ifw::core::protocol::base::Dispatcher<> &failure, ifw::core::protocol::base::Dispatcher<> &normal)
 Register a communication interface.
 
virtual void Connect ()
 Connect to the controller or simulator.
 
virtual void Disconnect ()
 Disconnect from the controller of simulator.
 
virtual bool IsNotReady () const
 Check if controller is in Standby/NotReady state.
 
virtual bool IsReady () const
 Check if controller is in Standby/Ready state.
 
virtual bool IsDisabling () const
 Check if controller is in Disabling state.
 
virtual bool IsOperational () const
 Check if controller is in Operational.
 
virtual bool IsHwFailure () const
 Check if controller is in Hardware Failure.
 
virtual void Stop ()
 Executes the Stop RPC.
 
virtual void Reset ()
 Executes the Reset RPC.
 
virtual void ReadStatus (DeviceControllerData &status)
 ReadStatus.
 
std::string GetMapValue (const std::string &category, const std::string &key) const
 Get mapping value.
 
ifw::core::protocol::base::Dispatcher< ifw::core::protocol::base::VectorVariant & > & GetDispatcher ()
 
bool IsConfigLoaded () const
 Check if configuration was loaded.
 
bool IsConnected () const
 Check is the communication was established.
 
virtual std::shared_ptr< IDeviceConfigGetDeviceConfig () const
 Get a pointer of device configuration.
 
const elt::configng::CiiConfigInstanceNamespace & GetCfgInstance () const
 
virtual void GetStates (int &state, int &substate)
 Get states (state and substate) of the controller.
 

Additional Inherited Members

- Public Types inherited from ifw::fcf::devmgr::common::DeviceLcsIf
enum  {
  STAT_LOCAL = 1 , STAT_ERROR = 2 , STAT_HW_STATUS = 3 , STAT_STATE = 4 ,
  STAT_SUBSTATE = 5
}
 
- Protected Member Functions inherited from ifw::fcf::devmgr::common::DeviceLcsIf
void LoadConfig ()
 Load the YAML configuration.
 
void ExecuteRpc (const std::string &obj, const std::string &proc, ifw::core::protocol::base::VectorVariant &attr_list)
 
int ReadErrorCode ()
 
void StoreUaNames (const std::vector< std::pair< std::string, unsigned int > > &ualist)
 StoreUaNames.
 
void StoreAttribute (const std::string &key, const ifw::core::protocol::base::Variant &value, int attribute)
 Store the updated into the DB.
 
void SetConfigLoad (bool flag)
 
- Protected Attributes inherited from ifw::fcf::devmgr::common::DeviceLcsIf
std::shared_ptr< IDeviceConfigm_config
 Shared pointer to the device config object.
 
std::unique_ptr< elt::configng::CiiConfigDocument > m_config_doc
 Config document for mapping file.
 
std::string m_lcs_prefix
 Store the prefix for storing keys in the database.
 
std::shared_ptr< ifw::core::protocol::base::IComm > m_comm
 Shared pointer to the communication object.
 
ifw::core::protocol::base::Dispatcher< ifw::core::protocol::base::VectorVariant & > m_dispatcher
 Dispatcher for managing subscription events.
 
ifw::core::protocol::base::Dispatcher m_failure
 Dispatcher for managing failures in the communication.
 
ifw::core::protocol::base::Dispatcher m_normal
 Dispatcher for managing recovery of communication failures.
 
int m_state {}
 Actual controller state.
 
int m_substate {}
 Actual controller substate.
 
bool m_local {false}
 Actual local flag.
 
bool m_error_code {false}
 Actual error code.
 
bool m_config_loaded {false}
 Flag indicating whether the configuration was successfully loaded.
 
bool m_connected {false}
 Flag indicating whether the LCS is connected.
 
ifw::fcf::devmgr::common::DataContextm_data_ctx
 
std::unordered_map< std::string, short > m_ua_status_map
 
std::vector< std::string > m_ua_monitor_vector
 
std::unordered_map< short, std::string > m_hw_errors
 

Constructor & Destructor Documentation

◆ MyDeviceLcsIf()

MyDeviceLcsIf::MyDeviceLcsIf ( std::shared_ptr< ifw::fcf::devmgr::common::IDeviceConfig > config,
ifw::fcf::devmgr::common::DataContext & data_ctx )
inline

Member Function Documentation

◆ Disable()

void MyDeviceLcsIf::Disable ( )
inlinevirtual

Executes the Disable RPC.

Exceptions
anexception if an error ocurrs.

This RPC call shall bring the controller to Standby/Ready state.

Reimplemented from ifw::fcf::devmgr::common::DeviceLcsIf.

◆ Enable()

void MyDeviceLcsIf::Enable ( )
inlinevirtual

Executes the Enable RPC.

Exceptions
anexception if an error ocurrs.

This RPC call shall bring the controller to Operational state.

Reimplemented from ifw::fcf::devmgr::common::DeviceLcsIf.

◆ GetHwError()

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

Get error message.

Parameters
error_codeInput error code
updateFlag that indicate to read the error code.
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.

Reimplemented from ifw::fcf::devmgr::common::DeviceLcsIf.

◆ GetRpcError()

std::string 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 ifw::fcf::devmgr::common::DeviceLcsIf.

◆ Init()

void MyDeviceLcsIf::Init ( )
inlinevirtual

Executes the Init RPC.

Exceptions
anexception if an error ocurrs.

Reimplemented from ifw::fcf::devmgr::common::DeviceLcsIf.

◆ IsHwFailure()

bool MyDeviceLcsIf::IsHwFailure ( )
inline

◆ IsOperational()

bool MyDeviceLcsIf::IsOperational ( )
inline

◆ IsReady()

bool MyDeviceLcsIf::IsReady ( )
inline

◆ Listener()

void MyDeviceLcsIf::Listener ( ifw::core::protocol::base::VectorVariant & params)
inlinevirtual

Callback for listening controller events.

Parameters
paramslist of paramaters to be monitored.

Abstract method to be implemented by specific classes.

Reimplemented from ifw::fcf::devmgr::common::DeviceLcsIf.

◆ ReadConfig()

void MyDeviceLcsIf::ReadConfig ( )
inline

◆ StartMonitoring()

void MyDeviceLcsIf::StartMonitoring ( )
inlinevirtual

Start monitoring of controller attributes.

Exceptions
anexception if an error ocurrs.

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.

Reimplemented from ifw::fcf::devmgr::common::DeviceLcsIf.

◆ StopMonitoring()

void MyDeviceLcsIf::StopMonitoring ( )
inlinevirtual

Stop monitoring of controller attributes.

Exceptions
anexception if an error ocurrs.

This method will inform the communication interface to stop monitoring the shutter attributes. All OPCUA subscriptions will be removed.

Reimplemented from ifw::fcf::devmgr::common::DeviceLcsIf.


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