ifw-fcf  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
testDeviceFacade::TestFailureDevice Class Reference
Inheritance diagram for testDeviceFacade::TestFailureDevice:
fcf::devmgr::common::Device fcf::devmgr::common::IDevice

Public Member Functions

 TestFailureDevice (const std::string &filename, const std::string &name, fcf::devmgr::common::DataContext &data_ctx)
 
void CreateObjects (std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config)
 
void RegisterComm (std::shared_ptr< fcf::common::IComm > comm_if, fcf::common::Dispatcher<> &failure, fcf::common::Dispatcher<> &normal)
 Register a communication interface object. More...
 
void UpdateStatus ()
 Update internal status by connecting to the LCS. More...
 
void Init ()
 Executes a Init command. More...
 
void Enable ()
 Executes a Enable command. More...
 
void Disable ()
 Executes a Disable command. More...
 
void Reset ()
 Executes a Reset command. More...
 
bool IsReady () const
 Check if device is Standby/Ready. More...
 
bool IsNotReady () const
 Check if device is Standby/NotReady. More...
 
void Setup (const std::any &payload)
 Executes a setup. More...
 
bool IsSetupActive (const std::any &payload) const
 Check if setup is still active. More...
 
void Status (const std::any &payload, std::string &buffer)
 Obtain the status of the device. More...
 
void Status (bool end_acq, const dit::did::Did &dictionary, std::shared_ptr< CCfits::FITS > &fits_handle)
 Obtain the status of the device. More...
 
bool IsFailure () const
 
std::shared_ptr
< fcf::devmgr::common::DeviceLcsIf
GetLcsIf () const
 Get a pointer of device LCS interface. More...
 
std::shared_ptr
< fcf::devmgr::common::IDeviceConfig
GetConfig () const
 Get a pointer of device configuration. More...
 
- Public Member Functions inherited from fcf::devmgr::common::Device
 Device (const std::string filename, const std::string name, DataContext &data_ctx)
 Device abstract class constructor. More...
 
virtual ~Device ()
 Default destructor. More...
 
virtual bool IsOperational () const override
 Check if device is Operational. More...
 
virtual void CheckHwFailure () const override
 Check if device is in failure state. More...
 
virtual bool IsDisabling () const override
 Check if device is disablig. More...
 
virtual void Stop () override
 Executes a Stop command. More...
 
void Status (DeviceControllerData *data, std::string &buffer)
 
virtual void Status (const std::string prefix, const dit::did::Did &dictionary, std::shared_ptr< CCfits::FITS > &fits_handle)
 Obtain the status of the device. More...
 
virtual void Simulate (rad::AnyEvent const &last_event) override
 Executes a Simulat. More...
 
virtual void StopSim (rad::AnyEvent const &last_event) override
 Executes a StopSim. More...
 
virtual void Ignore (rad::AnyEvent const &last_event) override
 Executes a Ignore. More...
 
virtual void StopIgn (rad::AnyEvent const &last_event) override
 Executes a StopIgn. More...
 
virtual void HwReset (rad::AnyEvent const &last_event) override
 Executes a hardware reset command. More...
 
virtual void HwInit (rad::AnyEvent const &last_event) override
 Executes a hardware init command. More...
 
virtual void HwEnable (rad::AnyEvent const &last_event) override
 Executes a hardware enable command. More...
 
virtual void HwDisable (rad::AnyEvent const &last_event) override
 Executes a hardware disable command. More...
 
virtual void StartMonitoring () override
 Start device monitoring via OPCUA subscriptions. More...
 
virtual void StopMonitoring () override
 Stop device monitoring. More...
 
virtual std::string GetName () const override
 Get device id. More...
 
- Public Member Functions inherited from fcf::devmgr::common::IDevice
virtual void CreateObjects (std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config=nullptr)=0
 Create basic objects needed by the device class. More...
 

Public Attributes

std::shared_ptr
< fcf::devmgr::common::IDeviceConfig
m_config
 
std::shared_ptr< MyDeviceLcsIfm_lcs_if
 

Additional Inherited Members

- Protected Member Functions inherited from fcf::devmgr::common::Device
bool IsMsgForMe (const std::string &id) const
 Check if received message id is addressed to me. More...
 
void UpdateDb (std::vector< std::string > attr_vector)
 Update device database. More...
 
void SetIgnore (bool flag)
 SetIgnore. More...
 
void SetSimulation (bool flag)
 SetSimulation. More...
 
void GetPrefix (const std::vector< std::string > prefix_list, std::string &prefix)
 Get prefix for writing attributes to the DB. More...
 
bool CheckNameParam (const std::any &payload)
 Determine whether paramater is included (device name). More...
 
- Protected Attributes inherited from fcf::devmgr::common::Device
std::string m_filename
 device configuration filename. More...
 
std::string m_name
 device ID. More...
 
DataContextm_data_ctx
 reference to the data context object. More...
 
fcf::common::Dispatcher m_failure
 Dispatcher for managing failures. More...
 
fcf::common::Dispatcher m_normal
 Dispatcher for managing positive events. More...
 
std::shared_ptr< DeviceConfigm_config
 Pointer to configuration object. More...
 
std::shared_ptr< DeviceLcsIfm_lcs_if
 Local Control System Interface. More...
 

Constructor & Destructor Documentation

testDeviceFacade::TestFailureDevice::TestFailureDevice ( const std::string &  filename,
const std::string &  name,
fcf::devmgr::common::DataContext data_ctx 
)
inline

Member Function Documentation

void testDeviceFacade::TestFailureDevice::CreateObjects ( std::shared_ptr< fcf::devmgr::common::IDeviceConfig config)
inline
void testDeviceFacade::TestFailureDevice::Disable ( )
inlinevirtual

Executes a Disable command.

Exceptions
anexception if an error ocurrs.

Reimplemented from fcf::devmgr::common::Device.

void testDeviceFacade::TestFailureDevice::Enable ( )
inlinevirtual

Executes a Enable command.

Exceptions
anexception if an error ocurrs.

Reimplemented from fcf::devmgr::common::Device.

std::shared_ptr<fcf::devmgr::common::IDeviceConfig> testDeviceFacade::TestFailureDevice::GetConfig ( ) const
inlinevirtual

Get a pointer of device configuration.

Returns
shared pointer of internal configuration object

Implements fcf::devmgr::common::IDevice.

std::shared_ptr<fcf::devmgr::common::DeviceLcsIf> testDeviceFacade::TestFailureDevice::GetLcsIf ( ) const
inlinevirtual

Get a pointer of device LCS interface.

Returns
shared pointer of internal LCSIf object

Implements fcf::devmgr::common::IDevice.

void testDeviceFacade::TestFailureDevice::Init ( )
inlinevirtual

Executes a Init command.

Returns
true if command is successfully executed, false otherwise.
Exceptions
anexception if an error ocurrs.

Reimplemented from fcf::devmgr::common::Device.

bool testDeviceFacade::TestFailureDevice::IsFailure ( ) const
inline
bool testDeviceFacade::TestFailureDevice::IsNotReady ( ) const
inlinevirtual

Check if device is Standby/NotReady.

Returns
true is device is Standby/NotReady, false otherwise

Reimplemented from fcf::devmgr::common::Device.

bool testDeviceFacade::TestFailureDevice::IsReady ( ) const
inlinevirtual

Check if device is Standby/Ready.

Returns
true is device is Standby/Ready, false otherwise

Reimplemented from fcf::devmgr::common::Device.

bool testDeviceFacade::TestFailureDevice::IsSetupActive ( const std::any &  payload) const
inlinevirtual

Check if setup is still active.

Parameters
[in]payloadSetup message object

This method validate if condition requested by the setup message has been achieved.

Implements fcf::devmgr::common::IDevice.

void testDeviceFacade::TestFailureDevice::RegisterComm ( std::shared_ptr< fcf::common::IComm >  comm_if,
fcf::common::Dispatcher<> &  failure,
fcf::common::Dispatcher<> &  normal 
)
inlinevirtual

Register a communication interface object.

Parameters
[in]comm_ifshared pointer to the communication interface object
[in]failuredispatcher object for failure events
[in]normaldispatcher object for recovery of failure events.

This method register a particular communication interface to the device. Most of the devices will use OPCUA but there might be several implementations so with this method one can register an interface that has been created previously and registered in the communication factory.

See Also
iComm
commFactory
commMaker

Implements fcf::devmgr::common::IDevice.

void testDeviceFacade::TestFailureDevice::Reset ( )
inlinevirtual

Executes a Reset command.

Exceptions
anexception if an error ocurrs.

Reimplemented from fcf::devmgr::common::Device.

void testDeviceFacade::TestFailureDevice::Setup ( const std::any &  payload)
inlinevirtual

Executes a setup.

Parameters
[in]payloadcontains the payload of the setup message.
Exceptions
anexception if an error ocurrs.

Implements fcf::devmgr::common::IDevice.

void testDeviceFacade::TestFailureDevice::Status ( const std::any &  payload,
std::string &  buffer 
)
inlinevirtual

Obtain the status of the device.

Parameters
payloadStatus message object
bufferBuffer where the status will be written

Implements fcf::devmgr::common::IDevice.

void testDeviceFacade::TestFailureDevice::Status ( bool  end_acq,
const dit::did::Did &  dictionary,
std::shared_ptr< CCfits::FITS > &  fits_handle 
)
inlinevirtual

Obtain the status of the device.

Parameters
end_acqFlag to indicate is the end of the acquisition
dictionaryReference to the dictionary object
fits_handlePointer to the CCFITS object

This method will obtain the data from each device and add the corresponding meta-data to the CCfits object. If the end_acq is not true it will just register the start of the acquisition.

Implements fcf::devmgr::common::IDevice.

void testDeviceFacade::TestFailureDevice::UpdateStatus ( )
inlinevirtual

Update internal status by connecting to the LCS.

Implements fcf::devmgr::common::IDevice.

Member Data Documentation

std::shared_ptr<fcf::devmgr::common::IDeviceConfig> testDeviceFacade::TestFailureDevice::m_config
std::shared_ptr<MyDeviceLcsIf> testDeviceFacade::TestFailureDevice::m_lcs_if

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