ifw-fcf  5.0.0-pre2
Public Member Functions | List of all members
fcf::devmgr::common::IDevice Class Referenceabstract

#include <iDevice.hpp>

Inheritance diagram for fcf::devmgr::common::IDevice:
MockIDevice fcf::devmgr::common::Device TestMyDevice TestShutter fcf::devmgr::actuator::Actuator fcf::devmgr::adc::Adc fcf::devmgr::iodev::IODev fcf::devmgr::motor::Motor fcf::devmgr::piezo::Piezo fcf::devmgr::shutter::Shutter fcf::devmgr::smaract::Smaract testDeviceFacade::TestFailureDevice testDeviceFacade::TestMyDevice

Public Member Functions

virtual void CreateObjects (std::shared_ptr< fcf::devmgr::common::IDeviceConfig > config=nullptr)=0
 Create basic objects needed by the device class. More...
 
virtual void RegisterComm (std::shared_ptr< protocol::base::IComm > comm_if, protocol::base::Dispatcher<> &failure, protocol::base::Dispatcher<> &normal)=0
 Register a communication interface object. More...
 
virtual bool IsNotReady () const =0
 Check if device is Standby/NotReady. More...
 
virtual bool IsReady () const =0
 Check if device is Standby/Ready. More...
 
virtual bool IsOperational () const =0
 Check if device is Operational. More...
 
virtual void CheckHwFailure () const =0
 Check if device is in failure state. More...
 
virtual bool IsDisabling () const =0
 Check if device is disablig. More...
 
virtual void Init ()=0
 Executes a Init command. More...
 
virtual void Enable ()=0
 Executes a Enable command. More...
 
virtual void Disable ()=0
 Executes a Disable command. More...
 
virtual void Stop ()=0
 Executes a Stop command. More...
 
virtual void Reset ()=0
 Executes a Reset command. More...
 
virtual void UpdateStatus ()=0
 Update internal status by connecting to the LCS. More...
 
virtual void Setup (const std::any &payload)=0
 Executes a setup. More...
 
virtual bool IsSetupActive (const std::any &payload) const =0
 Check if setup is still active. More...
 
virtual void Status (const std::any &payload, std::string &buffer)=0
 Obtain the status of the device. More...
 
virtual void Status (bool end_acq, const core::dit::did::Did &dictionary, std::shared_ptr< CCfits::FITS > &fits_handle)=0
 Obtain the status of the device. More...
 
virtual void Simulate (rad::AnyEvent const &last_event)=0
 Executes a Simulat. More...
 
virtual void StopSim (rad::AnyEvent const &last_event)=0
 Executes a StopSim. More...
 
virtual void Ignore (rad::AnyEvent const &last_event)=0
 Executes a Ignore. More...
 
virtual void StopIgn (rad::AnyEvent const &last_event)=0
 Executes a StopIgn. More...
 
virtual void HwReset (rad::AnyEvent const &last_event)=0
 Executes a hardware reset command. More...
 
virtual void HwInit (rad::AnyEvent const &last_event)=0
 Executes a hardware init command. More...
 
virtual void HwEnable (rad::AnyEvent const &last_event)=0
 Executes a hardware enable command. More...
 
virtual void HwDisable (rad::AnyEvent const &last_event)=0
 Executes a hardware disable command. More...
 
virtual std::shared_ptr< DeviceLcsIfGetLcsIf () const noexcept=0
 Get a pointer of device LCS interface. More...
 
virtual std::shared_ptr< IDeviceConfigGetConfig () const =0
 Get a pointer of device configuration. More...
 
virtual void StartMonitoring ()=0
 Start device monitoring via OPCUA subscriptions. More...
 
virtual void StopMonitoring ()=0
 Stop device monitoring. More...
 
virtual void WriteConfig ()=0
 Write configuration into OLDB. More...
 
virtual std::string GetName () const noexcept=0
 Get device name. More...
 

Detailed Description

Device abstract class. This class represents the basic implementation of a device class. Most of the device share common properties and behavioural aspects. This class is implementing the common behaviour and defining the basic properties, as well as declaring the abstracts methods that need to be implemented by derived classes.

