ifw
0.0.1-dev
|
Motor Local Control System (LCS) Interface (IF) class. More...
#include <motorLcsIf.hpp>
Public Member Functions | |
MotorLcsIf (std::shared_ptr< devmgr::common::IDeviceConfig > config, devmgr::common::DataContext &data_ctx) | |
MotorLcsIf constructor. More... | |
virtual bool | IsReady () |
Check if controller is in Standby/Ready state. More... | |
virtual bool | IsNotReady () |
Check if controller is in Standby/NotReady state. More... | |
virtual bool | IsOperational () |
Check if controller is in Operational. More... | |
void | ReadConfig () |
Read the configuration. More... | |
void | MoveAbs (double position, double velocity) |
Executes the MoveAbs RPC. More... | |
void | MoveRel (double position, double velocity) |
Executes the MoveRel RPC. More... | |
void | MoveVel (double velocity) |
Executes the MoveVel RPC. More... | |
virtual bool | IsDisabling () |
Check if controller is disabling the motor. More... | |
bool | IsMoving () |
Check if motor is moving. More... | |
bool | IsStandstill () |
Check if motor is on. More... | |
bool | IsHwFailure () |
Check if motor is in hardware error. More... | |
virtual void | ReadStatus (MotorControllerData &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 (int &error_code, const bool update=false) |
Get error message. More... | |
MotorLcsIf (std::shared_ptr< devmgr::common::IDeviceConfig > config, devmgr::common::DataContext &data_ctx) | |
MotorLcsIf constructor. More... | |
virtual bool | IsReady () |
Check if controller is in Standby/Ready state. More... | |
virtual bool | IsNotReady () |
Check if controller is in Standby/NotReady state. More... | |
virtual bool | IsOperational () |
Check if controller is in Operational. More... | |
void | ReadConfig () |
Read the configuration. More... | |
void | MoveAbs (double position, double velocity) |
Executes the MoveAbs RPC. More... | |
void | MoveRel (double position, double velocity) |
Executes the MoveRel RPC. More... | |
void | MoveVel (double velocity) |
Executes the MoveVel RPC. More... | |
virtual bool | IsDisabling () |
Check if controller is disabling the motor. More... | |
bool | IsMoving () |
Check if motor is moving. More... | |
bool | IsStandstill () |
Check if motor is on. More... | |
bool | IsHwFailure () |
Check if motor is in hardware error. More... | |
virtual void | ReadStatus (MotorControllerData &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 (int &error_code, const bool update=false) |
Get error message. More... | |
MotorLcsIf (std::shared_ptr< devmgr::common::IDeviceConfig > config, devmgr::common::DataContext &data_ctx) | |
MotorLcsIf constructor. More... | |
virtual bool | IsReady () |
Check if controller is in Standby/Ready state. More... | |
virtual bool | IsNotReady () |
Check if controller is in Standby/NotReady state. More... | |
virtual bool | IsOperational () |
Check if controller is in Operational. More... | |
void | ReadConfig () |
Read the configuration. More... | |
void | MoveAbs (double position, double velocity) |
Executes the MoveAbs RPC. More... | |
void | MoveRel (double position, double velocity) |
Executes the MoveRel RPC. More... | |
void | MoveVel (double velocity) |
Executes the MoveVel RPC. More... | |
virtual bool | IsDisabling () |
Check if controller is disabling the motor. More... | |
bool | IsMoving () |
Check if motor is moving. More... | |
bool | IsStandstill () |
Check if motor is on. More... | |
bool | IsHwFailure () |
Check if motor is in hardware error. More... | |
virtual void | ReadStatus (MotorControllerData &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 (int &error_code, const bool update=false) |
Get error message. 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 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 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 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... | |
Protected Attributes | |
std::unordered_map < std::string, short > | m_status_map |
std::vector< std::string > | m_monitor_vector |
![]() | |
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< IDeviceConfig > | m_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... | |
Additional Inherited Members | |
![]() | |
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... | |
Motor Local Control System (LCS) Interface (IF) class.
This class manages the motor 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.
devmgr::motor::MotorLcsIf::MotorLcsIf | ( | std::shared_ptr< devmgr::common::IDeviceConfig > | config, |
devmgr::common::DataContext & | data_ctx | ||
) |
MotorLcsIf constructor.
[in,out] | config | Shared pointer to the device configuration. |
[in,out] | data_ctx | Reference to the data context object. |
devmgr::motor::MotorLcsIf::MotorLcsIf | ( | std::shared_ptr< devmgr::common::IDeviceConfig > | config, |
devmgr::common::DataContext & | data_ctx | ||
) |
MotorLcsIf constructor.
[in,out] | config | Shared pointer to the device configuration. |
[in,out] | data_ctx | Reference to the data context object. |
devmgr::motor::MotorLcsIf::MotorLcsIf | ( | std::shared_ptr< devmgr::common::IDeviceConfig > | config, |
devmgr::common::DataContext & | data_ctx | ||
) |
MotorLcsIf constructor.
[in,out] | config | Shared pointer to the device configuration. |
[in,out] | data_ctx | Reference to the data context object. |
|
virtual |
Get error message.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Get error message.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Get error message.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
error_code | Error code |
Implements devmgr::common::DeviceLcsIf.
|
virtual |
error_code | Error code |
Implements devmgr::common::DeviceLcsIf.
|
virtual |
error_code | Error code |
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Check if controller is disabling the motor.
Reimplemented from devmgr::common::DeviceLcsIf.
|
virtual |
Check if controller is disabling the motor.
Reimplemented from devmgr::common::DeviceLcsIf.
|
virtual |
Check if controller is disabling the motor.
Reimplemented from devmgr::common::DeviceLcsIf.
|
virtual |
Check if motor is in hardware error.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Check if motor is in hardware error.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Check if motor is in hardware error.
Implements devmgr::common::DeviceLcsIf.
bool devmgr::motor::MotorLcsIf::IsMoving | ( | ) |
Check if motor is moving.
bool devmgr::motor::MotorLcsIf::IsMoving | ( | ) |
Check if motor is moving.
bool devmgr::motor::MotorLcsIf::IsMoving | ( | ) |
Check if motor is moving.
|
virtual |
Check if controller is in Standby/NotReady state.
Reimplemented from devmgr::common::DeviceLcsIf.
|
virtual |
Check if controller is in Standby/NotReady state.
Reimplemented from devmgr::common::DeviceLcsIf.
|
virtual |
Check if controller is in Standby/NotReady state.
Reimplemented from devmgr::common::DeviceLcsIf.
|
virtual |
Check if controller is in Operational.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Check if controller is in Operational.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Check if controller is in Operational.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Check if controller is in Standby/Ready state.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Check if controller is in Standby/Ready state.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Check if controller is in Standby/Ready state.
Implements devmgr::common::DeviceLcsIf.
bool devmgr::motor::MotorLcsIf::IsStandstill | ( | ) |
Check if motor is on.
bool devmgr::motor::MotorLcsIf::IsStandstill | ( | ) |
Check if motor is on.
bool devmgr::motor::MotorLcsIf::IsStandstill | ( | ) |
Check if motor is on.
|
virtual |
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.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
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.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
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.
Implements devmgr::common::DeviceLcsIf.
void devmgr::motor::MotorLcsIf::MoveAbs | ( | double | position, |
double | velocity | ||
) |
Executes the MoveAbs RPC.
an | exception if an error ocurrs. |
This RPC call make the motor move in absolute user units.
void devmgr::motor::MotorLcsIf::MoveAbs | ( | double | position, |
double | velocity | ||
) |
Executes the MoveAbs RPC.
an | exception if an error ocurrs. |
This RPC call make the motor move in absolute user units.
void devmgr::motor::MotorLcsIf::MoveAbs | ( | double | position, |
double | velocity | ||
) |
Executes the MoveAbs RPC.
an | exception if an error ocurrs. |
This RPC call make the motor move in absolute user units.
void devmgr::motor::MotorLcsIf::MoveRel | ( | double | position, |
double | velocity | ||
) |
Executes the MoveRel RPC.
an | exception if an error ocurrs. |
This RPC call make the motor move in relative user units.
void devmgr::motor::MotorLcsIf::MoveRel | ( | double | position, |
double | velocity | ||
) |
Executes the MoveRel RPC.
an | exception if an error ocurrs. |
This RPC call make the motor move in relative user units.
void devmgr::motor::MotorLcsIf::MoveRel | ( | double | position, |
double | velocity | ||
) |
Executes the MoveRel RPC.
an | exception if an error ocurrs. |
This RPC call make the motor move in relative user units.
void devmgr::motor::MotorLcsIf::MoveVel | ( | double | velocity | ) |
Executes the MoveVel RPC.
velocity | Speed in which the motor will be moved. |
an | exception if an error ocurrs. |
This RPC call make the motor move in velocity mode.
void devmgr::motor::MotorLcsIf::MoveVel | ( | double | velocity | ) |
Executes the MoveVel RPC.
velocity | Speed in which the motor will be moved. |
an | exception if an error ocurrs. |
This RPC call make the motor move in velocity mode.
void devmgr::motor::MotorLcsIf::MoveVel | ( | double | velocity | ) |
Executes the MoveVel RPC.
velocity | Speed in which the motor will be moved. |
an | exception if an error ocurrs. |
This RPC call make the motor move in velocity mode.
|
virtual |
Read the configuration.
an | exception if an error ocurrs. |
This class reads the mapping configuration of the device.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Read the configuration.
an | exception if an error ocurrs. |
This class reads the mapping configuration of the device.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Read the configuration.
an | exception if an error ocurrs. |
This class reads the mapping configuration of the device.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Read status from the controller.
status | structure containing the status of the controller. |
an | exception if an error ocurrs. |
|
virtual |
Read status from the controller.
status | structure containing the status of the controller. |
an | exception if an error ocurrs. |
|
virtual |
Read status from the controller.
status | structure containing the status of the controller. |
an | exception if an error ocurrs. |
|
virtual |
Start monitoring of controller attributes.
an | exception 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.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Start monitoring of controller attributes.
an | exception 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.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Start monitoring of controller attributes.
an | exception 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.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Stop monitoring of controller attributes.
This method will inform the communication interface to stop monitoring the motor attributes.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Stop monitoring of controller attributes.
This method will inform the communication interface to stop monitoring the motor attributes.
Implements devmgr::common::DeviceLcsIf.
|
virtual |
Stop monitoring of controller attributes.
This method will inform the communication interface to stop monitoring the motor attributes.
Implements devmgr::common::DeviceLcsIf.
|
protected |
|
protected |
< this map is used to convert NodeId received by the OPCUA notifications to an index value to avoid comparing strings for each notification. This vector is used to prepare in advance the list of nodeIds that will be monitored per device.