ifw-fcf
5.0.0-pre2
|
Public Member Functions | |
TestMyDevice (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< protocol::base::IComm > comm_if, protocol::base::Dispatcher<> &failure, protocol::base::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... | |
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 core::dit::did::Did &dictionary, std::shared_ptr< CCfits::FITS > &fits_handle) |
Obtain the status of the device. 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... | |
bool | IsFailure () const |
std::shared_ptr< fcf::devmgr::common::DeviceLcsIf > | GetLcsIf () const noexcept |
std::shared_ptr< fcf::devmgr::common::IDeviceConfig > | GetConfig () const noexcept |
Get a pointer of device configuration. 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 override |
Check if device is Operational. More... | |
virtual void | CheckHwFailure () const override |
Check if device is in failure state. More... | |
virtual void | Stop () override |
Executes a Stop command. More... | |
virtual void | GetStatusBuffer (const std::string &stat_prefix, const DeviceControllerData *const data, std::string &buffer) |
void | GetStatusHeader (const std::string &prefix, const core::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 noexcept override |
Get device id. More... | |
virtual std::string | GetLogName () const noexcept |
Get device id for logging purposes. More... | |
![]() | |
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< MyDeviceLcsIf > | m_lcs_if |
Additional Inherited Members | |
![]() | |
bool | IsMsgForMe (const std::string &id) const noexcept |
Check if received message id is addressed to me. More... | |
void | UpdateDb (utils::bat::DbVector &vec) |
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) const |
Get prefix for writing attributes to the DB. More... | |
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). More... | |
void | GetStatusList (utils::bat::DbVector &cfg_list, const DeviceControllerData &status) |
virtual void | WriteConfig () |
Write configuration into OLDB. More... | |
![]() | |
std::string | m_filename |
device configuration filename. More... | |
std::string | m_name |
device ID. More... | |
DataContext & | m_data_ctx |
reference to the data context object. More... | |
protocol::base::Dispatcher | m_failure |
Dispatcher for managing failures. More... | |
protocol::base::Dispatcher | m_normal |
Dispatcher for managing positive events. More... | |
std::shared_ptr< DeviceConfig > | m_config |
Pointer to configuration object. More... | |
std::shared_ptr< DeviceLcsIf > | m_lcs_if |
Local Control System Interface. More... | |
|
inline |
|
inline |
|
inlinevirtual |
Executes a Disable command.
an | exception if an error ocurrs. |
Reimplemented from fcf::devmgr::common::Device.
|
inlinevirtual |
Executes a Enable command.
an | exception if an error ocurrs. |
Reimplemented from fcf::devmgr::common::Device.
|
inlinevirtualnoexcept |
Get a pointer of device configuration.
Reimplemented from fcf::devmgr::common::Device.
|
inlinevirtualnoexcept |
Reimplemented from fcf::devmgr::common::Device.
|
inlinevirtual |
Executes a Init command.
an | exception if an error ocurrs. |
Reimplemented from fcf::devmgr::common::Device.
|
inlinevirtual |
Check if device is disablig.
Reimplemented from fcf::devmgr::common::Device.
|
inline |
|
inlinevirtual |
Check if device is Standby/NotReady.
Reimplemented from fcf::devmgr::common::Device.
|
inlinevirtual |
Check if device is Standby/Ready.
Reimplemented from 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 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 fcf::devmgr::common::Device.
|
inlinevirtual |
Executes a Reset command.
an | exception if an error ocurrs. |
Reimplemented from fcf::devmgr::common::Device.
|
inlinevirtual |
Executes a setup.
[in] | payload | contains the payload of the setup message. |
an | exception if an error ocurrs. |
Implements 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 fcf::devmgr::common::IDevice.
|
inlinevirtual |
Obtain the status of the device.
payload | Status message object |
buffer | Buffer where the status will be written |
Implements fcf::devmgr::common::IDevice.
|
inlinevirtual |
Update internal status by connecting to the LCS.
Implements fcf::devmgr::common::IDevice.
std::shared_ptr<fcf::devmgr::common::IDeviceConfig> testDeviceFacade::TestMyDevice::m_config |
std::shared_ptr<MyDeviceLcsIf> testDeviceFacade::TestMyDevice::m_lcs_if |