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

Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from ifw::fcf::devmgr::common::Device
bool IsMsgForMe (const std::string &id) const noexcept
 Check if received message id is addressed to me.
 
std::string GetFileName () const noexcept
 
DataContextGetDataCtx () const noexcept
 
void UpdateDb (ifw::core::utils::bat::DbVector &vec)
 Update device database.
 
void SetIgnore (bool flag)
 SetIgnore.
 
void SetSimulation (bool flag)
 SetSimulation.
 
void GetPrefix (const std::vector< std::string > prefix_list, std::string &prefix) const
 Get prefix for writing attributes to the DB.
 
std::string GetCfgPrefix (const std::vector< std::string > prefix_list) const
 
std::string GetStatPrefix (const std::vector< std::string > prefix_list) const
 
bool CheckNameParam (const std::any &payload)
 Determine whether paramater is included (device name).
 
void GetStatusList (ifw::core::utils::bat::DbVector &cfg_list, const DeviceControllerData &status)
 
virtual void WriteConfig ()
 Write configuration into OLDB.
 
- Protected Attributes inherited from ifw::fcf::devmgr::common::Device
std::string m_filename
 device configuration filename.
 
std::string m_name
 device ID.
 
DataContextm_data_ctx
 reference to the data context object.
 
ifw::core::protocol::base::Dispatcher m_failure
 Dispatcher for managing failures.
 
ifw::core::protocol::base::Dispatcher m_normal
 Dispatcher for managing positive events.
 
std::shared_ptr< DeviceConfigm_config
 Pointer to configuration object.
 
std::shared_ptr< DeviceLcsIfm_lcs_if
 Local Control System Interface.
 

Constructor & Destructor Documentation

◆ TestMyDevice()

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

Member Function Documentation

◆ CreateObjects()

void testDeviceFacade::TestMyDevice::CreateObjects ( std::shared_ptr< ifw::fcf::devmgr::common::IDeviceConfig > config)
inline

◆ Disable()

void testDeviceFacade::TestMyDevice::Disable ( )
inlinevirtual

Executes a Disable command.

Exceptions
anexception if an error ocurrs.

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

◆ Enable()

void testDeviceFacade::TestMyDevice::Enable ( )
inlinevirtual

Executes a Enable command.

Exceptions
anexception if an error ocurrs.

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

◆ GetConfig()

std::shared_ptr< ifw::fcf::devmgr::common::IDeviceConfig > testDeviceFacade::TestMyDevice::GetConfig ( ) const
inlinevirtualnoexcept

Get a pointer of device configuration.

Returns
shared pointer of internal configuration object

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

◆ GetLcsIf()

std::shared_ptr< ifw::fcf::devmgr::common::DeviceLcsIf > testDeviceFacade::TestMyDevice::GetLcsIf ( ) const
inlinevirtualnoexcept
Returns
pointer to lcs interface object.

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

◆ Init()

void testDeviceFacade::TestMyDevice::Init ( )
inlinevirtual

Executes a Init command.

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

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

◆ IsDisabling()

bool testDeviceFacade::TestMyDevice::IsDisabling ( ) const
inlinevirtual

Check if device is disablig.

Returns
true if device is disabling, false otherwise

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

◆ IsFailure()

bool testDeviceFacade::TestMyDevice::IsFailure ( ) const
inline

◆ IsNotReady()

bool testDeviceFacade::TestMyDevice::IsNotReady ( ) const
inlinevirtual

Check if device is Standby/NotReady.

Returns
true is device is Standby/NotReady, false otherwise

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

◆ IsReady()

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

Check if device is Standby/Ready.

Returns
true is device is Standby/Ready, false otherwise

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

◆ IsSetupActive()

bool testDeviceFacade::TestMyDevice::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 ifw::fcf::devmgr::common::IDevice.

◆ RegisterComm()

void testDeviceFacade::TestMyDevice::RegisterComm ( std::shared_ptr< ifw::core::protocol::base::IComm > comm_if,
ifw::core::protocol::base::Dispatcher<> & failure,
ifw::core::protocol::base::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. 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

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

◆ Reset()

void testDeviceFacade::TestMyDevice::Reset ( )
inlinevirtual

Executes a Reset command.

Exceptions
anexception if an error ocurrs.

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

◆ Setup()

void testDeviceFacade::TestMyDevice::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 ifw::fcf::devmgr::common::IDevice.

◆ Status() [1/2]

void testDeviceFacade::TestMyDevice::Status ( bool end_acq,
const ifw::core::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 ifw::fcf::devmgr::common::IDevice.

◆ Status() [2/2]

void testDeviceFacade::TestMyDevice::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 ifw::fcf::devmgr::common::IDevice.

◆ UpdateStatus()

void testDeviceFacade::TestMyDevice::UpdateStatus ( )
inlinevirtual

Update internal status by connecting to the LCS.

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


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