DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
DynExpInstr::SpectrometerData Class Referenceabstract

Data class for Spectrometer. More...

#include <Spectrometer.h>

+ Inheritance diagram for DynExpInstr::SpectrometerData:

Classes

class  SpectrumType
 Type describing a spectrum as acquired by the Spectrometer instrument. More...
 

Public Types

enum class  CapturingStateType { Ready , Warning , Error , Capturing }
 Possible spectrometer states. More...
 
using TimeType = std::chrono::milliseconds
 Time type describing the spectrometer's times like its exposure time.
 
- Public Types inherited from DynExp::InstrumentDataBase
using TaskQueueType = std::list< std::unique_ptr< TaskBase > >
 Type of an instrument task queue owning the tasks within.
 
using TaskQueueIteratorType = TaskQueueType::const_iterator
 Const iterator type to elements of TaskQueueType.
 

Public Member Functions

 SpectrometerData ()=default
 
virtual ~SpectrometerData ()=default
 
auto GetMinExposureTime () const noexcept
 Getter for MinExposureTime.
 
void SetMinExposureTime (double MinExposureTime) noexcept
 Setter for MinExposureTime.
 
void SetMinExposureTime (TimeType MinExposureTime) noexcept
 Setter for MinExposureTime.
 
auto GetMaxExposureTime () const noexcept
 Getter for MaxExposureTime.
 
void SetMaxExposureTime (double MaxExposureTime) noexcept
 Setter for MaxExposureTime.
 
void SetMaxExposureTime (TimeType MaxExposureTime) noexcept
 Setter for MaxExposureTime.
 
auto GetCurrentExposureTime () const noexcept
 Getter for CurrentExposureTime.
 
void SetCurrentExposureTime (double CurrentExposureTime) noexcept
 Setter for CurrentExposureTime.
 
void SetCurrentExposureTime (TimeType CurrentExposureTime) noexcept
 Setter for CurrentExposureTime.
 
auto GetCurrentLowerFrequency () const noexcept
 Getter for CurrentLowerFrequency.
 
void SetCurrentLowerFrequency (double CurrentLowerFrequency) noexcept
 Setter for CurrentLowerFrequency.
 
auto GetCurrentUpperFrequency () const noexcept
 Getter for CurrentUpperFrequency.
 
void SetCurrentUpperFrequency (double CurrentUpperFrequency) noexcept
 Setter for CurrentUpperFrequency.
 
auto GetSilentModeEnabled () const noexcept
 Getter for SilentModeEnabled.
 
void SetSilentModeEnabled (bool Enable) noexcept
 Setter for SilentModeEnabled.
 
auto GetCapturingState () const noexcept
 Returns the spectrometer's current capturing state.
 
bool IsCapturing () const noexcept
 Determines whether the spectrometer is currently acquiring a spectrum.
 
auto GetCapturingProgress () const noexcept
 Determines the progress of a spectrum acquisition.
 
bool HasSpectrum () const noexcept
 Indicates whether the spectrum is empty.
 
SpectrumType GetSpectrum () const
 Moving getter for CurrentSpectrum.
 
SpectrumType GetSpectrumCopy () const
 Copying getter for CurrentSpectrum. This function is more expensive than GetSpectrum().
 
void SetSpectrum (SpectrumType &&Other)
 Setter for CurrentSpectrum.
 
void ClearSpectrum () const
 Resets CurrentSpectrum by calling SpectrumType::Reset().
 
- Public Member Functions inherited from DynExp::InstrumentDataBase
 InstrumentDataBase ()
 
virtual ~InstrumentDataBase ()
 
auto GetLastUpdateTime () const
 Getter for LastUpdate.
 
bool IsExceptionIndicated () const noexcept
 Getter for HasException. Only performs atomic operations. Hence, this instrument data instance does not need to be locked for this function call.
 
std::exception_ptr GetException () const noexcept
 Getter for InstrumentDataBase::InstrumentException. If InstrumentDataBase::InstrumentException is nullptr and InstrumentDataBase::HasException is still true, returns a pointer to a Util::Exception instance.
 
void EnqueueTask (std::unique_ptr< TaskBase > &&Task)
 Enqueues a task at the back of an instrument's task queue and notifies the instrument about the new task.
 
void EnqueuePriorityTask (std::unique_ptr< TaskBase > &&Task)
 Enqueues a task at the front of an instrument's task queue and notifies the instrument about the new task.
 
std::unique_ptr< TaskBasePopTaskFront ()
 Removes a task from the front of an instrument's task queue.
 
