|
| DeviceFacade (rad::SMAdapter &sm, IConfig &config, fcf::common::Dispatcher<> &failure, fcf::common::Dispatcher<> &normal) |
|
virtual | ~DeviceFacade () |
| ~DeviceFacade More...
|
|
virtual bool | Init (rad::SMAdapter &sm, rad::ThreadActivity *activity) |
| Init all devices managed by the devmgr. More...
|
|
virtual bool | Enable (rad::SMAdapter &sm, rad::ThreadActivity *activity) |
| Enable all devices managed by the devmgr. More...
|
|
virtual bool | Recover (rad::SMAdapter &sm, rad::ThreadActivity *activity) |
| Recover all devices managed by the devmgr. More...
|
|
virtual bool | Disable () |
| Disable all devices managed by the devmgr. More...
|
|
virtual bool | Setup (const std::any &payload, rad::ThreadActivity *activity) |
| Executes a setup message. More...
|
|
virtual void | Stop () |
| Abort all devices managed by the devmgr. More...
|
|
virtual void | Reset () |
| Reset devices. More...
|
|
virtual void | Status (const std::any &payload, std::string &buffer) |
| Get status from devices. More...
|
|
virtual void | Simulate (rad::AnyEvent const &last_event) |
| Simulate devices managed by the server. More...
|
|
virtual void | StopSim (rad::AnyEvent const &last_event) |
| Stop simulating devices managed by the server. More...
|
|
virtual void | Ignore (rad::AnyEvent const &last_event) |
| Ignore devices managed by the server. More...
|
|
virtual void | StopIgn (rad::AnyEvent const &last_event) |
| Stop ignoring devices managed by the server. More...
|
|
virtual void | HwReset (rad::AnyEvent const &last_event) |
| Reset hardware. More...
|
|
virtual void | HwInit (rad::AnyEvent const &last_event) |
| Init hardware. More...
|
|
virtual void | HwEnable (rad::AnyEvent const &last_event) |
| Enable hardware. More...
|
|
virtual void | HwDisable (rad::AnyEvent const &last_event) |
| Disable hardware. More...
|
|
virtual std::string | DevNames () |
| Get list of managed devices. More...
|
|
virtual void | BeginAcq (rad::AnyEvent const &last_event) |
| Begin Acquisition. More...
|
|
virtual void | EndAcq (rad::AnyEvent const &last_event) |
| End Acquisition. More...
|
|
void | TriggerInternalEvent (rad::SMAdapter &sm, rad::UniqueEvent &&e) |
| Trigger an internal event. More...
|
|
void | AddDevice (std::shared_ptr< IDevice > device) |
| Add a device instance to be managed by the facade. More...
|
|
void | ClearDevices () |
| Empty internal device map. More...
|
|
fcf::common::Dispatcher & | GetFailureCB () |
| Get reference to failure CB. More...
|
|
fcf::common::Dispatcher & | GetNormalCB () |
| Get reference to normal CB. More...
|
|
const int | GetNumDevices () |
| Get the number of devices. More...
|
|
This class provide a device facade object to allow the devmgr managing easily all the devices under its control. This class relies on a device abstract class that implement all common features of the devices.
- See Also
- Device
void fcf::devmgr::common::DeviceFacade::EndAcq |
( |
rad::AnyEvent const & |
last_event | ) |
|
|
virtual |
End Acquisition.
This method collect data from devices at the end of the acquisition and it creates the data product FITS file including the meta-data for all devices currently managed by the server.
The filename follows the following convention:
<prefix>_<dp_id>_<fcs_id>.fits
The information for the filename is defined by the BeginAcq method.
- See Also
- BeginAcq
bool fcf::devmgr::common::DeviceFacade::Setup |
( |
const std::any & |
payload, |
|
|
rad::ThreadActivity * |
activity |
|
) |
| |
|
virtual |
Executes a setup message.
- Parameters
-
[in] | payload | message containing the setup payload |
[in] | activity | pointer to the thread |
- Returns
- true if the execution was succesful, false otherwise.
This method takes care of forwarding the setup message to all devices registered in the facade. Once the setup is successfully executed, the method waits until the action is finished or an error occurs.
The device facade class handles devices sequentially. In case of an error, the setup will finish immediately. The device facade does not know the internals of each device, it just forward the message blindly to all devices. Each device class is responsible of handling the parameters and actions defined in the setup message, as well as determining when the action is finished.
The setup will be stopped whenever the thread (activity) will be stopped.