Scope
scope::DaqController::Impl Class Reference

#include <DaqController_p.h>

Inherits scope::BaseController< N_ACTIVES, STATIC_PIMPL >::Impl.

Public Member Functions

 Impl (std::array< SynchronizedQueue< ScopeMessage< SCOPE_DAQCHUNKPTR_T >>, SCOPE_NAREAS > *const _oqueues, const parameters::Scope &_parameters)
 
virtual ~Impl ()
 
void Start (const parameters::Scope &_params) override
 
void OnlineParameterUpdate (const parameters::Area &_areaparameters)
 
void WorkerOnlineParameterUpdate (const uint32_t _area)
 
void AbortOnlineParameterUpdate (const uint32_t &_area)
 
void ZeroGalvoOutputs ()
 
void SetScannerVector (const uint32_t &_area, ScannerVectorFrameBasicPtr _sv)
 
void OpenCloseShutter (const uint32_t &_area, const bool &_open)
 
bool GetShutterState (const uint32_t _area) const
 
void TurnOnOffSwitchResonance (const uint32_t &_area, const bool &_on)
 
bool GetSwitchResonanceState (const uint32_t _area) const
 
- Public Member Functions inherited from scope::BaseController< N_ACTIVES, STATIC_PIMPL >::Impl
 Impl (const parameters::Scope &_parameters)
 
virtual void StopOne (const uint32_t &_a)
 
virtual void StopAll ()
 
virtual ControllerReturnStatus WaitForOne (const uint32_t &_a, const int32_t &_wait_time)
 
virtual ControllerReturnStatus WaitForAll (const int32_t &_wait_time)
 

Protected Member Functions

 Impl (const Impl &i)
 
Impl operator= (const Impl &i)
 
ControllerReturnStatus Run (StopCondition *const sc, const uint32_t &_area) override
 

Protected Attributes

std::array< SynchronizedQueue< ScopeMessage< SCOPE_DAQCHUNKPTR_T > >, SCOPE_NAREAS > *const output_queues
 
std::array< std::unique_ptr< Outputs >, SCOPE_NAREAS > outputs
 
std::array< std::unique_ptr< Inputs >, SCOPE_NAREAS > inputs
 
std::unique_ptr< SCOPE_STIMULATIONS_T > stimulation
 
std::array< Shutter, SCOPE_NAREAS > shutters
 
std::array< SwitchResonance, SCOPE_NAREAS > switches
 
std::array< ScannerVectorFrameBasicPtr, SCOPE_NAREAS > scannervecs
 
StimulationVector stimvec
 
std::array< uint32_t, SCOPE_NAREAS > chunksizes
 
std::array< std::condition_variable, SCOPE_NAREAS > online_update_done
 
std::array< std::atomic< bool >, SCOPE_NAREAS > online_update_done_flag
 
std::array< std::mutex, SCOPE_NAREAS > online_update_done_mutexe
 
ScopeLogger scope_logger
 
- Protected Attributes inherited from scope::BaseController< N_ACTIVES, STATIC_PIMPL >::Impl
std::array< std::shared_future< ControllerReturnStatus >, N_ACTIVES > futures
 
std::array< StopCondition, N_ACTIVES > stops
 
parameters::Scope parameters
 

Detailed Description

The implementation class of the DaqController.

Every area runs in one thread.

Definition at line 28 of file DaqController_p.h.

Constructor & Destructor Documentation

scope::DaqController::Impl::Impl ( const Impl i)
protected

disable copy

scope::DaqController::Impl::Impl ( std::array< SynchronizedQueue< ScopeMessage< SCOPE_DAQCHUNKPTR_T >>, SCOPE_NAREAS > *const  _oqueues,
const parameters::Scope _parameters 
)
inlineexplicit

Sets the output queues, generates initial ScannerVectors and initializes the shutters and the resonance scanner switches.

Parameters
[in]_oqueuesoutput queues
[in]_parametersinitial ScopeParameters set

Definition at line 155 of file DaqController_p.h.

virtual scope::DaqController::Impl::~Impl ( )
inlinevirtual

Stops and interrupts everything and zeros galvo outputs.

Reimplemented from scope::BaseController< N_ACTIVES, STATIC_PIMPL >::Impl.

Definition at line 172 of file DaqController_p.h.

Member Function Documentation

Impl scope::DaqController::Impl::operator= ( const Impl i)
protected

disable assignment

ControllerReturnStatus scope::DaqController::Impl::Run ( StopCondition *const  sc,
const uint32_t &  _area 
)
inlineoverrideprotectedvirtual

Main function for running data acquisition.

It is executed asynchronously. For every area one Run function is executed (since DaqController is derived from BaseController<SCOPE_NAREAS>).

Reimplemented from scope::BaseController< N_ACTIVES, STATIC_PIMPL >::Impl.

Definition at line 80 of file DaqController_p.h.

void scope::DaqController::Impl::Start ( const parameters::Scope _params)
inlineoverridevirtual

Starts the DaqController.