Member Function Documentation

◆ CheckHwFailure()

virtual void fcf::devmgr::common::IDevice::CheckHwFailure ( ) const
pure virtual

Check if device is in failure state.

Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device, and TestMyDevice.

◆ CreateObjects()

virtual void fcf::devmgr::common::IDevice::CreateObjects ( std::shared_ptr< fcf::devmgr::common::IDeviceConfig config = nullptr)
pure virtual

Create basic objects needed by the device class.

Parameters
configShared pointer to configuration object

◆ Disable()

virtual void fcf::devmgr::common::IDevice::Disable ( )
pure virtual

Executes a Disable command.

Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device, testDeviceFacade::TestFailureDevice, and testDeviceFacade::TestMyDevice.

◆ Enable()

virtual void fcf::devmgr::common::IDevice::Enable ( )
pure virtual

Executes a Enable command.

Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device, testDeviceFacade::TestFailureDevice, and testDeviceFacade::TestMyDevice.

◆ GetConfig()

virtual std::shared_ptr<IDeviceConfig> fcf::devmgr::common::IDevice::GetConfig ( ) const
pure virtual

Get a pointer of device configuration.

Returns
shared pointer of internal configuration object

Implemented in TestMyDevice, testDeviceFacade::TestFailureDevice, testDeviceFacade::TestMyDevice, TestShutter, and fcf::devmgr::common::Device.

◆ GetLcsIf()

virtual std::shared_ptr<DeviceLcsIf> fcf::devmgr::common::IDevice::GetLcsIf ( ) const
pure virtualnoexcept

Get a pointer of device LCS interface.

Returns
shared pointer of internal LCSIf object

Implemented in TestMyDevice, testDeviceFacade::TestFailureDevice, testDeviceFacade::TestMyDevice, TestShutter, and fcf::devmgr::common::Device.

◆ GetName()

virtual std::string fcf::devmgr::common::IDevice::GetName ( ) const
pure virtualnoexcept

Get device name.

Implemented in fcf::devmgr::common::Device.

◆ HwDisable()

virtual void fcf::devmgr::common::IDevice::HwDisable ( rad::AnyEvent const last_event)
pure virtual

Executes a hardware disable command.

Parameters
[in]last_eventpayload of the hw disable message
Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device.

◆ HwEnable()

virtual void fcf::devmgr::common::IDevice::HwEnable ( rad::AnyEvent const last_event)
pure virtual

Executes a hardware enable command.

Parameters
[in]last_eventpayload of the hw enable message
Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device.

◆ HwInit()

virtual void fcf::devmgr::common::IDevice::HwInit ( rad::AnyEvent const last_event)
pure virtual

Executes a hardware init command.

Parameters
[in]last_eventpayload of the hw init message
Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device.

◆ HwReset()

virtual void fcf::devmgr::common::IDevice::HwReset ( rad::AnyEvent const last_event)
pure virtual

Executes a hardware reset command.

Parameters
[in]last_eventpayload of the hw reset message
Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device.

◆ Ignore()

virtual void fcf::devmgr::common::IDevice::Ignore ( rad::AnyEvent const last_event)
pure virtual

Executes a Ignore.

Parameters
[in]last_eventcontains the payload of the Ignore message.
Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device.

◆ Init()

virtual void fcf::devmgr::common::IDevice::Init ( )
pure virtual

Executes a Init command.

Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device, testDeviceFacade::TestFailureDevice, and testDeviceFacade::TestMyDevice.

◆ IsDisabling()

virtual bool fcf::devmgr::common::IDevice::IsDisabling ( ) const
pure virtual

Check if device is disablig.

Returns
true if device is disabling, false otherwise

Implemented in fcf::devmgr::common::Device, TestMyDevice, and testDeviceFacade::TestMyDevice.

◆ IsNotReady()

virtual bool fcf::devmgr::common::IDevice::IsNotReady ( ) const
pure virtual

◆ IsOperational()

virtual bool fcf::devmgr::common::IDevice::IsOperational ( ) const
pure virtual

Check if device is Operational.

Returns
true is device is Operational, false otherwise