std::unique_ptr< TaskBasePopTaskBack ()
 Removes a task from the back of an instrument's task queue.
 
auto GetTaskFront () noexcept
 Getter for first enqueued task.
 
auto GetTaskBack () noexcept
 Getter for last enqueued task.
 
size_t GetNumEnqueuedTasks () const noexcept
 Getter for the instrument task queue's length.
 
std::unique_ptr< TaskBasePopFinishedTask ()
 Removes a task from the front of an instrument's list of finished tasks.
 
size_t GetNumFinishedTasks () const noexcept
 Getter for the length of the instrument's list of finished tasks.
 
bool IsQueueClosed () const noexcept
 Determines whether the instrument task queue is closed.
 
- Public Member Functions inherited from Util::INonCopyable
 INonCopyable (const INonCopyable &)=delete
 
INonCopyableoperator= (const INonCopyable &)=delete
 

Private Member Functions

void ResetImpl (dispatch_tag< InstrumentDataBase >) override final
 
virtual void ResetImpl (dispatch_tag< SpectrometerData >)
 
Override

Refer to DynExp::InstrumentDataBase::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every derived class gets called - starting from InstrumentDataBase, descending the inheritance hierarchy. Override in order to reset derived classes.

Override by derived classes.

virtual CapturingStateType GetCapturingStateChild () const noexcept=0
 Returns the spectrometer's current capturing state.
 
virtual double GetCapturingProgressChild () const noexcept
 Determines the progress of a spectrum acquisition.
 

Private Attributes

TimeType MinExposureTime
 Minimal exposure time the spectrometer supports.
 
TimeType MaxExposureTime
 Maximal exposure time the spectrometer supports.
 
TimeType CurrentExposureTime
 Current exposure time of the spectrometer.
 
double CurrentLowerFrequency = 0.0
 Current lower frequency limit where the spectrum acquisition begins.
 
double CurrentUpperFrequency = 0.0
 Current upper frequency limit where the spectrum acquisition ends.
 
bool SilentModeEnabled = false
 Indicates whether the spectrometer's silent mode is turned on, i.e. the spectrometer's fans are turned off.
 
SpectrumType CurrentSpectrum
 Current spectrum acquired by the spectrometer. Logical const-ness: allow const member function GetSpectrum() to move from CurrentSpectrum and ClearSpectrum() to clear it.
 

Additional Inherited Members

- Public Attributes inherited from DynExp::InstrumentDataBase
InstrumentBaseOnlyType InstrumentBaseOnly
 Allow exclusive access to some of InstrumentDataBase's private methods to InstrumentBase.
 
InstrumenThreadOnlyType InstrumentThreadOnly
 Allow exclusive access to some of InstrumentDataBase's private methods to the instrument thread InstrumentThreadMain().
 
- Protected Member Functions inherited from Util::ISynchronizedPointerLockable
 ISynchronizedPointerLockable ()
 
 ~ISynchronizedPointerLockable ()
 Object should never be destroyed before completely unlocked.
 
- Protected Member Functions inherited from Util::INonCopyable
constexpr INonCopyable ()=default
 
 ~INonCopyable ()=default
 

Detailed Description

Data class for Spectrometer.

Definition at line 65 of file Spectrometer.h.

Member Typedef Documentation

◆ TimeType

using DynExpInstr::SpectrometerData::TimeType = std::chrono::milliseconds

Time type describing the spectrometer's times like its exposure time.

Definition at line 71 of file Spectrometer.h.

Member Enumeration Documentation

◆ CapturingStateType

Possible spectrometer states.

Enumerator
Ready 

The spectrometer is ready to acquire a spectrum.

Warning 

The spectrometer is in a warning state, but still ready to acquire a spectrum.

Error 

The spectrometer is in an error state.

Capturing 

The spectrometer is currently acquiring a spectrum.

Definition at line 76 of file Spectrometer.h.

Constructor & Destructor Documentation

◆ SpectrometerData()

DynExpInstr::SpectrometerData::SpectrometerData ( )
default

◆ ~SpectrometerData()

virtual DynExpInstr::SpectrometerData::~SpectrometerData ( )
virtualdefault

Member Function Documentation

◆ ClearSpectrum()

void DynExpInstr::SpectrometerData::ClearSpectrum ( ) const

Resets CurrentSpectrum by calling SpectrumType::Reset().

Definition at line 54 of file Spectrometer.cpp.

◆ GetCapturingProgress()

