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

Data class for Laser. More...

#include <Laser.h>

+ Inheritance diagram for DynExpInstr::LaserData:

Public Types

enum class  FrequencyUnitType { Hz , nm }
 Supported laser frequency units. More...
 
enum class  IntensityUnitType { Power_W }
 Supported laser intensity units. More...
 
enum class  LaserStateType {
  Startup , Ready , EmissionEnabledConstant , EmissionEnabledScanning ,
  Error
}
 Possible laser states. 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.
 
using TaskQueueIteratorType = TaskQueueType::const_iterator
 Const iterator type to elements of TaskQueueType.
 

Public Member Functions

 LaserData ()=default
 
virtual ~LaserData ()=default
 
void SetFrequencyValue (double Frequency) noexcept
 Setter for Frequency.
 
auto GetFrequencyValue () const noexcept
 Getter for Frequency.
 
void SetIntensityValue (double Intensity) noexcept
 Setter for Intensity.
 
auto GetIntensityValue () const noexcept
 Getter for Intensity.
 
void SetScanRangeValue (double ScanRange) noexcept
 Setter for ScanRange.
 
auto GetScanRangeValue () const noexcept
 Getter for ScanRange.
 
void SetScanRateValue (double ScanRate) noexcept
 Setter for ScanRate.
 
auto GetScanRateValue () const noexcept
 Getter for ScanRate.
 
auto GetLaserState () const noexcept
 Returns the laser's current state.
 
- 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
 

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 the UI.
 
static const char * IntensityUnitTypeToStr (const IntensityUnitType &Unit)
 Returns a descriptive string of a respective intensity unit to be e.g. used in the UI.
 

Private Member Functions

void ResetImpl (dispatch_tag< InstrumentDataBase >) override final
 
virtual void ResetImpl (dispatch_tag< LaserData >)
 
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 LaserStateType GetLaserStateChild () const noexcept=0
 Returns the laser's current state.
 

Private Attributes

double Frequency = 0.0
 Current frequency.
 
double Intensity = 0.0
 Current intensity.
 
double ScanRange = 0.0
 Current scan range.
 
double ScanRate = 0.0
 Current scan rate.
 

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 Laser.

Definition at line 65 of file Laser.h.

Member Enumeration Documentation

◆ FrequencyUnitType

Supported laser frequency units.

Warning
If this is changed, also change ToPrototUnitType(LaserData::FrequencyUnitType) and ToLaserUnitType(DynExpProto::Common::FrequencyUnitType) functions in NetworkLaser.h and FrequencyUnitType enumeration in Common.proto.
Enumerator
Hz 

Frequency in Hz.

nm 

Wavelength in nm.

Definition at line 74 of file Laser.h.

◆ IntensityUnitType

Supported laser intensity units.

Warning
If this is changed, also change ToPrototUnitType(LaserData::IntensityUnitType) and ToLaserUnitType(DynExpProto::Common::IntensityUnitType) functions in NetworkLaser.h and IntensityUnitType enumeration in Common.proto.
Enumerator
Power_W 

Power in Watt (W)

Definition at line 85 of file Laser.h.

◆ LaserStateType

Possible laser states.

Enumerator
Startup 

The laser is warming up.

Ready 

The laser is ready for emission.

EmissionEnabledConstant 

The laser is emitting in constant mode.

EmissionEnabledScanning 

The laser is emitting in scan mode.

Error 

The laser is in an error state.

Definition at line 106 of file Laser.h.

Constructor & Destructor Documentation

◆ LaserData()

DynExpInstr::LaserData::LaserData ( )
default

◆ ~LaserData()

virtual DynExpInstr::LaserData::~LaserData ( )
virtualdefault

Member Function Documentation

◆ FrequencyUnitTypeToStr()

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

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

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

Definition at line 8 of file Laser.cpp.

◆ GetFrequencyValue()

auto DynExpInstr::LaserData::GetFrequencyValue ( ) const
inlinenoexcept

Getter for Frequency.

Definition at line 118 of file Laser.h.

◆ GetIntensityValue()

auto DynExpInstr::LaserData::GetIntensityValue ( ) const
inlinenoexcept

Getter for Intensity.

Definition at line 120 of file Laser.h.

◆ GetLaserState()

auto DynExpInstr::LaserData::GetLaserState ( ) const
inlinenoexcept

Returns the laser's current state.

Returns
Laser state of type LaserData::StateType

Definition at line 130 of file Laser.h.

◆ GetLaserStateChild()

virtual LaserStateType DynExpInstr::LaserData::GetLaserStateChild ( ) const
privatepure virtualnoexcept

Returns the laser's current state.

Returns
Laser state of type LaserData::StateType

◆ GetScanRangeValue()

auto DynExpInstr::LaserData::GetScanRangeValue ( ) const
inlinenoexcept

Getter for ScanRange.

Definition at line 122 of file Laser.h.

◆ GetScanRateValue()

auto DynExpInstr::LaserData::GetScanRateValue ( ) const
inlinenoexcept

Getter for ScanRate.

Definition at line 124 of file Laser.h.

◆ IntensityUnitTypeToStr()

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

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

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

Definition at line 18 of file Laser.cpp.

◆ ResetImpl() [1/2]

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

Definition at line 27 of file Laser.cpp.

◆ ResetImpl() [2/2]

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

Definition at line 134 of file Laser.h.

◆ SetFrequencyValue()

void DynExpInstr::LaserData::SetFrequencyValue ( double  Frequency)
inlinenoexcept

Setter for Frequency.

Definition at line 117 of file Laser.h.

◆ SetIntensityValue()

void DynExpInstr::LaserData::SetIntensityValue ( double  Intensity)
inlinenoexcept

Setter for Intensity.

Definition at line 119 of file Laser.h.

◆ SetScanRangeValue()

void DynExpInstr::LaserData::SetScanRangeValue ( double  ScanRange)
inlinenoexcept

Setter for ScanRange.

Definition at line 121 of file Laser.h.

◆ SetScanRateValue()

void DynExpInstr::LaserData::SetScanRateValue ( double  ScanRate)
inlinenoexcept

Setter for ScanRate.

Definition at line 123 of file Laser.h.

Member Data Documentation

◆ Frequency

double DynExpInstr::LaserData::Frequency = 0.0
private

Current frequency.

Definition at line 143 of file Laser.h.

◆ Intensity

double DynExpInstr::LaserData::Intensity = 0.0
private

Current intensity.

Definition at line 144 of file Laser.h.

◆ ScanRange

double DynExpInstr::LaserData::ScanRange = 0.0
private

Current scan range.

Definition at line 145 of file Laser.h.

◆ ScanRate

double DynExpInstr::LaserData::ScanRate = 0.0
private

Current scan rate.

Definition at line 146 of file Laser.h.


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