ifw-daq  3.0.1
IFW Data Acquisition modules
Classes | Public Member Functions | List of all members
daq::DpmDaqController Class Reference

Implements behaviour from the state NotScheduled to Completed. More...

#include <daqController.hpp>

+ Inheritance diagram for daq::DpmDaqController:

Public Member Functions

 DpmDaqController (boost::asio::io_context &io_context, DaqContext context, std::shared_ptr< ObservableStatus > status, std::shared_ptr< ObservableEventLog > event_log, std::shared_ptr< DpmClient > dpm_client)
 Constructor. More...
 
boost::future< StateScheduleMergeAsync () override
 Schedules DAQ for merging by sending request to DPM. More...
 
boost::future< StateStartAsync () override
 
boost::future< StatusStopAsync (ErrorPolicy policy) override
 
void UpdateKeywords (fits::KeywordVector const &keywords) override
 
boost::future< StateAwaitAsync (std::vector< std::string > sources, std::chrono::milliseconds timeout) override
 
boost::future< StatusAbortAsync (ErrorPolicy policy) override
 Attempts to abort Data Acquisition. More...
 
State GetState () const DAQ_NOEXCEPT override
 
- Public Member Functions inherited from daq::CommonDaqController
 CommonDaqController (boost::asio::io_context &io_context, DaqContext context, std::shared_ptr< ObservableStatus > status, std::shared_ptr< ObservableEventLog > event_log)
 
std::shared_ptr< ObservableStatusGetStatus () DAQ_NOEXCEPT override
 
std::shared_ptr< ObservableStatus const > GetStatus () const DAQ_NOEXCEPT override
 
std::shared_ptr< ObservableEventLogGetEventLog () DAQ_NOEXCEPT override
 
std::string const & GetId () const DAQ_NOEXCEPT override
 
bool GetErrorFlag () const DAQ_NOEXCEPT override
 
DaqContext const & GetContext () const DAQ_NOEXCEPT override
 
boost::signals2::connection ConnectContext (ContextSignal::slot_type const &slot) override
 Connect observer that is invoked when context is modified. More...
 
- Public Member Functions inherited from daq::DaqController
 DaqController ()=default
 
virtual ~DaqController ()=default
 

Additional Inherited Members

- Public Types inherited from daq::DaqController
using ContextSignal = boost::signals2::signal< void(DaqContext const &)>
 
- Protected Member Functions inherited from daq::CommonDaqController
template<class T , class... Args>
void AddEvent (Args &&... args)
 
boost::asio::io_context & GetIoCtx () noexcept
 
rad::IoExecutorGetIoExecutor () noexcept
 
DaqContextGetContextMut () noexcept
 
ObservableEventLogGetEventLogRef () noexcept
 
ObservableStatusGetStatusRef () noexcept
 
ObservableStatus const & GetStatusRef () const noexcept
 
void EmitContextSignal ()
 

Detailed Description

Implements behaviour from the state NotScheduled to Completed.

Once successfully scheduled to be merged by DPM (NotScheduled -> Scheduled) the "location" for the true DAQ state is also transferred. This means:

DpmDaqController is responsible for requesting last known status from DPM (in state Scheduled and onwards). This is done with the DPM client which aggregates all instances and manages retries.

Definition at line 527 of file daqController.hpp.

Constructor & Destructor Documentation

◆ DpmDaqController()

daq::DpmDaqController::DpmDaqController ( boost::asio::io_context &  io_context,
DaqContext  context,
std::shared_ptr< ObservableStatus status,
std::shared_ptr< ObservableEventLog event_log,
std::shared_ptr< DpmClient dpm_client 
)

Constructor.

@important DpmDaqController must only be used with shared_ptr.

Parameters
io_contextUsed for async operations.
contextDAQ context.
statusDAQ status.
dpm_clientInterface to DPM. During construction DpmDaqController will register signal slot to receive DAQ status updates and mirror that in status accordingly.
Exceptions
std::invalid_argumentif state of status is not NotScheduled or subsequent.

Definition at line 750 of file daqController.cpp.

Member Function Documentation

◆ AbortAsync()

boost::future< Status > daq::DpmDaqController::AbortAsync ( ErrorPolicy  policy)
overridevirtual

Attempts to abort Data Acquisition.

  • If Data Acquisition is not-yet-scheduled it will be aborted immediately.
  • If Data Acquisition may have been scheduled (request has been sent to DPM) the request is forwarded to DPM.
  • If DPM is not running or otherwise fails the DAQ is still marked as aborted if policy is ErrorPolicy::Tolerant.

Implements daq::DaqController.

Definition at line 895 of file daqController.cpp.

◆ AwaitAsync()

boost::future< State > daq::DpmDaqController::AwaitAsync ( std::vector< std::string >  sources,
std::chrono::milliseconds  timeout 
)
overridevirtual
Returns
future containing std::runtime_error because operation is always invalid.

Implements daq::DaqController.

Definition at line 807 of file daqController.cpp.

◆ GetState()

State daq::DpmDaqController::GetState ( ) const
overridevirtual
Returns
state of data acquisition.

Implements daq::DaqController.

Definition at line 816 of file daqController.cpp.

◆ ScheduleMergeAsync()

boost::future< State > daq::DpmDaqController::ScheduleMergeAsync ( )
overridevirtual

Schedules DAQ for merging by sending request to DPM.

Returns
future containing exception:
  • std::logic_error if DAQ has already been scheduled
  • mal::TimeoutException if DPM is offline (timeout).
  • unspecified DPM fails

Implements daq::DaqController.

Definition at line 820 of file daqController.cpp.

◆ StartAsync()

boost::future< State > daq::DpmDaqController::StartAsync ( )
overridevirtual
Returns
future containing std::runtime_error because operation is always invalid.

Implements daq::DaqController.

Definition at line 796 of file daqController.cpp.

◆ StopAsync()

boost::future< Status > daq::DpmDaqController::StopAsync ( ErrorPolicy  policy)
overridevirtual
Returns
future containing std::runtime_error because operation is always invalid.

Implements daq::DaqController.

Definition at line 801 of file daqController.cpp.

◆ UpdateKeywords()

void daq::DpmDaqController::UpdateKeywords ( fits::KeywordVector const &  keywords)
overridevirtual
Exceptions
std::runtime_errorbecause operation is always invalid (keywords cannot be modified once delivered to DPM).

Implements daq::DaqController.

Definition at line 812 of file daqController.cpp.


The documentation for this class was generated from the following files: