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

Public Member Functions

 TestMyDevice (const std::string filename, const std::string name, devmgr::common::DataContext &data_ctx)
 
void CreateObjects (std::shared_ptr< 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 ()
 UpdateStatus. More...
 
void Setup (const modif::ReqSetup &setupMsg)
 Executes a setup. More...
 
void Status (const modif::ReqStatus &statusMsg, std::string &buffer)
 Obtain the status of the device. More...
 
virtual void Status (bool end_acq, const dit::did::Did &dictionary, CCfits::FITS *fits_handle)
 Obtain the status of the device. More...
 
void Reset ()
 Executes a Reset command. More...
 
bool IsSetupActive (const modif::ReqSetup &setupMsg) const
 Check if setup is still active. More...
 
bool IsReady () const
 Check if device is Standby/Ready. More...
 
bool IsNotReady () const
 Check if device is Standby/NotReady. More...
 
bool IsDisabling () const
 Check if device is disablig. More...
 
void CheckHwFailure () const
 Check if device is in failure state. More...
 
std::shared_ptr
< devmgr::common::DeviceLcsIf
GetLcsIf () const
 Get a pointer of device LCS interface. More...
 
std::shared_ptr
< devmgr::common::IDeviceConfig
GetConfig () const
 Get a pointer of device configuration. More...
 
- Public Member Functions inherited from 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
 Check if device is Operational. More...
 
virtual void Init ()
 Executes a Init command. More...
 
virtual void Enable ()
 Executes a Enable command. More...
 
virtual void Disable ()
 Executes a Disable command. More...
 
virtual void Stop ()
 Executes a Stop command. More...
 
virtual void HwReset (modif::ReqHwReset &hwResetMsg)
 Executes a hardware reset command. More...
 
virtual void HwInit (modif::ReqHwInit &hwInitMsg)
 Executes a hardware init command. More...
 
virtual void HwEnable (modif::ReqHwEnable &hwEnableMsg)
 Executes a hardware enable command. More...
 
virtual void HwDisable (modif::ReqHwDisable &hwDisableMsg)
 Executes a hardware disable command. More...
 
virtual void Simulate (const modif::ReqSimulate &msg)
 Executes a Simulat. More...
 
virtual void StopSim (const modif::ReqStopSim &msg)
 Executes a StopSim. More...
 
virtual void Ignore (const modif::ReqIgnore &msg)
 Executes a Ignore. More...
 
virtual void StopIgn (const modif::ReqStopIgn &msg)
 Executes a StopIgn. More...
 
virtual void StartMonitoring ()
 Start device monitoring via OPCUA subscriptions. More...
 
virtual void StopMonitoring ()
 Stop device monitoring. More...
 
virtual std::string GetName () const
 Get device id. More...
 
 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
 Check if device is Operational. More...
 
virtual void Init ()
 Executes a Init command. More...
 
virtual void Enable ()
 Executes a Enable command. More...
 
virtual void Disable ()
 Executes a Disable command. More...
 
virtual void Stop ()
 Executes a Stop command. More...
 
virtual void HwReset (modif::ReqHwReset &hwResetMsg)
 Executes a hardware reset command. More...
 
virtual void HwInit (modif::ReqHwInit &hwInitMsg)
 Executes a hardware init command. More...
 
virtual void HwEnable (modif::ReqHwEnable &hwEnableMsg)
 Executes a hardware enable command. More...
 
virtual void HwDisable (modif::ReqHwDisable &hwDisableMsg)
 Executes a hardware disable command. More...
 
virtual void Simulate (const modif::ReqSimulate &msg)
 Executes a Simulat. More...
 
virtual void StopSim (const modif::ReqStopSim &msg)
 Executes a StopSim. More...
 
virtual void Ignore (const modif::ReqIgnore &msg)
 Executes a Ignore. More...
 
virtual void StopIgn (const modif::ReqStopIgn &msg)
 Executes a StopIgn. More...
 
virtual void StartMonitoring ()
 Start device monitoring via OPCUA subscriptions. More...
 
virtual void StopMonitoring ()
 Stop device monitoring. More...
 
virtual std::string GetName () const
 Get device id. More...
 
 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
 Check if device is Operational. More...
 
virtual void Init ()
 Executes a Init command. More...
 
virtual void Enable ()
 Executes a Enable command. More...
 
virtual void Disable ()
 Executes a Disable command. More...
 
virtual void Stop ()
 Executes a Stop command. More...
 
virtual void HwReset (modif::ReqHwReset &hwResetMsg)
 Executes a hardware reset command. More...
 
virtual void HwInit (modif::ReqHwInit &hwInitMsg)
 Executes a hardware init command. More...
 
virtual void HwEnable (modif::ReqHwEnable &hwEnableMsg)
 Executes a hardware enable command. More...
 
virtual void HwDisable (modif::ReqHwDisable &hwDisableMsg)
 Executes a hardware disable command. More...
 
virtual void Simulate (const modif::ReqSimulate &msg)
 Executes a Simulat. More...
 
virtual void StopSim (const modif::ReqStopSim &msg)
 Executes a StopSim. More...
 
virtual void Ignore (const modif::ReqIgnore &msg)
 Executes a Ignore. More...
 
virtual void StopIgn (const modif::ReqStopIgn &msg)
 Executes a StopIgn. More...
 
virtual void StartMonitoring ()
 Start device monitoring via OPCUA subscriptions. More...
 
virtual void StopMonitoring ()
 Stop device monitoring. More...
 
virtual std::string GetName () const
 Get device id. More...
 
- Public Member Functions inherited from devmgr::common::IDevice
virtual void CreateObjects (std::shared_ptr< devmgr::common::IDeviceConfig > config=nullptr)=0
 Create basic objects needed by the device class. More...
 
virtual void CreateObjects (std::shared_ptr< devmgr::common::IDeviceConfig > config=nullptr)=0
 Create basic objects needed by the device class. More...
 
virtual void CreateObjects (std::shared_ptr< devmgr::common::IDeviceConfig > config=nullptr)=0
 Create basic objects needed by the device class. More...
 

Public Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from 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 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 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...
 
- Protected Attributes inherited from 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
 
fcf::common::Dispatcher m_normal
 
std::shared_ptr< DeviceConfigm_config
 
std::shared_ptr< DeviceLcsIfm_lcs_if
 

Constructor & Destructor Documentation

TestMyDevice::TestMyDevice ( const std::string  filename,
const std::string  name,
devmgr::common::DataContext data_ctx 
)
inline

Member Function Documentation

void TestMyDevice::CheckHwFailure ( ) const
inlinevirtual

Check if device is in failure state.

Exceptions
anexception if an error ocurrs.

Reimplemented from devmgr::common::Device.

void TestMyDevice::CreateObjects ( std::shared_ptr< devmgr::common::IDeviceConfig config)
inline
std::shared_ptr<devmgr::common::IDeviceConfig> TestMyDevice::GetConfig ( ) const
inlinevirtual

Get a pointer of device configuration.

Returns
shared pointer of internal configuration object

Implements devmgr::common::Device.

std::shared_ptr<devmgr::common::DeviceLcsIf> TestMyDevice::GetLcsIf ( ) const
inlinevirtual

Get a pointer of device LCS interface.

Returns
shared pointer of internal LCSIf object

Implements devmgr::common::Device.

bool TestMyDevice::IsDisabling ( ) const
inlinevirtual

Check if device is disablig.

Returns
true if device is disabling, false otherwise

Reimplemented from devmgr::common::Device.

bool TestMyDevice::IsNotReady ( ) const
inlinevirtual

Check if device is Standby/NotReady.

Returns
true is device is Standby/NotReady, false otherwise

Reimplemented from devmgr::common::Device.

bool TestMyDevice::IsReady ( ) const
inlinevirtual

Check if device is Standby/Ready.

Returns
true is device is Standby/Ready, false otherwise

Reimplemented from devmgr::common::Device.

bool TestMyDevice::IsSetupActive ( const modif::ReqSetup setupMsg) const
inlinevirtual

Check if setup is still active.

Parameters
[in]setupMsgSetup message object

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

Implements devmgr::common::Device.

void TestMyDevice::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 devmgr::common::Device.

void TestMyDevice::Reset ( )
inlinevirtual

Executes a Reset command.

Exceptions
anexception if an error ocurrs.

Reimplemented from devmgr::common::Device.

void TestMyDevice::Setup ( const modif::ReqSetup setupMsg)
inlinevirtual

Executes a setup.

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

Implements devmgr::common::Device.

void TestMyDevice::Status ( const modif::ReqStatus statusMsg,
std::string &  buffer 
)
inlinevirtual

Obtain the status of the device.

Parameters
statusMsgStatus message object
bufferBuffer where the status will be written

Implements devmgr::common::Device.

virtual void TestMyDevice::Status ( bool  end_acq,
const dit::did::Did dictionary,
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 devmgr::common::Device.

void TestMyDevice::UpdateStatus ( )
inlinevirtual

UpdateStatus.

Implements devmgr::common::Device.

Member Data Documentation

std::shared_ptr<devmgr::common::IDeviceConfig> TestMyDevice::m_config
std::shared_ptr<MyDeviceLcsIf> TestMyDevice::m_lcs_if

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