Implemented in fcf::devmgr::common::Device.

◆ IsReady()

virtual bool fcf::devmgr::common::IDevice::IsReady ( ) const
pure virtual

Check if device is Standby/Ready.

Returns
true is device is Standby/Ready, false otherwise

Implemented in fcf::devmgr::common::Device, TestMyDevice, testDeviceFacade::TestFailureDevice, and testDeviceFacade::TestMyDevice.

◆ IsSetupActive()

virtual bool fcf::devmgr::common::IDevice::IsSetupActive ( const std::any &  payload) const
pure virtual

◆ RegisterComm()

virtual void fcf::devmgr::common::IDevice::RegisterComm ( std::shared_ptr< protocol::base::IComm >  comm_if,
protocol::base::Dispatcher<> &  failure,
protocol::base::Dispatcher<> &  normal 
)
pure virtual

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

Implemented in TestMyDevice, testDeviceFacade::TestFailureDevice, testDeviceFacade::TestMyDevice, TestShutter, and fcf::devmgr::common::Device.

◆ Reset()

virtual void fcf::devmgr::common::IDevice::Reset ( )
pure virtual

Executes a Reset command.

Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device, TestMyDevice, testDeviceFacade::TestFailureDevice, testDeviceFacade::TestMyDevice, and TestShutter.

◆ Setup()

virtual void fcf::devmgr::common::IDevice::Setup ( const std::any &  payload)
pure virtual

◆ Simulate()

virtual void fcf::devmgr::common::IDevice::Simulate ( rad::AnyEvent const last_event)
pure virtual

Executes a Simulat.

Parameters
[in]last_eventcontains the payload of the Simulat message.
Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device.

◆ StartMonitoring()

virtual void fcf::devmgr::common::IDevice::StartMonitoring ( )
pure virtual

Start device monitoring via OPCUA subscriptions.

Implemented in fcf::devmgr::common::Device.

◆ Status() [1/2]

virtual void fcf::devmgr::common::IDevice::Status ( bool  end_acq,
const core::dit::did::Did &  dictionary,
std::shared_ptr< CCfits::FITS > &  fits_handle 
)
pure virtual

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.

Implemented in fcf::devmgr::smaract::Smaract, fcf::devmgr::shutter::Shutter, fcf::devmgr::piezo::Piezo, fcf::devmgr::motor::Motor, fcf::devmgr::lamp::Lamp, fcf::devmgr::iodev::IODev, fcf::devmgr::drot::Drot, fcf::devmgr::adc::Adc, fcf::devmgr::actuator::Actuator, TestMyDevice, testDeviceFacade::TestFailureDevice, testDeviceFacade::TestMyDevice, and TestShutter.

◆ Status() [2/2]

virtual void fcf::devmgr::common::IDevice::Status ( const std::any &  payload,
std::string &  buffer 
)
pure virtual

◆ Stop()

virtual void fcf::devmgr::common::IDevice::Stop ( )
pure virtual

Executes a Stop command.

Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device.

◆ StopIgn()

virtual void fcf::devmgr::common::IDevice::StopIgn ( rad::AnyEvent const last_event)
pure virtual

Executes a StopIgn.

Parameters
[in]last_eventcontains the payload of the StopIgn message.
Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device.

◆ StopMonitoring()

virtual void fcf::devmgr::common::IDevice::StopMonitoring ( )
pure virtual

Stop device monitoring.

Implemented in fcf::devmgr::common::Device.

◆ StopSim()

virtual void fcf::devmgr::common::IDevice::StopSim ( rad::AnyEvent const last_event)
pure virtual

Executes a StopSim.

Parameters
[in]last_eventcontains the payload of the StopSim message.
Exceptions
anexception if an error ocurrs.

Implemented in fcf::devmgr::common::Device.

◆ UpdateStatus()

virtual void fcf::devmgr::common::IDevice::UpdateStatus ( )
pure virtual

◆ WriteConfig()

virtual void fcf::devmgr::common::IDevice::WriteConfig ( )
pure virtual

Write configuration into OLDB.

Implemented in fcf::devmgr::common::Device.


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