auto DynExpInstr::SpectrometerData::GetCapturingProgress ( ) const
inlinenoexcept

Determines the progress of a spectrum acquisition.

Returns
Returns the current progress of the spectrum acquisition as a value in between 0 and 100 (% units).

Definition at line 185 of file Spectrometer.h.

◆ GetCapturingProgressChild()

virtual double DynExpInstr::SpectrometerData::GetCapturingProgressChild ( ) const
inlineprivatevirtualnoexcept

Determines the progress of a spectrum acquisition.

Returns
Returns the current progress of the spectrum acquisition as a value in between 0 and 100 (% units).

Definition at line 226 of file Spectrometer.h.

◆ GetCapturingState()

auto DynExpInstr::SpectrometerData::GetCapturingState ( ) const
inlinenoexcept

Returns the spectrometer's current capturing state.

Returns
Capturing state of type SpectrometerData::CapturingStateType

Definition at line 171 of file Spectrometer.h.

◆ GetCapturingStateChild()

virtual CapturingStateType DynExpInstr::SpectrometerData::GetCapturingStateChild ( ) const
privatepure virtualnoexcept

Returns the spectrometer's current capturing state.

Returns
Capturing state of type SpectrometerData::CapturingStateType

◆ GetCurrentExposureTime()

auto DynExpInstr::SpectrometerData::GetCurrentExposureTime ( ) const
inlinenoexcept

Getter for CurrentExposureTime.

Definition at line 157 of file Spectrometer.h.

◆ GetCurrentLowerFrequency()

auto DynExpInstr::SpectrometerData::GetCurrentLowerFrequency ( ) const
inlinenoexcept

Getter for CurrentLowerFrequency.

Definition at line 160 of file Spectrometer.h.

◆ GetCurrentUpperFrequency()

auto DynExpInstr::SpectrometerData::GetCurrentUpperFrequency ( ) const
inlinenoexcept

Getter for CurrentUpperFrequency.

Definition at line 162 of file Spectrometer.h.

◆ GetMaxExposureTime()

auto DynExpInstr::SpectrometerData::GetMaxExposureTime ( ) const
inlinenoexcept

Getter for MaxExposureTime.

Definition at line 154 of file Spectrometer.h.

◆ GetMinExposureTime()

auto DynExpInstr::SpectrometerData::GetMinExposureTime ( ) const
inlinenoexcept

Getter for MinExposureTime.

Definition at line 151 of file Spectrometer.h.

◆ GetSilentModeEnabled()

auto DynExpInstr::SpectrometerData::GetSilentModeEnabled ( ) const
inlinenoexcept

Getter for SilentModeEnabled.

Definition at line 164 of file Spectrometer.h.

◆ GetSpectrum()

SpectrometerData::SpectrumType DynExpInstr::SpectrometerData::GetSpectrum ( ) const

Moving getter for CurrentSpectrum.

Returns
Returns a spectrum move-constructed from CurrentSpectrum. Subsequent calls to GetSpectrum() will return an empty spectrum until a new one has been acquired.

Definition at line 39 of file Spectrometer.cpp.

◆ GetSpectrumCopy()

SpectrometerData::SpectrumType DynExpInstr::SpectrometerData::GetSpectrumCopy ( ) const

Copying getter for CurrentSpectrum. This function is more expensive than GetSpectrum().

Returns
Returns a spectrum copy-constructed from CurrentSpectrum.

Definition at line 44 of file Spectrometer.cpp.

◆ HasSpectrum()

bool DynExpInstr::SpectrometerData::HasSpectrum ( ) const
inlinenoexcept

Indicates whether the spectrum is empty.

Returns
Returns true when SpectrumType::Samples contain at least one sample, false otherwise.

Definition at line 190 of file Spectrometer.h.

◆ IsCapturing()

bool DynExpInstr::SpectrometerData::IsCapturing ( ) const
inlinenoexcept

Determines whether the spectrometer is currently acquiring a spectrum.

Returns
Returns true if GetCapturingState() returns CapturingStateType::Capturing, false otherwise.

Definition at line 178 of file Spectrometer.h.

◆ ResetImpl() [1/2]

void DynExpInstr::SpectrometerData::ResetImpl ( dispatch_tag< InstrumentDataBase )
finaloverrideprivate

Definition at line 59 of file Spectrometer.cpp.

◆ ResetImpl() [2/2]

virtual void DynExpInstr::SpectrometerData::ResetImpl ( dispatch_tag< SpectrometerData )
inlineprivatevirtual

