DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExpInstr::SpectrometerData Class Referenceabstract

Data class for Spectrometer. More...

+ Inheritance diagram for DynExpInstr::SpectrometerData:

Classes

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

Public Types

enum class  FrequencyUnitType { Hz , nm , Inv_cm }
 Supported spectrometer frequency units. More...
 
enum class  IntensityUnitType { Counts }
 Supported spectrometer intensity units. More...
 
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. More...
 
- Public Types inherited from DynExp::InstrumentDataBase
using TaskQueueType = std::list< std::unique_ptr< TaskBase > >
 Type of an instrument task queue owning the tasks within. More...
 
using TaskQueueIteratorType = TaskQueueType::const_iterator
 Const iterator type to elements of TaskQueueType. More...
 

Public Member Functions

 SpectrometerData ()=default
 
virtual ~SpectrometerData ()=default
 
auto GetMinExposureTime () const noexcept
 Getter for MinExposureTime. More...
 
void SetMinExposureTime (double MinExposureTime) noexcept
 Setter for MinExposureTime. More...
 
void SetMinExposureTime (TimeType MinExposureTime) noexcept
 Setter for MinExposureTime. More...
 
auto GetMaxExposureTime () const noexcept
 Getter for MaxExposureTime. More...
 
void SetMaxExposureTime (double MaxExposureTime) noexcept
 Setter for MaxExposureTime. More...
 
void SetMaxExposureTime (TimeType MaxExposureTime) noexcept
 Setter for MaxExposureTime. More...
 
auto GetCurrentExposureTime () const noexcept
 Getter for CurrentExposureTime. More...
 
void SetCurrentExposureTime (double CurrentExposureTime) noexcept
 Setter for CurrentExposureTime. More...
 
void SetCurrentExposureTime (TimeType CurrentExposureTime) noexcept
 Setter for CurrentExposureTime. More...
 
auto GetCurrentLowerFrequency () const noexcept
 Getter for CurrentLowerFrequency. More...
 
void SetCurrentLowerFrequency (double CurrentLowerFrequency) noexcept
 Setter for CurrentLowerFrequency. More...
 
auto GetCurrentUpperFrequency () const noexcept
 Getter for CurrentUpperFrequency. More...
 
void SetCurrentUpperFrequency (double CurrentUpperFrequency) noexcept
 Setter for CurrentUpperFrequency. More...
 
auto GetSilentModeEnabled () const noexcept
 Getter for SilentModeEnabled. More...
 
void SetSilentModeEnabled (bool Enable) noexcept
 Setter for SilentModeEnabled. More...
 
auto GetCapturingState () const noexcept
 Returns the spectrometer's current capturing state. More...
 
bool IsCapturing () const noexcept
 Determines whether the spectrometer is currently acquiring a spectrum. More...
 
auto GetCapturingProgress () const noexcept
 Determines the progress of a spectrum acquisition. More...
 
bool HasSpectrum () const noexcept
 Indicates whether the spectrum is empty. More...
 
SpectrumType GetSpectrum () const
 Moving getter for CurrentSpectrum. More...
 
SpectrumType GetSpectrumCopy () const
 Copying getter for CurrentSpectrum. This function is more expensive than GetSpectrum(). More...
 
void SetSpectrum (SpectrumType &&Other)
 Setter for CurrentSpectrum. More...
 
void ClearSpectrum () const
 Resets CurrentSpectrum by calling SpectrumType::Reset(). More...
 
- Public Member Functions inherited from DynExp::InstrumentDataBase
 InstrumentDataBase ()
 
virtual ~InstrumentDataBase ()
 
auto GetLastUpdateTime () const
 Getter for LastUpdate. More...
 
auto GetException () const noexcept
 Getter for InstrumentDataBase::InstrumentException. More...
 
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. More...
 
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. More...
 
std::unique_ptr< TaskBasePopTaskFront ()
 Removes a task from the front of an instrument's task queue. More...
 
