DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Loading...
Searching...
No Matches
DummyAnalogIn.h
Go to the documentation of this file.
1// This file is part of DynExp.
2
8#pragma once
9
10#include "stdafx.h"
11#include "DynExpCore.h"
13
14namespace DynExpInstr
15{
16 class DummyAnalogIn;
17
38
40 {
41
42 public:
43 DummyAnalogInData() = default;
44 virtual ~DummyAnalogInData() = default;
45
46 private:
47 void ResetImpl(dispatch_tag<AnalogInData>) override final;
49 };
50
52 {
53 public:
55 virtual ~DummyAnalogInParams() = default;
56
57 virtual const char* GetParamClassTag() const noexcept override { return "DummyAnalogInParams"; }
58
59 private:
62
63 DummyParam Dummy = { *this };
64 };
65
67 {
68 public:
71
73 virtual ~DummyAnalogInConfigurator() = default;
74
75 private:
76 virtual DynExp::ParamsBasePtrType MakeParams(DynExp::ItemIDType ID, const DynExp::DynExpCore& Core) const override { return DynExp::MakeParams<DummyAnalogInConfigurator>(ID, Core); }
77 };
78
79 class DummyAnalogIn : public AnalogIn
80 {
81 public:
85
86 constexpr static auto Name() noexcept { return "Dummy Analog In"; }
87
89 virtual ~DummyAnalogIn() {}
90
91 virtual std::string GetName() const override { return Name(); }
92
93 constexpr static DataStreamInstrumentData::ValueType HardwareMinValue() noexcept { return std::numeric_limits<DataStreamInstrumentData::ValueType>::lowest(); }
94 constexpr static DataStreamInstrumentData::ValueType HardwareMaxValue() noexcept { return std::numeric_limits<DataStreamInstrumentData::ValueType>::max(); }
95 constexpr static DataStreamInstrumentData::ValueType HardwareResolution() noexcept { return std::numeric_limits<DataStreamInstrumentData::ValueType>::min(); }
96
97 virtual DataStreamInstrumentData::ValueType GetHardwareMinValue() const noexcept override { return HardwareMinValue(); }
98 virtual DataStreamInstrumentData::ValueType GetHardwareMaxValue() const noexcept override { return HardwareMaxValue(); }
99 virtual DataStreamInstrumentData::ValueType GetHardwareResolution() const noexcept override final { return HardwareResolution(); }
100
101 virtual Util::OptionalBool HasFinished() const override { return true; }
102
103 private:
104 void ResetImpl(dispatch_tag<AnalogIn>) override final;
106
107 virtual std::unique_ptr<DynExp::InitTaskBase> MakeInitTask() const override { return DynExp::MakeTask<DummyAnalogInTasks::InitTask>(); }
108 virtual std::unique_ptr<DynExp::ExitTaskBase> MakeExitTask() const override { return DynExp::MakeTask<DummyAnalogInTasks::ExitTask>(); }
109 virtual std::unique_ptr<DynExp::UpdateTaskBase> MakeUpdateTask() const override { return DynExp::MakeTask<DummyAnalogInTasks::UpdateTask>(); }
110 };
111}
Defines a meta instrument for a single analog input port to read a data stream consisting of analog v...
Defines DynExp's core module as an interface between the UI and DynExp objects.
Configurator class for AnalogIn.
Definition AnalogIn.h:122
Data class for AnalogIn.
Definition AnalogIn.h:67
Parameter class for AnalogIn.
Definition AnalogIn.h:95
Defines a task for deinitializing an instrument within an instrument inheritance hierarchy....
Definition AnalogIn.h:40
Defines a task for initializing an instrument within an instrument inheritance hierarchy....
Definition AnalogIn.h:27
Defines a task for updating an instrument within an instrument inheritance hierarchy....
Definition AnalogIn.h:53
Meta instrument for a single analog input port based on the data stream and generic input port meta i...
Definition AnalogIn.h:136
double ValueType
Data type to represent hardware limits on the sample values to write to the hardware adapter assigned...
virtual DynExp::ParamsBasePtrType MakeParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core) const override
Override to make derived classes call DynExp::MakeParams with the correct configurator type derived f...
virtual ~DummyAnalogInConfigurator()=default
virtual void ResetImpl(dispatch_tag< DummyAnalogInData >)
virtual ~DummyAnalogInData()=default
void ResetImpl(dispatch_tag< AnalogInData >) override final
virtual ~DummyAnalogInParams()=default
virtual void ConfigureParamsImpl(dispatch_tag< DummyAnalogInParams >)
void ConfigureParamsImpl(dispatch_tag< AnalogInParams >) override final
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to...
virtual const char * GetParamClassTag() const noexcept override
This function is intended to be overridden once in each derived class returning the name of the respe...
DummyAnalogInParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
void ExitFuncImpl(dispatch_tag< AnalogInTasks::ExitTask >, DynExp::InstrumentInstance &Instance) override final
Deinitializes the respective instrument within the instrument inheritance hierarchy....
virtual void ExitFuncImpl(dispatch_tag< ExitTask >, DynExp::InstrumentInstance &Instance)
virtual void InitFuncImpl(dispatch_tag< InitTask >, DynExp::InstrumentInstance &Instance)
void InitFuncImpl(dispatch_tag< AnalogInTasks::InitTask >, DynExp::InstrumentInstance &Instance) override final
Initializes the respective instrument within the instrument inheritance hierarchy....
virtual void UpdateFuncImpl(dispatch_tag< UpdateTask >, DynExp::InstrumentInstance &Instance)
void UpdateFuncImpl(dispatch_tag< AnalogInTasks::UpdateTask >, DynExp::InstrumentInstance &Instance) override final
Updates the respective instrument within the instrument inheritance hierarchy. Call UpdateFuncImpl() ...
virtual std::string GetName() const override
Returns the name of this Object type.
static constexpr auto Name() noexcept
static constexpr DataStreamInstrumentData::ValueType HardwareMaxValue() noexcept
virtual void ResetImpl(dispatch_tag< DummyAnalogIn >)
virtual DataStreamInstrumentData::ValueType GetHardwareMinValue() const noexcept override
Indicates the minimal value the underlying hardware can record.
virtual DataStreamInstrumentData::ValueType GetHardwareResolution() const noexcept override final
Indicates the value's resolution the underlying hardware can record.
virtual std::unique_ptr< DynExp::ExitTaskBase > MakeExitTask() const override
Factory function for an exit task (ExitTaskBase). Override to define the desired deinitialization tas...
virtual std::unique_ptr< DynExp::InitTaskBase > MakeInitTask() const override
Factory function for an init task (InitTaskBase). Override to define the desired initialization task ...
virtual DataStreamInstrumentData::ValueType GetHardwareMaxValue() const noexcept override
Indicates the maximal value the underlying hardware can record.
static constexpr DataStreamInstrumentData::ValueType HardwareMinValue() noexcept
virtual Util::OptionalBool HasFinished() const override
Determines whether the underlying hardware adapter finished data acquisition or writing data.
static constexpr DataStreamInstrumentData::ValueType HardwareResolution() noexcept
virtual std::unique_ptr< DynExp::UpdateTaskBase > MakeUpdateTask() const override
Factory function for an update task (UpdateTaskBase). Override to define the desired update task in d...
void ResetImpl(dispatch_tag< AnalogIn >) override final
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
DynExp's core class acts as the interface between the user interface and DynExp's internal data like ...
Definition DynExpCore.h:127
Refer to DynExp::ParamsBase::dispatch_tag.
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:813
const std::thread::id OwnerThreadID
Thread id of the thread which has constructed (and owns) this Object instance.
Definition Object.h:2302
const ParamsBasePtrType Params
Pointer to the parameter class instance belonging to this Object instance.
Definition Object.h:2303
Refer to ParamsBase::dispatch_tag.
Definition Object.h:2018
Dummy parameter which is to be owned once by parameter classes that do not contain any other paramete...
Definition Object.h:522
const ItemIDType ID
ID of the Object this parameter class instance belongs to.
Definition Object.h:1779
const DynExpCore & Core
Reference to DynExp's core.
Definition Object.h:1780
Tag for function dispatching mechanism within this class used when derived classes are not intended t...
Definition Object.h:349
Refer to DynExp::ParamsBase::dispatch_tag.
Data type which stores an optional bool value (unknown, false, true). The type evaluates to bool whil...
Definition Util.h:549
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
size_t ItemIDType
ID type of objects/items managed by DynExp.
Accumulates include statements to provide a precompiled header.