ifw-daq
2.1.0-pre1
IFW Data Acquisition modules
|
Controls the execution of single data acquisition that ultimately result in a set of FITS keywords and/or FITS files. More...
#include <daqController.hpp>
Public Types | |
using | ContextSignal = boost::signals2::signal< void(DaqContext const &)> |
Public Member Functions | |
DaqController ()=default | |
virtual | ~DaqController ()=default |
virtual boost::future< State > | StartAsync ()=0 |
Starts the data acquisition. More... | |
virtual boost::future< Status > | StopAsync (ErrorPolicy policy)=0 |
Stops the data acquisition. More... | |
virtual boost::future< Status > | AbortAsync (ErrorPolicy policy)=0 |
Aborts the data acquisition. More... | |
virtual boost::future< State > | ScheduleMergeAsync ()=0 |
Schedules DAQ for merging by sending request to DPM. More... | |
virtual void | UpdateKeywords (fits::KeywordVector const &keywords)=0 |
Updates (replace or add) list of keywords. More... | |
virtual boost::future< State > | AwaitAsync (std::vector< std::string > sources, std::chrono::milliseconds timeout)=0 |
Awaits that data acquisition stops or aborts. More... | |
virtual State | GetState () const DAQ_NOEXCEPT=0 |
virtual std::shared_ptr< ObservableStatus > | GetStatus () DAQ_NOEXCEPT=0 |
virtual std::shared_ptr< ObservableStatus const > | GetStatus () const DAQ_NOEXCEPT=0 |
virtual std::shared_ptr< ObservableEventLog > | GetEventLog () DAQ_NOEXCEPT=0 |
virtual std::string const & | GetId () const DAQ_NOEXCEPT=0 |
virtual bool | GetErrorFlag () const DAQ_NOEXCEPT=0 |
virtual DaqContext const & | GetContext () const DAQ_NOEXCEPT=0 |
virtual boost::signals2::connection | ConnectContext (ContextSignal::slot_type const &slot)=0 |
Connect observer that is invoked when context is modified. More... | |
Controls the execution of single data acquisition that ultimately result in a set of FITS keywords and/or FITS files.
Due to the dynamic nature of data acquisitions (mostly w.r.t. fatal errors from data soures and commands from user) the following assumptions are made:
Aborting
and even if the await operation completes successfully, the result will be discarded because user asked to abort.Starting
Start with StartAsync
Stop/abort with StopAsync
or AbortAsync
.
Automatically initiate stop if all primary sources are automatically stopped as indicated by ObservableStatus
status update topic.
If asynchronous operations have been started, it is still possible to abort. This command will then supersede ongoing commands, and ongoing commands will be aborted at the next synchronization point (typically when reply is received).
It is not possible to retry or go backwards by executing StartAsync
after StopAsync
or AbortAsync
. The reasoning behind this is to avoid the risk of duplicate data acquisition id being "in flight" at the same time..
It is possible to abort on the other hand, even though the data acquisition might not have been started yet.
For StartAsync, StopAsync, AbortAsync:
The error handling strategy is to not Set result until we have a result from each source either by reply or internal error when Sending/receiving (MAL issues e.g.).
This implies:
Starting
then DaqController remains in Starting
with the error flag Set.Pending decision decisions:
Definition at line 214 of file daqController.hpp.
using daq::DaqController::ContextSignal = boost::signals2::signal<void(DaqContext const&)> |
Definition at line 315 of file daqController.hpp.
|
default |
|
virtualdefault |
|
pure virtual |
Aborts the data acquisition.
policy | Error policy determining if errors are tolerated or not. |
It is possible to issue this request more than once, to e.g. retry a failed abort attempt.
GetState() not in (State::Aborted, State::Stopped)
GetState() == State::Aborting
if a data acquisition was ongoing otherwise GetState() == State::Aborted
. Implemented in daq::DpmDaqController, daq::OcmDaqController, and DaqControllerFake.
|
pure virtual |
Awaits that data acquisition stops or aborts.
It is possible to await only only a subset of data sources by specifying their ids in sources
.
sources | An optional vector of source-ids to await, if empty all primary sources are awaited on. |
Implemented in DaqControllerFake, daq::DpmDaqController, and daq::OcmDaqController.
|
pure virtual |
Connect observer that is invoked when context is modified.
o | Observer callable invoked on context changes. |
Implemented in DaqControllerFake, daq::DaqControllerMock, and daq::CommonDaqController.
|
pure virtual |
Implemented in DaqControllerFake, and daq::CommonDaqController.
|
pure virtual |
Implemented in DaqControllerFake, and daq::CommonDaqController.
|
pure virtual |
Implemented in DaqControllerFake, and daq::CommonDaqController.
|
pure virtual |
Implemented in DaqControllerFake, and daq::CommonDaqController.
|
pure virtual |
Implemented in daq::DaqControllerMock, DaqControllerFake, daq::DpmDaqController, and daq::OcmDaqController.
|
pure virtual |
Implemented in DaqControllerFake, and daq::CommonDaqController.
|
pure virtual |
Implemented in DaqControllerFake, and daq::CommonDaqController.
|
pure virtual |
Schedules DAQ for merging by sending request to DPM.
Implemented in DaqControllerFake, daq::DpmDaqController, and daq::OcmDaqController.
|
pure virtual |
Starts the data acquisition.
std::exception-derived | exception if internal error occurs. |
GetState() == State::Notstarted
GetState() == State::Starting
on success GetState() == State::Error
on error Implemented in DaqControllerFake, daq::DpmDaqController, and daq::OcmDaqController.
|
pure virtual |
Stops the data acquisition.
GetState() not in (State::Stopped or State::Aborted)
GetState() == State::Stopping
Implemented in daq::DpmDaqController, daq::OcmDaqController, and DaqControllerFake.
|
pure virtual |
Updates (replace or add) list of keywords.
keywords | Keywords to add. |
Implemented in daq::DpmDaqController, daq::OcmDaqController, and DaqControllerFake.