Definition at line 219 of file Spectrometer.h.

◆ SetCurrentExposureTime() [1/2]

void DynExpInstr::SpectrometerData::SetCurrentExposureTime ( double  CurrentExposureTime)
inlinenoexcept

Setter for CurrentExposureTime.

Definition at line 158 of file Spectrometer.h.

◆ SetCurrentExposureTime() [2/2]

void DynExpInstr::SpectrometerData::SetCurrentExposureTime ( TimeType  CurrentExposureTime)
inlinenoexcept

Setter for CurrentExposureTime.

Definition at line 159 of file Spectrometer.h.

◆ SetCurrentLowerFrequency()

void DynExpInstr::SpectrometerData::SetCurrentLowerFrequency ( double  CurrentLowerFrequency)
inlinenoexcept

Setter for CurrentLowerFrequency.

Definition at line 161 of file Spectrometer.h.

◆ SetCurrentUpperFrequency()

void DynExpInstr::SpectrometerData::SetCurrentUpperFrequency ( double  CurrentUpperFrequency)
inlinenoexcept

Setter for CurrentUpperFrequency.

Definition at line 163 of file Spectrometer.h.

◆ SetMaxExposureTime() [1/2]

void DynExpInstr::SpectrometerData::SetMaxExposureTime ( double  MaxExposureTime)
inlinenoexcept

Setter for MaxExposureTime.

Definition at line 155 of file Spectrometer.h.

◆ SetMaxExposureTime() [2/2]

void DynExpInstr::SpectrometerData::SetMaxExposureTime ( TimeType  MaxExposureTime)
inlinenoexcept

Setter for MaxExposureTime.

Definition at line 156 of file Spectrometer.h.

◆ SetMinExposureTime() [1/2]

void DynExpInstr::SpectrometerData::SetMinExposureTime ( double  MinExposureTime)
inlinenoexcept

Setter for MinExposureTime.

Definition at line 152 of file Spectrometer.h.

◆ SetMinExposureTime() [2/2]

void DynExpInstr::SpectrometerData::SetMinExposureTime ( TimeType  MinExposureTime)
inlinenoexcept

Setter for MinExposureTime.

Definition at line 153 of file Spectrometer.h.

◆ SetSilentModeEnabled()

void DynExpInstr::SpectrometerData::SetSilentModeEnabled ( bool  Enable)
inlinenoexcept

Setter for SilentModeEnabled.

Definition at line 165 of file Spectrometer.h.

◆ SetSpectrum()

void DynExpInstr::SpectrometerData::SetSpectrum ( SpectrumType &&  Other)

Setter for CurrentSpectrum.

Parameters
OtherSpectrum to set CurrentSpectrum to by moving from Other.

Definition at line 49 of file Spectrometer.cpp.

Member Data Documentation

◆ CurrentExposureTime

TimeType DynExpInstr::SpectrometerData::CurrentExposureTime
private

Current exposure time of the spectrometer.

Definition at line 231 of file Spectrometer.h.

◆ CurrentLowerFrequency

double DynExpInstr::SpectrometerData::CurrentLowerFrequency = 0.0
private

Current lower frequency limit where the spectrum acquisition begins.

Definition at line 232 of file Spectrometer.h.

◆ CurrentSpectrum

SpectrumType DynExpInstr::SpectrometerData::CurrentSpectrum
mutableprivate

Current spectrum acquired by the spectrometer. Logical const-ness: allow const member function GetSpectrum() to move from CurrentSpectrum and ClearSpectrum() to clear it.

Definition at line 241 of file Spectrometer.h.

◆ CurrentUpperFrequency

double DynExpInstr::SpectrometerData::CurrentUpperFrequency = 0.0
private

Current upper frequency limit where the spectrum acquisition ends.

Definition at line 233 of file Spectrometer.h.

◆ MaxExposureTime

TimeType DynExpInstr::SpectrometerData::MaxExposureTime
private

Maximal exposure time the spectrometer supports.

Definition at line 230 of file Spectrometer.h.

◆ MinExposureTime

TimeType DynExpInstr::SpectrometerData::MinExposureTime
private

Minimal exposure time the spectrometer supports.

Definition at line 229 of file Spectrometer.h.

◆ SilentModeEnabled

bool DynExpInstr::SpectrometerData::SilentModeEnabled = false
private

Indicates whether the spectrometer's silent mode is turned on, i.e. the spectrometer's fans are turned off.

Definition at line 234 of file Spectrometer.h.


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