13 #include "../MetaInstruments/FunctionGenerator.h"
17 class ArbitraryFunctionFromCSV;
40 virtual const char*
GetParamClassTag() const noexcept
override {
return "ArbitraryFunctionFromCSVParams"; }
43 "FunctionGenerator",
"Function generator",
"Underlying data stream instrument to be used as a function generator",
DynExpUI::Icons::Instrument };
45 "Path to a CSV file containing the arbitrary function data as a single column (values) or as two columns (times;values)",
true,
"",
DynExp::TextUsageType::Code };
47 "Number of (header) lines to skip at the beginning of the file",
true,
48 0, 0, std::numeric_limits<ParamsConfigDialog::NumberType>::max(), 1, 0 };
50 "Factor to multiply all times with",
true,
51 1, std::numeric_limits<ParamsConfigDialog::NumberType>::lowest(), std::numeric_limits<ParamsConfigDialog::NumberType>::max(), .1, 3 };
53 "Offset to add to all times",
true,
54 0, std::numeric_limits<ParamsConfigDialog::NumberType>::lowest(), std::numeric_limits<ParamsConfigDialog::NumberType>::max(), .1, 3 };
56 "Factor to multiply all values with",
true,
57 1, std::numeric_limits<ParamsConfigDialog::NumberType>::lowest(), std::numeric_limits<ParamsConfigDialog::NumberType>::max(), .1, 3 };
59 "Offset to add to all values",
true,
60 0, std::numeric_limits<ParamsConfigDialog::NumberType>::lowest(), std::numeric_limits<ParamsConfigDialog::NumberType>::max(), .1, 3 };
86 constexpr
static auto Name() noexcept {
return "Arbitrary Function from CSV"; }
87 constexpr
static auto Category() noexcept {
return "I/O"; }
93 virtual std::string
GetName()
const override {
return Name(); }
99 std::chrono::milliseconds
GetMainLoopDelay() const override final {
return decltype(ModuleBase::GetMainLoopDelay())::max(); }
104 void ResetImpl(dispatch_tag<ModuleBase>)
override final;
Defines DynExp's core module as an interface between the UI and DynExp objects.
virtual DynExp::ParamsBasePtrType MakeParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core) const override final
Override to make derived classes call DynExp::MakeParams with the correct configurator type derived f...
ArbitraryFunctionFromCSVConfigurator()=default
virtual ~ArbitraryFunctionFromCSVConfigurator()=default
virtual ~ArbitraryFunctionFromCSVData()=default
virtual void ResetImpl(dispatch_tag< ArbitraryFunctionFromCSVData >)
DynExp::LinkedObjectWrapperContainer< DynExpInstr::FunctionGenerator > FunctionGenerator
ArbitraryFunctionFromCSVData()
void ResetImpl(dispatch_tag< ModuleDataBase >) override final
ArbitraryFunctionFromCSVParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
void ConfigureParamsImpl(dispatch_tag< ModuleParamsBase >) override final
virtual ~ArbitraryFunctionFromCSVParams()=default
Param< ParamsConfigDialog::NumberType > ValueOffset
Param< ParamsConfigDialog::NumberType > ValueStretch
Param< ParamsConfigDialog::NumberType > SkipLines
Param< ParamsConfigDialog::NumberType > TimeOffset
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...
Param< ParamsConfigDialog::TextType > CSVDataPath
Param< DynExp::ObjectLink< DynExpInstr::FunctionGenerator > > FunctionGenerator
Param< ParamsConfigDialog::NumberType > TimeStretch
ArbitraryFunctionFromCSV(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
bool TreatModuleExceptionsAsWarnings() const override
Determines whether this module should be terminated if an exception leaves the module's main loop or ...
void ResetImpl(dispatch_tag< ModuleBase >) override final
constexpr static auto Category() noexcept
void OnExit(DynExp::ModuleInstance *Instance) const override final
This event is triggered right before the module thread terminates (not due to an exception,...
void OnInit(DynExp::ModuleInstance *Instance) const override final
This event is triggered right before the module thread starts. Override it to lock instruments this m...
Util::DynExpErrorCodes::DynExpErrorCodes ModuleMainLoop(DynExp::ModuleInstance &Instance) override final
Module main loop. The function is executed periodically by the module thread. Also refer to GetMainLo...
std::chrono::milliseconds GetMainLoopDelay() const override final
Specifies in which time intervals the module's event queue runs to handle pending events.
virtual std::string GetCategory() const override
Returns the category of this Object type.
virtual ~ArbitraryFunctionFromCSV()=default
virtual std::string GetName() const override
Returns the name of this Object type.
constexpr static auto Name() noexcept
DynExp's core class acts as the interface between the user interface and DynExp's internal data like ...
Base class for modules. Modules implement programs on their own (e.g. measurement protocols or server...
ModuleBase(const std::thread::id OwnerThreadID, ParamsBasePtrType &&Params)
Constructs a ModuleBase instance.
Configurator class for ModuleBase.
Data structure to contain data which is synchronized in between different threads....
Refer to ParamsBase::dispatch_tag.
Defines data for a thread belonging to a ModuleBase instance. Refer to RunnableInstance.
Parameter class for ModuleBase.
ModuleParamsBase(ItemIDType ID, const DynExpCore &Core)
Constructs the parameters for a ModuleBase instance.
const std::thread::id OwnerThreadID
Thread id of the thread which has constructed (and owns) this Object instance.
const ParamsBasePtrType Params
Pointer to the parameter class instance belonging to this Object instance.
const ItemIDType ID
ID of the Object this parameter class instance belongs to.
const auto & GetCore() const noexcept
Returns a reference to DynExp's core.
const DynExpCore & Core
Reference to DynExp's core.
Tag for function dispatching mechanism within this class used when derived classes are not intended t...
DynExp's module namespace contains the implementation of DynExp modules which extend DynExp's core fu...
constexpr auto Instrument
std::unique_ptr< ParamsBase > ParamsBasePtrType
Alias for a pointer to the parameter system base class ParamsBase.
size_t ItemIDType
ID type of objects/items managed by DynExp.
DynExpErrorCodes
DynExp's error codes
Accumulates include statements to provide a precompiled header.