|
| DeviceFacade (rad::SMAdapter &sm, Config &config, protocol::base::Dispatcher<> &failure, protocol::base::Dispatcher<> &normal) |
|
virtual | ~DeviceFacade () |
| ~DeviceFacade
|
|
virtual bool | Init (rad::SMAdapter &sm, rad::ThreadActivity *activity) |
| Init all devices managed by the devmgr.
|
|
virtual bool | Enable (rad::SMAdapter &sm, rad::ThreadActivity *activity) |
| Enable all devices managed by the devmgr.
|
|
virtual bool | Recover (rad::SMAdapter &sm, rad::ThreadActivity *activity) |
| Recover all devices managed by the devmgr.
|
|
virtual bool | Disable () |
| Disable all devices managed by the devmgr.
|
|
virtual bool | AsyncSetup (const std::any &payload) |
| Executes a setup message.
|
|
virtual bool | Setup (const std::any &payload, rad::ThreadActivity *activity) |
| Executes a setup message.
|
|
virtual void | Stop () |
| Abort all devices managed by the devmgr.
|
|
virtual void | Reset () |
| Reset devices.
|
|
virtual void | Status (const std::any &payload, std::string &buffer) |
| Get status from devices.
|
|
virtual void | Simulate (rad::AnyEvent const &last_event) |
| Simulate devices managed by the server.
|
|
virtual void | StopSim (rad::AnyEvent const &last_event) |
| Stop simulating devices managed by the server.
|
|
virtual void | Ignore (rad::AnyEvent const &last_event) |
| Ignore devices managed by the server.
|
|
virtual void | StopIgn (rad::AnyEvent const &last_event) |
| Stop ignoring devices managed by the server.
|
|
virtual void | HwReset (rad::AnyEvent const &last_event) |
| Reset hardware.
|
|
virtual void | HwInit (rad::AnyEvent const &last_event) |
| Init hardware.
|
|
virtual void | HwEnable (rad::AnyEvent const &last_event) |
| Enable hardware.
|
|
virtual void | HwDisable (rad::AnyEvent const &last_event) |
| Disable hardware.
|
|
virtual std::string | DevNames () const |
| Get list of managed devices.
|
|
virtual std::string | DevInfo () const |
| Get information of managed devices.
|
|
virtual std::string | DevConfig (const std::string devname) const |
| Get configuration for a given device.
|
|
void | StartDaq (std::string daqid) |
| Start Data Acquisition.
|
|
fcf::devmgr::common::DaqInfo | StopDaq (std::string daqid) |
| Stop Data Acquisition.
|
|
void | AbortDaq (std::string daqid) |
| Abort Data Acquisition.
|
|
fcf::devmgr::common::DaqInfo | GetDaqStatus (std::string daqid) const |
| Get Daq Status.
|
|
void | TriggerInternalEvent (rad::SMAdapter &sm, rad::UniqueEvent &&e) |
| Trigger an internal event.
|
|
void | AddDevice (std::shared_ptr< IDevice > device) |
| Add a device instance to be managed by the facade.
|
|
void | ClearDevices () |
| Empty internal device map.
|
|
protocol::base::Dispatcher & | GetFailureCB () |
| Get reference to failure CB.
|
|
protocol::base::Dispatcher & | GetNormalCB () |
| Get reference to normal CB.
|
|
const int | GetNumDevices () const noexcept |
| Get the number of devices.
|
|
void | CheckDeviceName (const std::vector< std::string > &devices) const |
| Check if list of devices are managed by the server.
|
|
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
bool fcf::devmgr::common::DeviceFacade::AsyncSetup |
( |
const std::any & |
payload | ) |
|
|
virtual |
Executes a setup message.
- Parameters
-
[in] | payload | message containing the setup payload |
- 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.
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.
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.