DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
DigitalIn.cpp
Go to the documentation of this file.
1// This file is part of DynExp.
2
3#include "stdafx.h"
4#include "DigitalIn.h"
5
6namespace DynExpInstr
7{
12
14 {
15 ReadData(CallbackFunc);
16
17 auto InstrData = dynamic_InstrumentData_cast<DigitalIn>(GetInstrumentData());
18 auto Sample = InstrData->GetSampleStream()->ReadBasicSample().Value;
19
20 return Sample;
21 }
22
24 {
26
27 auto InstrData = dynamic_InstrumentData_cast<DigitalIn>(GetInstrumentData());
28 auto Sample = InstrData->GetSampleStream()->ReadBasicSample().Value;
29
30 return Sample;
31 }
32
36
40
44
48
53}
Defines a meta instrument for a single digital input port to read a data stream consisting of digital...
SampleT SampleType
Alias for SampleT.
virtual void ReadData(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
Enqueues a task to read data from the hardware to the data stream. The default implementation does no...
void ResetImpl(dispatch_tag< InputPortData >) override final
Definition DigitalIn.cpp:8
void DisableUserEditable()
Calls DynExp::ParamsBase::DisableUserEditable() on all bundled parameters.
Definition DigitalIn.cpp:37
virtual DigitalInData::SampleStreamType::SampleType GetSync() const
Synchronized version of Get(), which blocks until a DataStreamInstrument::ReadData() task getting enq...
Definition DigitalIn.cpp:23
virtual DigitalInData::SampleStreamType::SampleType Get(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
Reads one sample from the sample stream. CallbackFunc gets called after the task DataStreamInstrument...
Definition DigitalIn.cpp:13
void ResetImpl(dispatch_tag< InputPort >) override final
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
Definition DigitalIn.cpp:49
InstrumentDataTypeSyncPtrType GetInstrumentData(const std::chrono::milliseconds Timeout=GetInstrumentDataTimeoutDefault)
Locks the mutex of the instrument data class instance InstrumentData assigned to this InstrumentBase ...
ExceptionContainer AsSyncTask(void(DerivedInstrT::*TaskFunc)(TaskFuncArgTs...) const, ArgTs &&...Args) const
Calls a (derived) instrument's function which inserts a task into the instrument's task queue synchro...
Definition Instrument.h:649
Refer to ParamsBase::dispatch_tag.
Definition Instrument.h:146
Refer to ParamsBase::dispatch_tag.
Definition Object.h:2018
std::function< void(const TaskBase &, ExceptionContainer &)> CallbackType
Type of a callback function which is invoked when a task has finished, failed or has been aborted....
Definition Instrument.h:939
DynExp's instrument namespace contains the implementation of DynExp instruments which extend DynExp's...
Accumulates include statements to provide a precompiled header.