Calculates ScannerVector and StimulationVector. Calculates various acquisition related rates. Creates tasks sets timing and triggering. Writes ScannerVector and StimulationVector, opens the shutters, turns on the resonance scanner switches, starts all tasks, starts all Run methods asynchronously and gets their futures.

Parameters
[in]_paramsScopeParameter set to work with

Reimplemented from scope::BaseController< N_ACTIVES, STATIC_PIMPL >::Impl.

Definition at line 183 of file DaqController_p.h.

void scope::DaqController::Impl::OnlineParameterUpdate ( const parameters::Area _areaparameters)
inline

Handles update of parameters during scanning.

Postcondition
online update is done or aborted

Definition at line 256 of file DaqController_p.h.

void scope::DaqController::Impl::WorkerOnlineParameterUpdate ( const uint32_t  _area)
inline

Does the actual writing to device for an online update.

Definition at line 276 of file DaqController_p.h.

void scope::DaqController::Impl::AbortOnlineParameterUpdate ( const uint32_t &  _area)
inline

Aborts a running online parameters update (aborts the block-wise Outputs::Write operation)

Postcondition
the waiting OnlineParameterUpdate should return rather quickly now

Definition at line 297 of file DaqController_p.h.

void scope::DaqController::Impl::ZeroGalvoOutputs ( )
inline

Zeros galvo outputs.

Definition at line 303 of file DaqController_p.h.

void scope::DaqController::Impl::SetScannerVector ( const uint32_t &  _area,
ScannerVectorFrameBasicPtr  _sv 
)
inline

Sets a scanner vector.

Only called on startup.

Definition at line 325 of file DaqController_p.h.

void scope::DaqController::Impl::OpenCloseShutter ( const uint32_t &  _area,
const bool &  _open 
)
inline

Opens/closes the shutter.

Calls DaqController::Impl::OpenCloseShutter

Definition at line 330 of file DaqController_p.h.

bool scope::DaqController::Impl::GetShutterState ( const uint32_t  _area) const
inline
Returns
current state of the first shutter

Definition at line 336 of file DaqController_p.h.

void scope::DaqController::Impl::TurnOnOffSwitchResonance ( const uint32_t &  _area,
const bool &  _on 
)
inline

Turns the resonance scanner relay on and off.

Definition at line 341 of file DaqController_p.h.

bool scope::DaqController::Impl::GetSwitchResonanceState ( const uint32_t  _area) const
inline
Returns
current state of the first resonance scanner relay

Definition at line 347 of file DaqController_p.h.

Member Data Documentation

std::array<SynchronizedQueue<ScopeMessage<SCOPE_DAQCHUNKPTR_T> >, SCOPE_NAREAS>* const scope::DaqController::Impl::output_queues
protected

array holding the output queues to the PipelineControllers

Definition at line 33 of file DaqController_p.h.

std::array<std::unique_ptr<Outputs>, SCOPE_NAREAS> scope::DaqController::Impl::outputs
protected

The outputs (pointers to base class)

Definition at line 36 of file DaqController_p.h.

std::array<std::unique_ptr<Inputs>, SCOPE_NAREAS> scope::DaqController::Impl::inputs
protected

The inputs (pointers to base class)

Definition at line 39 of file DaqController_p.h.

std::unique_ptr<SCOPE_STIMULATIONS_T> scope::DaqController::Impl::stimulation
protected

The stimulation output.

Definition at line 42 of file DaqController_p.h.

std::array<Shutter, SCOPE_NAREAS> scope::DaqController::Impl::shutters
protected

array holding shutter class for every area

Definition at line 45 of file DaqController_p.h.

std::array<SwitchResonance, SCOPE_NAREAS> scope::DaqController::Impl::switches
protected

array holding SwitchResonance class for every area

Definition at line 48 of file DaqController_p.h.

std::array<ScannerVectorFrameBasicPtr, SCOPE_NAREAS> scope::DaqController::Impl::scannervecs
protected

The scanner vector for frame scanning.

Definition at line 51 of file DaqController_p.h.

StimulationVector scope::DaqController::Impl::stimvec
protected

stimulation

Definition at line 54 of file DaqController_p.h.

std::array<uint32_t, SCOPE_NAREAS> scope::DaqController::Impl::chunksizes
protected

size of a read chunk in samples per channel

Definition at line 57 of file DaqController_p.h.

std::array<std::condition_variable, SCOPE_NAREAS> scope::DaqController::Impl::online_update_done
protected

condition variables to wait for until online updates is done (new frame is completely written to buffer or aborted)

Definition at line 60 of file DaqController_p.h.

std::array<std::atomic<bool>, SCOPE_NAREAS> scope::DaqController::Impl::online_update_done_flag
protected

bool flag to set after online update is done

Definition at line 63 of file DaqController_p.h.

std::array<std::mutex, SCOPE_NAREAS> scope::DaqController::Impl::online_update_done_mutexe
protected

mutexe for the condition variables

Definition at line 66 of file DaqController_p.h.

ScopeLogger scope::DaqController::Impl::scope_logger
protected

a ScopeLogger kept handy here

Definition at line 69 of file DaqController_p.h.


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