ifw-daq  1.0.0
IFW Data Acquisition modules
Classes | Public Member Functions | List of all members
daq::FitsControllerImpl Class Referencefinal

#include <fitsController.hpp>

+ Inheritance diagram for daq::FitsControllerImpl:

Public Member Functions

 FitsControllerImpl (DaqProperties const &properties, std::shared_ptr< ObservableEventLog > event_log, std::function< fits::UniqueFitsFile(char const *)> fits_create=&fits::CreateEmpty)
 
void Start () override
 Creates FITS file and pupulates it with initial list of keywords. More...
 
std::optional< DpPartStop (ErrorPolicy policy) override
 Finalizes the FITS file. More...
 
void Abort (ErrorPolicy policy) override
 Aborts and deletes FITS file. More...
 
void UpdateKeywords (std::vector< fits::KeywordVariant >const &) override
 Updates with provided keywords. More...
 
void AddComment (std::string comment) override
 Add comment. More...
 
std::string const & GetId () const DAQ_NOEXCEPT override
 Query FITS file path. More...
 
std::optional< DpPartGetResult () const DAQ_NOEXCEPT override
 Query FITS file path. More...
 
State GetState () const DAQ_NOEXCEPT override
 Query state. More...
 
fitsfile * GetFitsfile () const noexcept
 
- Public Member Functions inherited from daq::FitsController
virtual ~FitsController ()=default
 

Detailed Description

Definition at line 138 of file fitsController.hpp.

Constructor & Destructor Documentation

◆ FitsControllerImpl()

daq::FitsControllerImpl::FitsControllerImpl ( DaqProperties const &  properties,
std::shared_ptr< ObservableEventLog event_log,
std::function< fits::UniqueFitsFile(char const *)>  fits_create = &fits::CreateEmpty 
)

Definition at line 92 of file fitsController.cpp.

Member Function Documentation

◆ Abort()

void daq::FitsControllerImpl::Abort ( ErrorPolicy  policy)
overridevirtual

Aborts and deletes FITS file.

Precondition
GetState() == State::Acquiring.

Implements daq::FitsController.

Definition at line 177 of file fitsController.cpp.

◆ AddComment()

void daq::FitsControllerImpl::AddComment ( std::string  comment)
overridevirtual

Add comment.

Precondition
GetState() != State::Stopped && GetState() != State::Aborted.
Parameters
commentComment to add to FITS file. "
Exceptions
std::runtime_errorif GetState() == State::Stopped || GetState() == State::Aborted.

Implements daq::FitsController.

Definition at line 209 of file fitsController.cpp.

◆ GetFitsfile()

fitsfile* daq::FitsControllerImpl::GetFitsfile ( ) const
inlinenoexcept

Definition at line 154 of file fitsController.hpp.

◆ GetId()

std::string const & daq::FitsControllerImpl::GetId ( ) const
overridevirtual

Query FITS file path.

Returns
FITS file name.

Implements daq::FitsController.

Definition at line 219 of file fitsController.cpp.

◆ GetResult()

std::optional< DpPart > daq::FitsControllerImpl::GetResult ( ) const
overridevirtual

Query FITS file path.

Returns
FITS file name.

Implements daq::FitsController.

Definition at line 223 of file fitsController.cpp.

◆ GetState()

State daq::FitsControllerImpl::GetState ( ) const
overridevirtual

Query state.

Returns
state.

Implements daq::FitsController.

Definition at line 231 of file fitsController.cpp.

◆ Start()

void daq::FitsControllerImpl::Start ( )
overridevirtual

Creates FITS file and pupulates it with initial list of keywords.

Precondition
GetState() == State::NotStarted.
Exceptions
fits::CfitsioErroron errors with cfitsio.
std::runtime_erroron error.

Implements daq::FitsController.

Definition at line 130 of file fitsController.cpp.

◆ Stop()

std::optional< DpPart > daq::FitsControllerImpl::Stop ( ErrorPolicy  policy)
overridevirtual

Finalizes the FITS file.

If policy ErrorPolicy::Strict the function will throw if there was any error in creating the FITS file. If policy is ErrorPolicy::Tolerant exception will only be thrown for fatal errors, not if FITS file failed to be created.

Parameters
policyControls the error policy.
Returns
Created and closed FITS file if successful.
std::nullopt if file could not be created and policy is ErrorPolicy;:Tolerant.
Exceptions
std::runtime_errorif GetState() != State::Acquiring.
daq::fits::CfitsioErrorif no FITS file could be created and policy == ErrorPolicy::Strict.

Implements daq::FitsController.

Definition at line 150 of file fitsController.cpp.

◆ UpdateKeywords()

void daq::FitsControllerImpl::UpdateKeywords ( std::vector< fits::KeywordVariant >const &  keywords)
overridevirtual

Updates with provided keywords.

Parameters
keywordsKeywords to add or replace. "
Exceptions
std::runtime_errorif GetState() == State::Stopped || GetState() == State::Aborted.

Implements daq::FitsController.

Definition at line 199 of file fitsController.cpp.


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