std::unique_ptr< TaskBasePopTaskBack ()
 Removes a task from the back of an instrument's task queue. More...
 
auto GetTaskFront () noexcept
 Getter for first enqueued task. More...
 
auto GetTaskBack () noexcept
 Getter for last enqueued task. More...
 
size_t GetNumEnqueuedTasks () const noexcept
 Getter for the instrument task queue's length. More...
 
std::unique_ptr< TaskBasePopFinishedTask ()
 Removes a task from the front of an instrument's list of finished tasks. More...
 
size_t GetNumFinishedTasks () const noexcept
 Getter for the length of the instrument's list of finished tasks. More...
 
bool IsQueueClosed () const noexcept
 Determines whether the instrument task queue is closed. More...
 
- Public Member Functions inherited from Util::INonCopyable
 INonCopyable (const INonCopyable &)=delete
 
INonCopyableoperator= (const INonCopyable &)=delete
 

Static Public Member Functions

static const char * FrequencyUnitTypeToStr (const FrequencyUnitType &Unit)
 Returns a descriptive string of a respective frequency unit to be e.g. used in plots. More...
 
static const char * IntensityUnitTypeToStr (const IntensityUnitType &Unit)
 Returns a descriptive string of a respective intensity unit to be e.g. used in plots. More...
 

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. More...
 
virtual double GetCapturingProgressChild () const noexcept
 Determines the progress of a spectrum acquisition. More...
 

Private Attributes

TimeType MinExposureTime
 Minimal exposure time the spectrometer supports. More...
 
TimeType MaxExposureTime
 Maximal exposure time the spectrometer supports. More...
 
TimeType CurrentExposureTime
 Current exposure time of the spectrometer. More...
 
double CurrentLowerFrequency = 0.0
 Current lower frequency limit where the spectrum acquisition begins. More...
 
double CurrentUpperFrequency = 0.0
 Current upper frequency limit where the spectrum acquisition ends. More...
 
bool SilentModeEnabled = false
 Indicates whether the spectrometer's silent mode is turned on, i.e. the spectrometer's fans are turned off. More...
 
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. More...
 

Additional Inherited Members

- Public Attributes inherited from DynExp::InstrumentDataBase
InstrumentBaseOnlyType InstrumentBaseOnly
 Allow exclusive access to some of InstrumentDataBase's private methods to InstrumentBase. More...
 
InstrumenThreadOnlyType InstrumentThreadOnly
 Allow exclusive access to some of InstrumentDataBase's private methods to the instrument thread InstrumentThreadMain(). More...
 
- Protected Member Functions inherited from Util::ISynchronizedPointerLockable
 ISynchronizedPointerLockable ()
 
 ~ISynchronizedPointerLockable ()
 Object should never be destroyed before completely unlocked. More...
 
- 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 110 of file Spectrometer.h.

◆ FrequencyUnitType

Supported spectrometer frequency units.

Warning
If this is changed, also change ConvertFrequencyUnitType() functions in NetworkSpectrometer.h and FrequencyUnitType enumeration in Common.proto.
Enumerator
Hz 

Frequency in Hz.

nm 

Wavelength in nm.

Inv_cm 

Wavenumber in 1/cm.

Definition at line 78 of file Spectrometer.h.

◆ IntensityUnitType

Supported spectrometer intensity units.

Warning
If this is changed, also change ConvertIntensityUnitType() functions in NetworkSpectrometer.h and IntensityUnitType enumeration in Common.proto.
Enumerator
Counts 

Number of counts (arbitrary unit)

Definition at line 89 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 74 of file Spectrometer.cpp.

◆ FrequencyUnitTypeToStr()

const char * DynExpInstr::SpectrometerData::FrequencyUnitTypeToStr ( const FrequencyUnitType Unit)
static

Returns a descriptive string of a respective frequency unit to be e.g. used in plots.

