|
ifw-fcf
2.0.0
|
#include <device.hpp>
Public Member Functions | |
| Device (const std::string filename, const std::string name, DataContext &data_ctx) | |
| Device abstract class constructor. More... | |
| virtual | ~Device () |
| Default destructor. More... | |
| virtual bool | IsNotReady () const override |
| Check if device is Standby/NotReady. More... | |
| virtual bool | IsReady () const override |
| Check if device is Standby/Ready. 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 bool | IsDisabling () const override |
| Check if device is disablig. More... | |
| virtual void | Init () override |
| Executes a Init command. More... | |
| virtual void | Enable () override |
| Executes a Enable command. More... | |
| virtual void | Disable () override |
| Executes a Disable command. More... | |
| virtual void | Stop () override |
| Executes a Stop command. More... | |
| virtual void | Reset () override |
| Executes a Reset command. More... | |
| void | Status (DeviceControllerData *data, std::string &buffer) |
| virtual void | Status (const std::string prefix, const 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 override |
| Get device id. More... | |
Public Member Functions inherited from fcf::devmgr::common::IDevice | |
| 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< fcf::common::IComm > comm_if, fcf::common::Dispatcher<> &failure, fcf::common::Dispatcher<> &normal)=0 |
| Register a communication interface object. 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 dit::did::Did &dictionary, std::shared_ptr< CCfits::FITS > &fits_handle)=0 |
| Obtain the status of the device. More... | |
| virtual std::shared_ptr < DeviceLcsIf > | GetLcsIf () const =0 |
| Get a pointer of device LCS interface. More... | |
| virtual std::shared_ptr < IDeviceConfig > | GetConfig () const =0 |
| Get a pointer of device configuration. More... | |
Protected Member Functions | |
| 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 | CheckNameParam (const std::any &payload) |
| Determine whether paramater is included (device name). More... | |
Protected Attributes | |
| 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... | |
| fcf::common::Dispatcher | m_failure |
| Dispatcher for managing failures. More... | |
| fcf::common::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... | |
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 of all device classes.
| fcf::devmgr::common::Device::Device | ( | const std::string | filename, |
| const std::string | name, | ||
| DataContext & | data_ctx | ||
| ) |
|
virtual |
Default destructor.
|
overridevirtual |
Check if device is in failure state.
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
Reimplemented in TestMyDevice.
|
protected |
Determine whether paramater is included (device name).
| payload | Payload of the command, a vector of strings. |
If the vector is empty, it will return true. If the vector contains the the id of the device it will also return true otherwise it will return false.
|
overridevirtual |
Executes a Disable command.
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
Reimplemented in testDeviceFacade::TestFailureDevice, testDeviceFacade::TestMyDevice, and fcf::devmgr::sensor::Sensor.
|
overridevirtual |
Executes a Enable command.
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
Reimplemented in testDeviceFacade::TestFailureDevice, testDeviceFacade::TestMyDevice, and fcf::devmgr::sensor::Sensor.
|
overridevirtual |
Get device id.
Implements fcf::devmgr::common::IDevice.
|
protected |
Get prefix for writing attributes to the DB.
| prefix_list | List of intermediate prefix values. |
| prefix | String containing the formatted prefix. |
|
overridevirtual |
Executes a hardware disable command.
| [in] | last_event | payload of the hw disable message |
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
Reimplemented in fcf::devmgr::sensor::Sensor.
|
overridevirtual |
Executes a hardware enable command.
| [in] | last_event | payload of the hw enable message |
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
Reimplemented in fcf::devmgr::sensor::Sensor.
|
overridevirtual |
Executes a hardware init command.
| [in] | last_event | payload of the hw init message |
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
Reimplemented in fcf::devmgr::sensor::Sensor.
|
overridevirtual |
Executes a hardware reset command.
| [in] | last_event | payload of the hw reset message |
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
Reimplemented in fcf::devmgr::sensor::Sensor.
|
overridevirtual |
Executes a Ignore.
| [in] | last_event | contains the payload of the Ignore message. |
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
|
overridevirtual |
Executes a Init command.
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
Reimplemented in testDeviceFacade::TestFailureDevice, and testDeviceFacade::TestMyDevice.
|
overridevirtual |
Check if device is disablig.
Implements fcf::devmgr::common::IDevice.
Reimplemented in testDeviceFacade::TestMyDevice, TestMyDevice, and fcf::devmgr::sensor::Sensor.
|
protected |
Check if received message id is addressed to me.
| [in] | id | message id |
|
overridevirtual |
Check if device is Standby/NotReady.
Implements fcf::devmgr::common::IDevice.
Reimplemented in testDeviceFacade::TestFailureDevice, testDeviceFacade::TestMyDevice, and TestMyDevice.
|
overridevirtual |
Check if device is Operational.
Implements fcf::devmgr::common::IDevice.
|
overridevirtual |
Check if device is Standby/Ready.
Implements fcf::devmgr::common::IDevice.
Reimplemented in testDeviceFacade::TestFailureDevice, testDeviceFacade::TestMyDevice, and TestMyDevice.
|
overridevirtual |
Executes a Reset command.
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
Reimplemented in testDeviceFacade::TestFailureDevice, testDeviceFacade::TestMyDevice, TestMyDevice, and TestShutter.
|
protected |
SetIgnore.
| flag |
|
protected |
SetSimulation.
| flag |
|
overridevirtual |
Executes a Simulat.
| [in] | last_event | contains the payload of the Simulat message. |
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
|
overridevirtual |
Start device monitoring via OPCUA subscriptions.
Implements fcf::devmgr::common::IDevice.
| void fcf::devmgr::common::Device::Status | ( | DeviceControllerData * | data, |
| std::string & | buffer | ||
| ) |
|
virtual |
Obtain the status of the device.
| prefix | Prefix for the status |
| 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.
|
overridevirtual |
Executes a Stop command.
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
Reimplemented in fcf::devmgr::sensor::Sensor.
|
overridevirtual |
Executes a StopIgn.
| [in] | last_event | contains the payload of the StopIgn message. |
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
|
overridevirtual |
Stop device monitoring.
Implements fcf::devmgr::common::IDevice.
|
overridevirtual |
Executes a StopSim.
| [in] | last_event | contains the payload of the StopSim message. |
| an | exception if an error ocurrs. |
Implements fcf::devmgr::common::IDevice.
|
protected |
Update device database.
| attr_vector | List of attributes with their values. |
|
protected |
Pointer to configuration object.
|
protected |
reference to the data context object.
|
protected |
Dispatcher for managing failures.
|
protected |
device configuration filename.
|
protected |
Local Control System Interface.
|
protected |
device ID.
|
protected |
Dispatcher for managing positive events.
1.8.5