ifw-fcf 7.1.4
|
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 | Setup (const std::any &payload) |
Executes a setup. | |
void | Status (const std::any &payload, std::string &buffer) |
Obtain the status of the device. | |
virtual 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. | |
void | Reset () |
Executes a Reset command. | |
bool | IsSetupActive (const std::any &payload) const |
Check if setup is still active. | |
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. | |
void | CheckHwFailure () const |
Check if device is in failure state. | |
![]() | |
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 | Init () override |
Executes a Init command. | |
virtual void | Enable () override |
Executes a Enable command. | |
virtual void | Disable () override |
Executes a Disable command. | |
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. | |
![]() | |
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 | |
![]() | |
bool | IsMsgForMe (const std::string &id) const noexcept |
Check if received message id is addressed to me. | |
std::string | GetFileName () const noexcept |
DataContext & | GetDataCtx () 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. | |
![]() | |
std::string | m_filename |
device configuration filename. | |
std::string | m_name |
device ID. | |
DataContext & | m_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< DeviceConfig > | m_config |
Pointer to configuration object. | |
std::shared_ptr< DeviceLcsIf > | m_lcs_if |
Local Control System Interface. | |
|
inline |
|
inlinevirtual |
Check if device is in failure state.
an | exception if an error ocurrs. |
Reimplemented from ifw::fcf::devmgr::common::Device.
|
inline |
|
inlinevirtual |
Check if device is disablig.
Reimplemented from ifw::fcf::devmgr::common::Device.
|
inlinevirtual |
Check if device is Standby/NotReady.
Reimplemented from ifw::fcf::devmgr::common::Device.
|
inlinevirtual |
Check if device is Standby/Ready.
Reimplemented from ifw::fcf::devmgr::common::Device.
|
inlinevirtual |
Check if setup is still active.
[in] | payload | Setup message object |
This method validate if condition requested by the setup message has been achieved.
Implements ifw::fcf::devmgr::common::IDevice.
|
inlinevirtual |
Register a communication interface object.
[in] | comm_if | shared pointer to the communication interface object |
[in] | failure | dispatcher object for failure events |
[in] | normal | dispatcher 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.
Reimplemented from ifw::fcf::devmgr::common::Device.
|
inlinevirtual |
Executes a Reset command.
an | exception if an error ocurrs. |
Reimplemented from ifw::fcf::devmgr::common::Device.
|
inlinevirtual |
Executes a setup.
[in] | payload | contains the payload of the setup message. |
an | exception if an error ocurrs. |
Implements ifw::fcf::devmgr::common::IDevice.
|
inlinevirtual |
Obtain the status of the device.
end_acq | Flag to indicate is the end of the acquisition |
dictionary | Reference to the dictionary object |
fits_handle | Pointer 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.
|
inlinevirtual |
Obtain the status of the device.
payload | Status message object |
buffer | Buffer where the status will be written |
Implements ifw::fcf::devmgr::common::IDevice.
|
inlinevirtual |
Update internal status by connecting to the LCS.
Implements ifw::fcf::devmgr::common::IDevice.