DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
DummyDataStreamInstrument.cpp
Go to the documentation of this file.
1// This file is part of DynExp.
2
3#include "stdafx.h"
5
6namespace DynExpInstr
7{
9 {
10 auto InstrParams = DynExp::dynamic_Params_cast<DummyDataStreamInstrument>(Instance.ParamsGetter());
11 auto InstrData = DynExp::dynamic_InstrumentData_cast<DummyDataStreamInstrument>(Instance.InstrumentDataGetter());
12
13 InstrData->GetSampleStream()->SetStreamSize(InstrParams->StreamSizeParams.StreamSize);
14
16 }
17
19 {
20 auto InstrParams = DynExp::dynamic_Params_cast<DummyDataStreamInstrument>(Instance.ParamsGetter());
21 auto InstrData = DynExp::dynamic_InstrumentData_cast<DummyDataStreamInstrument>(Instance.InstrumentDataGetter());
22
23 InstrData->GetSampleStream()->SetStreamSize(InstrParams->StreamSizeParams.StreamSize);
24
25 return {};
26 }
27
32
34 : FunctionGenerator(OwnerThreadID, std::move(Params))
35 {
36 }
37
42}
Implementation of a data stream instrument without any related physical hardware.
void ResetImpl(dispatch_tag< FunctionGeneratorData >) override final
void InitFuncImpl(dispatch_tag< FunctionGeneratorTasks::InitTask >, DynExp::InstrumentInstance &Instance) override final
Initializes the respective instrument within the instrument inheritance hierarchy....
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
void ResetImpl(dispatch_tag< FunctionGenerator >) override final
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
DummyDataStreamInstrument(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
Function generator meta instrument based on the data stream meta instrument to generate waveforms by ...
Refer to DynExp::ParamsBase::dispatch_tag.
Refer to ParamsBase::dispatch_tag.
Definition Instrument.h:146
Defines data for a thread belonging to a InstrumentBase instance. Refer to RunnableInstance.
Definition Instrument.h:772
const InstrumentBase::InstrumentDataGetterType InstrumentDataGetter
Getter for instrument's data. Refer to InstrumentBase::InstrumentDataGetterType.
Definition Instrument.h:791
Refer to ParamsBase::dispatch_tag.
Definition Object.h:2018
const Object::ParamsGetterType ParamsGetter
Invoke to obtain the parameters (derived from ParamsBase) of Owner.
Definition Object.h:3671
Defines the return type of task functions.
Definition Instrument.h:824
DynExp's instrument namespace contains the implementation of DynExp instruments which extend DynExp's...
std::unique_ptr< ParamsBase > ParamsBasePtrType
Alias for a pointer to the parameter system base class ParamsBase.
Definition Object.h:1807
Accumulates include statements to provide a precompiled header.