9 : Channel(Channel), CartesianResult(CartesianResult), Time(Time)
15 : Channel(Channel), PolarResult(PolarResult), Time(Time)
21 : Channel(Channel), CartesianResult(CartesianResult), PolarResult(PolarResult), Time(Time)
33 CartesianResult.X = PolarResult.R * std::cos(PolarResult.Theta);
34 CartesianResult.Y = PolarResult.R * std::sin(PolarResult.Theta);
51 auto Owner = DynExp::dynamic_Object_cast<LockinAmplifier>(&Instance.
GetOwner());
53 Owner->ApplyFromParams();
60 auto SamplingRate = GetSamplingRate();
64 return GetSampleStream()->GetStreamSizeWrite() / SamplingRate;
77 {
"Do not apply automatically", AutoApplyParamsType::DoNotApply },
78 {
"Automatically apply parameters", AutoApplyParamsType::AutoApply },
98 auto InstrParams = DynExp::dynamic_Params_cast<LockinAmplifier>(GetNonConstParams());
99 auto InstrData = DynExp::dynamic_InstrumentData_cast<LockinAmplifier>(GetInstrumentData());
101 InstrParams->Sensitivity = InstrData->GetSensitivity();
102 InstrParams->Phase = InstrData->GetPhase();
103 InstrParams->TimeConstant = InstrData->GetTimeConstant();
104 InstrParams->FilterOrder = InstrData->GetFilterOrder();
105 InstrParams->TriggerMode = InstrData->GetTriggerMode();
106 InstrParams->TriggerEdge = InstrData->GetTriggerEdge();
107 InstrParams->Signal = InstrData->GetSignalType();
108 InstrParams->SamplingRate = InstrData->GetSamplingRate();
109 InstrParams->Enable = InstrData->IsEnabled();
Defines a meta instrument for a lock-in amplifier.
virtual ~LockinAmplifierConfigurator()=0
double GetAcquisitionTime() const
Determines the duration of a single acquisition in seconds using GetSamplingRate() and DataStreamBase...
void ResetImpl(dispatch_tag< DataStreamInstrumentData >) override final
virtual ~LockinAmplifierParams()=0
static Util::TextValueListType< AutoApplyParamsType > AutoApplyParamsTypeStrList()
Maps description strings to the AutoApplyParamsType enum's items.
void InitFuncImpl(dispatch_tag< DataStreamInstrumentTasks::InitTask >, DynExp::InstrumentInstance &Instance) override final
Initializes the respective instrument within the instrument inheritance hierarchy....
virtual void AutoAdjustPhase(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
Makes the lock-in amplifier automatically set its demodulator's phase.
virtual void SetTriggerEdge(LockinAmplifierDefs::TriggerEdgeType TriggerEdge, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
Sets the lock-in amplifier's trigger edge.
virtual void ForceTrigger(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
Forces (starts) the data acquisition ignoring the trigger.
virtual void SetTriggerMode(LockinAmplifierDefs::TriggerModeType TriggerMode, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
Sets the lock-in amplifier's trigger mode.
void ResetImpl(dispatch_tag< DataStreamInstrument >) override final
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
virtual void SetFilterOrder(uint8_t FilterOrder, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
Sets the filter order/quality of the lock-in amplifier's low-poss filter.
virtual void SetSamplingRate(double SamplingRate, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
Sets the lock-in amplifier's sampling rate.
virtual void AutoAdjustSensitivity(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
Makes the lock-in amplifier automatically set its sensitivity/amplification.
virtual ~LockinAmplifier()=0
virtual void SetEnable(bool Enable, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
Enables or disables the lock-in amplifier's demodulator.
void ApplyFromParams() const
Applies the lock-in amplifier settings stored in the instrument parameters to the physical device....
void PersistDataToParams() const
Retrieves the current lock-in amplifier settings and stores them in the instrument parameters to save...
Refer to DynExp::ParamsBase::dispatch_tag.
Refer to ParamsBase::dispatch_tag.
Defines data for a thread belonging to a InstrumentBase instance. Refer to RunnableInstance.
Refer to ParamsBase::dispatch_tag.
const auto & GetOwner() const noexcept
Returns Owner.
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....
Thrown when a requested feature is either under development and thus not implemented yet or when a sp...
TriggerEdgeType
Type to determine at which edge of a trigger signal to trigger. Not a strongly-typed enum to allow us...
SignalType
Type specifying different signal coordinates a lock-in amplifier can record. Not a strongly-typed enu...
@ R
Radial component of the signal in polar coordinates.
@ Y
Y component of the signal in cartesian coordinates.
@ X
X component of the signal in cartesian coordinates.
@ Theta
Phase component of the signal in polar coordinates.
TriggerModeType
Type to determine the trigger mode. Not a strongly-typed enum to allow using the enumeration in a Dyn...
DynExp's instrument namespace contains the implementation of DynExp instruments which extend DynExp's...
std::vector< std::pair< TextType, ValueType > > TextValueListType
Type of a list containing key-value pairs where key is a text of type Util::TextType.
Accumulates include statements to provide a precompiled header.
Type describing a recorded lock-in sample in cartesian coordinates. Must be trivially copyable.
DataType Y
Y component of the signal in cartesian coordinates.
DataType X
X component of the signal in cartesian coordinates.
Type describing a recorded lock-in sample in polar coordinates. Must be trivially copyable.
DataType R
Radial component of the signal in polar coordinates.
DataType Theta
Phase component of the signal in polar coordinates.
LockinResultCartesian CartesianResult
Representation of the recorded sample in cartesian coordinates.
constexpr LockinSample() noexcept=default
Default-constructs a LockinSample instance.
void UpdatePolar() noexcept
Updates PolarResult based on CartesianResult.
DataType GetDisambiguatedValue(SignalType Signal) const noexcept
Retrieves the sample value represented as the coordinate specified by Signal.
LockinResultPolar PolarResult
Representation of the recorded sample in polar coordinates.
void UpdateCartesian() noexcept
Updates CartesianResult based on PolarResult.
double DataType
Data type used to store the sample (value and time)