Parameters
UnitFrequency unit type as used by spectrometer instruments.
Returns
Unit string

Definition at line 8 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 219 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 260 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 205 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 191 of file Spectrometer.h.

◆ GetCurrentLowerFrequency()

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

Getter for CurrentLowerFrequency.

Definition at line 194 of file Spectrometer.h.

◆ GetCurrentUpperFrequency()

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

Getter for CurrentUpperFrequency.

Definition at line 196 of file Spectrometer.h.

◆ GetMaxExposureTime()

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

Getter for MaxExposureTime.

Definition at line 188 of file Spectrometer.h.

◆ GetMinExposureTime()

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

Getter for MinExposureTime.

Definition at line 185 of file Spectrometer.h.

◆ GetSilentModeEnabled()

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

Getter for SilentModeEnabled.

Definition at line 198 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 59 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 64 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 224 of file Spectrometer.h.

◆ IntensityUnitTypeToStr()

const char * DynExpInstr::SpectrometerData::IntensityUnitTypeToStr ( const IntensityUnitType Unit)
static

Returns a descriptive string of a respective intensity unit to be e.g. used in plots.

Parameters
UnitIntensity unit type as used by spectrometer instruments.
Returns
Unit string

Definition at line 19 of file Spectrometer.cpp.

◆ 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 212 of file Spectrometer.h.

◆ ResetImpl() [1/2]

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

Definition at line 79 of file Spectrometer.cpp.

◆ ResetImpl() [2/2]

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

Definition at line 253 of file Spectrometer.h.

◆ SetCurrentExposureTime() [1/2]

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

Setter for CurrentExposureTime.

Definition at line 192 of file Spectrometer.h.

◆ SetCurrentExposureTime() [2/2]

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

Setter for CurrentExposureTime.

Definition at line 193 of file Spectrometer.h.

◆ SetCurrentLowerFrequency()

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

Setter for CurrentLowerFrequency.

Definition at line 195 of file Spectrometer.h.

◆ SetCurrentUpperFrequency()

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

Setter for CurrentUpperFrequency.

Definition at line 197 of file Spectrometer.h.

◆ SetMaxExposureTime() [1/2]

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

Setter for MaxExposureTime.

Definition at line 189 of file Spectrometer.h.

◆ SetMaxExposureTime() [2/2]

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

Setter for MaxExposureTime.

Definition at line 190 of file Spectrometer.h.

◆ SetMinExposureTime() [1/2]

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

Setter for MinExposureTime.

Definition at line 186 of file Spectrometer.h.

◆ SetMinExposureTime() [2/2]

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

Setter for MinExposureTime.

Definition at line 187 of file Spectrometer.h.

◆ SetSilentModeEnabled()

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

Setter for SilentModeEnabled.

Definition at line 199 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 69 of file Spectrometer.cpp.

Member Data Documentation

◆ CurrentExposureTime

TimeType DynExpInstr::SpectrometerData::CurrentExposureTime
private

Current exposure time of the spectrometer.

Definition at line 265 of file Spectrometer.h.

◆ CurrentLowerFrequency

double DynExpInstr::SpectrometerData::CurrentLowerFrequency = 0.0
private

Current lower frequency limit where the spectrum acquisition begins.

Definition at line 266 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 275 of file Spectrometer.h.

◆ CurrentUpperFrequency

double DynExpInstr::SpectrometerData::CurrentUpperFrequency = 0.0
private

Current upper frequency limit where the spectrum acquisition ends.

Definition at line 267 of file Spectrometer.h.

◆ MaxExposureTime

TimeType DynExpInstr::SpectrometerData::MaxExposureTime
private

Maximal exposure time the spectrometer supports.

Definition at line 264 of file Spectrometer.h.

◆ MinExposureTime

TimeType DynExpInstr::SpectrometerData::MinExposureTime
private

Minimal exposure time the spectrometer supports.

Definition at line 263 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 268 of file Spectrometer.h.


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