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

Python mapping of a DynExpInstr::DataStreamInstrument's DynExpInstr::DataStreamBase instance. More...

#include <PyModules.h>

Public Member Functions

 PyDataStreamInstrument () noexcept=default
 Default-constructs a PyDataStreamInstrument object.
 
size_t CalcLastConsumedSampleID (size_t NumConsumedSamples) const
 Allows to calculate the ID of the last consumed sample based on the amount of samples consumed from the stream.
 
size_t ConsumeNone () const
 Allows to calculate the ID of the last consumed sample for the situation that no samples was consumed.
 
size_t ConsumeAll () const
 Allows to calculate the ID of the last consumed sample for the situation that all samples were consumed.
 
void Clear ()
 Requests a call to DataStreamBase::Clear() on the related data stream instrument. Sets ShouldClearFlag to true.
 
Not mapped to Python

These functions cannot be accessed through the Python interface.

 PyDataStreamInstrument (bool IsTimeUsed, DataStreamInstrumentData::UnitType ValueUnit) noexcept
 Constructs a PyDataStreamInstrument object.
 
void Cleared ()
 Resets ShouldClearFlag to false.
 
auto ShouldCLear () const noexcept
 Getter for ShouldClearFlag.
 

Static Public Member Functions

static void import ()
 Make the Python interpreter import this module as PyModuleDataStreamInstrument. GIL has to be acquired before.
 

Public Attributes

bool IsTimeUsed { false }
 Contains the result of DynExpInstr::DataStreamBase::IsBasicSampleTimeUsed().
 
DataStreamInstrumentData::UnitType ValueUnit { DataStreamInstrumentData::UnitType::Arbitrary }
 Refer to DynExpInstr::DataStreamInstrumentData::UnitType.
 
size_t StreamSizeRead {}
 Contains the result of DynExpInstr::DataStreamBase::GetStreamSizeRead().
 
size_t StreamSizeWrite {}
 Contains the result of DynExpInstr::DataStreamBase::GetStreamSizeWrite().
 
size_t NumSamplesWritten {}
 Contains the result of DynExpInstr::DataStreamBase::GetNumSamplesWritten().
 
DataStreamBase::BasicSampleListType Samples
 Samples of the data stream instrument.
 

Private Attributes

bool ShouldClearFlag { false }
 Indicates whether DataStreamBase::Clear() should be called on the related data stream instrument.
 

Detailed Description

Python mapping of a DynExpInstr::DataStreamInstrument's DynExpInstr::DataStreamBase instance.

Definition at line 19 of file PyModules.h.

Constructor & Destructor Documentation

◆ PyDataStreamInstrument() [1/2]

DynExpInstr::PyDataStreamInstrument::PyDataStreamInstrument ( )
defaultnoexcept

Default-constructs a PyDataStreamInstrument object.

◆ PyDataStreamInstrument() [2/2]

DynExpInstr::PyDataStreamInstrument::PyDataStreamInstrument ( bool  IsTimeUsed,
DataStreamInstrumentData::UnitType  ValueUnit 
)
inlinenoexcept

Constructs a PyDataStreamInstrument object.

Parameters
IsTimeUsedContains the result of DynExpInstr::DataStreamBase::IsBasicSampleTimeUsed().
ValueUnitRefer to DynExpInstr::DataStreamInstrumentData::UnitType.

Definition at line 42 of file PyModules.h.

Member Function Documentation

◆ CalcLastConsumedSampleID()

size_t DynExpInstr::PyDataStreamInstrument::CalcLastConsumedSampleID ( size_t  NumConsumedSamples) const

Allows to calculate the ID of the last consumed sample based on the amount of samples consumed from the stream.

Parameters
NumConsumedSamplesNumber of samples consumed from Samples
Returns
ID of the last consumed sample

Definition at line 57 of file PyModules.cpp.

◆ Clear()

void DynExpInstr::PyDataStreamInstrument::Clear ( )
inline

Requests a call to DataStreamBase::Clear() on the related data stream instrument. Sets ShouldClearFlag to true.

Definition at line 79 of file PyModules.h.

◆ Cleared()

void DynExpInstr::PyDataStreamInstrument::Cleared ( )
inline

Resets ShouldClearFlag to false.

Definition at line 48 of file PyModules.h.

◆ ConsumeAll()

size_t DynExpInstr::PyDataStreamInstrument::ConsumeAll ( ) const

Allows to calculate the ID of the last consumed sample for the situation that all samples were consumed.

Returns
ID of the last consumed sample

Definition at line 62 of file PyModules.cpp.

◆ ConsumeNone()

size_t DynExpInstr::PyDataStreamInstrument::ConsumeNone ( ) const
inline

Allows to calculate the ID of the last consumed sample for the situation that no samples was consumed.

Returns
ID of the last consumed sample

Definition at line 67 of file PyModules.h.

◆ import()

void DynExpInstr::PyDataStreamInstrument::import ( )
static

Make the Python interpreter import this module as PyModuleDataStreamInstrument. GIL has to be acquired before.

Definition at line 52 of file PyModules.cpp.

◆ ShouldCLear()

auto DynExpInstr::PyDataStreamInstrument::ShouldCLear ( ) const
inlinenoexcept

Getter for ShouldClearFlag.

Definition at line 53 of file PyModules.h.

Member Data Documentation

◆ IsTimeUsed

bool DynExpInstr::PyDataStreamInstrument::IsTimeUsed { false }

Contains the result of DynExpInstr::DataStreamBase::IsBasicSampleTimeUsed().

Definition at line 84 of file PyModules.h.

◆ NumSamplesWritten

size_t DynExpInstr::PyDataStreamInstrument::NumSamplesWritten {}

Contains the result of DynExpInstr::DataStreamBase::GetNumSamplesWritten().

Definition at line 104 of file PyModules.h.

◆ Samples

DataStreamBase::BasicSampleListType DynExpInstr::PyDataStreamInstrument::Samples

Samples of the data stream instrument.

Definition at line 109 of file PyModules.h.

◆ ShouldClearFlag

bool DynExpInstr::PyDataStreamInstrument::ShouldClearFlag { false }
private

Indicates whether DataStreamBase::Clear() should be called on the related data stream instrument.

Definition at line 115 of file PyModules.h.

◆ StreamSizeRead

size_t DynExpInstr::PyDataStreamInstrument::StreamSizeRead {}

Contains the result of DynExpInstr::DataStreamBase::GetStreamSizeRead().

Definition at line 94 of file PyModules.h.

◆ StreamSizeWrite

size_t DynExpInstr::PyDataStreamInstrument::StreamSizeWrite {}

Contains the result of DynExpInstr::DataStreamBase::GetStreamSizeWrite().

Definition at line 99 of file PyModules.h.

◆ ValueUnit

DataStreamInstrumentData::UnitType DynExpInstr::PyDataStreamInstrument::ValueUnit { DataStreamInstrumentData::UnitType::Arbitrary }

Refer to DynExpInstr::DataStreamInstrumentData::UnitType.

Definition at line 89 of file PyModules.h.


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