ifw
0.0.1-dev
|
#include <deviceFacade.hpp>
Public Member Functions | |
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::Activity *activity) |
Init all devices managed by the devmgr. More... | |
virtual bool | Enable (rad::SMAdapter &sm, rad::Activity *activity) |
Enable all devices managed by the devmgr. More... | |
virtual bool | Recover (rad::SMAdapter &sm, rad::Activity *activity) |
Recover all devices managed by the devmgr. More... | |
virtual bool | Disable () |
Disable all devices managed by the devmgr. More... | |
virtual bool | Setup (modif::ReqSetup setupMsg, modif::TaskId &taskId, rad::Activity *activity) |
Executes a setup message. More... | |
virtual bool | Stop () |
Abort all devices managed by the devmgr. More... | |
virtual bool | Reset () |
Reset devices. More... | |
virtual bool | Status (modif::ReqStatus &statusMsg, std::string &buffer) |
Get status from devices. More... | |
virtual void | Simulate (modif::ReqSimulate &msg) |
Simulate devices managed by the server. More... | |
virtual void | StopSim (modif::ReqStopSim &msg) |
Stop simulating devices managed by the server. More... | |
virtual void | Ignore (modif::ReqIgnore &msg) |
Ignore devices managed by the server. More... | |
virtual void | StopIgn (modif::ReqStopIgn &msg) |
Stop ignoring devices managed by the server. More... | |
virtual bool | HwReset (modif::ReqHwReset &hwResetMsg) |
Reset hardware. More... | |
virtual bool | HwInit (modif::ReqHwInit &hwInitMsg) |
Init hardware. More... | |
virtual bool | HwEnable (modif::ReqHwEnable &hwEnableMsg) |
Enable hardware. More... | |
virtual bool | HwDisable (modif::ReqHwDisable &hwDisableMsg) |
Disable hardware. More... | |
virtual bool | BeginAcq (modif::ReqBeginAcq &beginAcqMsg) |
Begin Acquisition. More... | |
virtual bool | EndAcq (modif::ReqEndAcq &endAcqMsg) |
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... | |
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::Activity *activity) |
Init all devices managed by the devmgr. More... | |
virtual bool | Enable (rad::SMAdapter &sm, rad::Activity *activity) |
Enable all devices managed by the devmgr. More... | |
virtual bool | Recover (rad::SMAdapter &sm, rad::Activity *activity) |
Recover all devices managed by the devmgr. More... | |
virtual bool | Disable () |
Disable all devices managed by the devmgr. More... | |
virtual bool | Setup (modif::ReqSetup setupMsg, modif::TaskId &taskId, rad::Activity *activity) |
Executes a setup message. More... | |
virtual bool | Stop () |
Abort all devices managed by the devmgr. More... | |
virtual bool | Reset () |
Reset devices. More... | |
virtual bool | Status (modif::ReqStatus &statusMsg, std::string &buffer) |
Get status from devices. More... | |
virtual void | Simulate (modif::ReqSimulate &msg) |
Simulate devices managed by the server. More... | |
virtual void | StopSim (modif::ReqStopSim &msg) |
Stop simulating devices managed by the server. More... | |
virtual void | Ignore (modif::ReqIgnore &msg) |
Ignore devices managed by the server. More... | |
virtual void | StopIgn (modif::ReqStopIgn &msg) |
Stop ignoring devices managed by the server. More... | |
virtual bool | HwReset (modif::ReqHwReset &hwResetMsg) |
Reset hardware. More... | |
virtual bool | HwInit (modif::ReqHwInit &hwInitMsg) |
Init hardware. More... | |
virtual bool | HwEnable (modif::ReqHwEnable &hwEnableMsg) |
Enable hardware. More... | |
virtual bool | HwDisable (modif::ReqHwDisable &hwDisableMsg) |
Disable hardware. More... | |
virtual bool | BeginAcq (modif::ReqBeginAcq &beginAcqMsg) |
Begin Acquisition. More... | |
virtual bool | EndAcq (modif::ReqEndAcq &endAcqMsg) |
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... | |
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::Activity *activity) |
Init all devices managed by the devmgr. More... | |
virtual bool | Enable (rad::SMAdapter &sm, rad::Activity *activity) |
Enable all devices managed by the devmgr. More... | |
virtual bool | Recover (rad::SMAdapter &sm, rad::Activity *activity) |
Recover all devices managed by the devmgr. More... | |
virtual bool | Disable () |
Disable all devices managed by the devmgr. More... | |
virtual bool | Setup (modif::ReqSetup setupMsg, modif::TaskId &taskId, rad::Activity *activity) |
Executes a setup message. More... | |
virtual bool | Stop () |
Abort all devices managed by the devmgr. More... | |
virtual bool | Reset () |
Reset devices. More... | |
virtual bool | Status (modif::ReqStatus &statusMsg, std::string &buffer) |
Get status from devices. More... | |
virtual void | Simulate (modif::ReqSimulate &msg) |
Simulate devices managed by the server. More... | |
virtual void | StopSim (modif::ReqStopSim &msg) |
Stop simulating devices managed by the server. More... | |
virtual void | Ignore (modif::ReqIgnore &msg) |
Ignore devices managed by the server. More... | |
virtual void | StopIgn (modif::ReqStopIgn &msg) |
Stop ignoring devices managed by the server. More... | |
virtual bool | HwReset (modif::ReqHwReset &hwResetMsg) |
Reset hardware. More... | |
virtual bool | HwInit (modif::ReqHwInit &hwInitMsg) |
Init hardware. More... | |
virtual bool | HwEnable (modif::ReqHwEnable &hwEnableMsg) |
Enable hardware. More... | |
virtual bool | HwDisable (modif::ReqHwDisable &hwDisableMsg) |
Disable hardware. More... | |
virtual bool | BeginAcq (modif::ReqBeginAcq &beginAcqMsg) |
Begin Acquisition. More... | |
virtual bool | EndAcq (modif::ReqEndAcq &endAcqMsg) |
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.
devmgr::common::DeviceFacade::DeviceFacade | ( | rad::SMAdapter & | sm, |
IConfig & | config, | ||
fcf::common::Dispatcher<> & | failure, | ||
fcf::common::Dispatcher<> & | normal | ||
) |
Constructor.
[in] | sm | Reference to the state machine sigleton. |
[in] | failure | Dispatcher for failure events. |
[in] | normal | Dispatcher for normal events. |
|
virtual |
~DeviceFacade
devmgr::common::DeviceFacade::DeviceFacade | ( | rad::SMAdapter & | sm, |
IConfig & | config, | ||
fcf::common::Dispatcher<> & | failure, | ||
fcf::common::Dispatcher<> & | normal | ||
) |
Constructor.
[in] | sm | Reference to the state machine sigleton. |
[in] | failure | Dispatcher for failure events. |
[in] | normal | Dispatcher for normal events. |
|
virtual |
~DeviceFacade
devmgr::common::DeviceFacade::DeviceFacade | ( | rad::SMAdapter & | sm, |
IConfig & | config, | ||
fcf::common::Dispatcher<> & | failure, | ||
fcf::common::Dispatcher<> & | normal | ||
) |
Constructor.
[in] | sm | Reference to the state machine sigleton. |
[in] | failure | Dispatcher for failure events. |
[in] | normal | Dispatcher for normal events. |
|
virtual |
~DeviceFacade
void devmgr::common::DeviceFacade::AddDevice | ( | std::shared_ptr< IDevice > | device | ) |
Add a device instance to be managed by the facade.
[in] | device | Smart pointer to the device. |
void devmgr::common::DeviceFacade::AddDevice | ( | std::shared_ptr< IDevice > | device | ) |
Add a device instance to be managed by the facade.
[in] | device | Smart pointer to the device. |
void devmgr::common::DeviceFacade::AddDevice | ( | std::shared_ptr< IDevice > | device | ) |
Add a device instance to be managed by the facade.
[in] | device | Smart pointer to the device. |
|
virtual |
Begin Acquisition.
This method collect data from devices at the beginning of the acquisition. It also register the data for defining the name of data product that will be generated at the end of the acquisition
|
virtual |
Begin Acquisition.
This method collect data from devices at the beginning of the acquisition. It also register the data for defining the name of data product that will be generated at the end of the acquisition
|
virtual |
Begin Acquisition.
This method collect data from devices at the beginning of the acquisition. It also register the data for defining the name of data product that will be generated at the end of the acquisition
void devmgr::common::DeviceFacade::ClearDevices | ( | ) |
Empty internal device map.
void devmgr::common::DeviceFacade::ClearDevices | ( | ) |
Empty internal device map.
void devmgr::common::DeviceFacade::ClearDevices | ( | ) |
Empty internal device map.
|
virtual |
Disable all devices managed by the devmgr.
|
virtual |
Disable all devices managed by the devmgr.
|
virtual |
Disable all devices managed by the devmgr.
|
virtual |
Enable all devices managed by the devmgr.
[in] | sm | Reference to the SM sigleton. |
[in] | activity | Pointer to the current activity. |
|
virtual |
Enable all devices managed by the devmgr.
[in] | sm | Reference to the SM sigleton. |
[in] | activity | Pointer to the current activity. |
|
virtual |
Enable all devices managed by the devmgr.
[in] | sm | Reference to the SM sigleton. |
[in] | activity | Pointer to the current activity. |
|
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.
|
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.
|
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.
fcf::common::Dispatcher& devmgr::common::DeviceFacade::GetFailureCB | ( | ) |
Get reference to failure CB.
fcf::common::Dispatcher & devmgr::common::DeviceFacade::GetFailureCB | ( | ) |
Get reference to failure CB.
fcf::common::Dispatcher& devmgr::common::DeviceFacade::GetFailureCB | ( | ) |
Get reference to failure CB.
fcf::common::Dispatcher& devmgr::common::DeviceFacade::GetNormalCB | ( | ) |
Get reference to normal CB.
fcf::common::Dispatcher & devmgr::common::DeviceFacade::GetNormalCB | ( | ) |
Get reference to normal CB.
fcf::common::Dispatcher& devmgr::common::DeviceFacade::GetNormalCB | ( | ) |
Get reference to normal CB.
const int devmgr::common::DeviceFacade::GetNumDevices | ( | ) |
Get the number of devices.
const int devmgr::common::DeviceFacade::GetNumDevices | ( | ) |
Get the number of devices.
const int devmgr::common::DeviceFacade::GetNumDevices | ( | ) |
Get the number of devices.
|
virtual |
Disable hardware.
|
virtual |
Disable hardware.
|
virtual |
Disable hardware.
|
virtual |
Enable hardware.
|
virtual |
Enable hardware.
|
virtual |
Enable hardware.
|
virtual |
Init hardware.
|
virtual |
Init hardware.
|
virtual |
Init hardware.
|
virtual |
Reset hardware.
|
virtual |
Reset hardware.
|
virtual |
Reset hardware.
|
virtual |
Ignore devices managed by the server.
|
virtual |
Ignore devices managed by the server.
|
virtual |
Ignore devices managed by the server.
|
virtual |
Init all devices managed by the devmgr.
|
virtual |
Init all devices managed by the devmgr.
|
virtual |
Init all devices managed by the devmgr.
|
virtual |
Recover all devices managed by the devmgr.
[in] | sm | Reference to the SM sigleton. |
[in] | activity | Pointer to the current activity. |
|
virtual |
Recover all devices managed by the devmgr.
[in] | sm | Reference to the SM sigleton. |
[in] | activity | Pointer to the current activity. |
|
virtual |
Recover all devices managed by the devmgr.
[in] | sm | Reference to the SM sigleton. |
[in] | activity | Pointer to the current activity. |
|
virtual |
Reset devices.
|
virtual |
Reset devices.
|
virtual |
Reset devices.
|
virtual |
Executes a setup message.
[in] | setupMsg | message containing the setup payload |
[in] | task_id | id of the task executing the setup |
[in] | activity | pointer to the thread |
This method takes care of forwarding the setup message to all devices registered in the facade. Once the setup is succesfully 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.
|
virtual |
Executes a setup message.
[in] | setupMsg | message containing the setup payload |
[in] | task_id | id of the task executing the setup |
[in] | activity | pointer to the thread |
This method takes care of forwarding the setup message to all devices registered in the facade. Once the setup is succesfully 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.
|
virtual |
Executes a setup message.
[in] | setupMsg | message containing the setup payload |
[in] | task_id | id of the task executing the setup |
[in] | activity | pointer to the thread |
This method takes care of forwarding the setup message to all devices registered in the facade. Once the setup is succesfully 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.
|
virtual |
Simulate devices managed by the server.
|
virtual |
Simulate devices managed by the server.
|
virtual |
Simulate devices managed by the server.
|
virtual |
Get status from devices.
|
virtual |
Get status from devices.
|
virtual |
Get status from devices.
|
virtual |
Abort all devices managed by the devmgr.
|
virtual |
Abort all devices managed by the devmgr.
|
virtual |
Abort all devices managed by the devmgr.
|
virtual |
Stop ignoring devices managed by the server.
|
virtual |
Stop ignoring devices managed by the server.
|
virtual |
Stop ignoring devices managed by the server.
|
virtual |
Stop simulating devices managed by the server.
|
virtual |
Stop simulating devices managed by the server.
|
virtual |
Stop simulating devices managed by the server.
void devmgr::common::DeviceFacade::TriggerInternalEvent | ( | rad::SMAdapter & | sm, |
rad::UniqueEvent && | e | ||
) |
Trigger an internal event.
[in] | sm | Reference to the SM sigleton. |
[in] | e | Event to be triggered. |
void devmgr::common::DeviceFacade::TriggerInternalEvent | ( | rad::SMAdapter & | sm, |
rad::UniqueEvent && | e | ||
) |
Trigger an internal event.
[in] | sm | Reference to the SM sigleton. |
[in] | e | Event to be triggered. |
void devmgr::common::DeviceFacade::TriggerInternalEvent | ( | rad::SMAdapter & | sm, |
rad::UniqueEvent && | e | ||
) |
Trigger an internal event.
[in] | sm | Reference to the SM sigleton. |
[in] | e | Event to be triggered. |