Scope
scope::StorageController::Impl Class Reference

#include <StorageController_p.h>

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

Public Member Functions

 Impl (SynchronizedQueue< ScopeMessage< SCOPE_MULTIIMAGEPTR_T >> *const _iqueue, const parameters::Scope &_parameters)
 
 ~Impl ()
 
void StopOne (const uint32_t &_a) override
 
void FixTIFFTags ()
 
- Public Member Functions inherited from scope::BaseController< N_ACTIVES, STATIC_PIMPL >::Impl
 Impl (const parameters::Scope &_parameters)
 
virtual void Start (const parameters::Scope &_params)
 
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
 
std::wstring CreateFolder ()
 
void InitializeEncoders (const bool &_dosave, const std::wstring &_foldername)
 

Protected Attributes

SynchronizedQueue< ScopeMessage< SCOPE_MULTIIMAGEPTR_T > > *const input_queue
 
uint32_t runcounter
 
std::array< std::vector< std::wstring >, SCOPE_NAREAS > filenames
 
std::array< std::unique_ptr< ScopeMultiImageEncoder >, SCOPE_NAREAS > encoders
 
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 StorageController.

Runs in one separate thread.

Definition at line 20 of file StorageController_p.h.

Constructor & Destructor Documentation

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

disable copy

scope::StorageController::Impl::Impl ( SynchronizedQueue< ScopeMessage< SCOPE_MULTIIMAGEPTR_T >> *const  _iqueue,
const parameters::Scope _parameters 
)
inlineexplicit

Connect the input queue and take parameters.

Definition at line 209 of file StorageController_p.h.

scope::StorageController::Impl::~Impl ( )
inlinevirtual

Stop the controller and interrupt thread if necessary.

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

Definition at line 216 of file StorageController_p.h.

Member Function Documentation

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

disable assignment

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

Main function for running data conversion to TIFF and storage.

It is executed asynchronously.

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

Definition at line 47 of file StorageController_p.h.

std::wstring scope::StorageController::Impl::CreateFolder ( )
inlineprotected

Create folder.Fformat is: "folder/date/time_runmode/".

Definition at line 157 of file StorageController_p.h.

void scope::StorageController::Impl::InitializeEncoders ( const bool &  _dosave,
const std::wstring &  _foldername 
)
inlineprotected

Creates and initializes the encoders.

Definition at line 191 of file StorageController_p.h.

void scope::StorageController::Impl::StopOne ( const uint32_t &  _a)
inlineoverridevirtual

We need to override here.

The dequeue in Run could block/wait since nothing is in the queue. To stop we put a message with abort tag in, it gets dequeued and we break from the while loop. (In addition we call BaseController::Impl::StopOne which sets the StopCondition to true.

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

Definition at line 224 of file StorageController_p.h.

void scope::StorageController::Impl::FixTIFFTags ( )
inline

Write correct Tiff flags into files (fix the ones that are by default written by the WIC.

Use a format (writing into the ImageDescription tag) that ImageJ will recognise. Run exiftool.exe in a separate process (tried libexiv2, but that could not overwrite some tags).

Definition at line 233 of file StorageController_p.h.

Member Data Documentation

SynchronizedQueue<ScopeMessage<SCOPE_MULTIIMAGEPTR_T> >* const scope::StorageController::Impl::input_queue
protected

Input queue with multi images from the PipelineController.

Definition at line 25 of file StorageController_p.h.

uint32_t scope::StorageController::Impl::runcounter
protected

for continuous file numbering

Definition at line 28 of file StorageController_p.h.

std::array<std::vector<std::wstring>, SCOPE_NAREAS> scope::StorageController::Impl::filenames
protected

Keep track of filenames.

Definition at line 31 of file StorageController_p.h.

std::array<std::unique_ptr<ScopeMultiImageEncoder>, SCOPE_NAREAS> scope::StorageController::Impl::encoders
protected

the encoders (encapsulating the WIC stuff)

Definition at line 34 of file StorageController_p.h.

ScopeLogger scope::StorageController::Impl::scope_logger
protected

the logger kept handy

Definition at line 37 of file StorageController_p.h.


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