DynExp
Highly flexible laboratory automation for dynamically changing experiments.
DynExpInstr::NIDAQDigitalOut Class Reference
+ Inheritance diagram for DynExpInstr::NIDAQDigitalOut:

Public Types

using ParamsType = NIDAQDigitalOutParams
 
using ConfigType = NIDAQDigitalOutConfigurator
 
using InstrumentDataType = NIDAQDigitalOutData
 
- Public Types inherited from DynExpInstr::DigitalOut
using ParamsType = DigitalOutParams
 Type of the parameter class belonging to this Object type. Declare this alias in every derived class with the respective parameter class accompanying the derived Object. More...
 
using ConfigType = DigitalOutConfigurator
 Type of the configurator class belonging to this Object type. Declare this alias in every derived class with the respective configurator class accompanying the derived Object. More...
 
using InstrumentDataType = DigitalOutData
 Type of the data class belonging to this InstrumentBase type. Declare this alias in every derived class with the respective data class accompanying the derived InstrumentBase. More...
 
using InitTaskType = DigitalOutTasks::InitTask
 Defines a task for initializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by an initialization task class derived from InitTaskBase. Even if the task does not do anything, at least it has to call InitTaskBase::InitFuncImpl() of the derived instrument's initialization task class. More...
 
using ExitTaskType = DigitalOutTasks::ExitTask
 Defines a task for deinitializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by a deinitialization task class derived from ExitTaskBase. Even if the task does not do anything, at least it has to call ExitTaskBase::ExitFuncImpl() of the derived instrument's deinitialization task class. More...
 
using UpdateTaskType = DigitalOutTasks::UpdateTask
 Defines a task for updating an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by an update task class derived from UpdateTaskBase. Even if the task does not do anything, at least it has to call UpdateTaskBase::UpdateFuncImpl() of the derived instrument's update task class. More...
 
- Public Types inherited from DynExpInstr::OutputPort
using ParamsType = OutputPortParams
 Type of the parameter class belonging to this Object type. Declare this alias in every derived class with the respective parameter class accompanying the derived Object. More...
 
using ConfigType = OutputPortConfigurator
 Type of the configurator class belonging to this Object type. Declare this alias in every derived class with the respective configurator class accompanying the derived Object. More...
 
using InstrumentDataType = OutputPortData
 Type of the data class belonging to this InstrumentBase type. Declare this alias in every derived class with the respective data class accompanying the derived InstrumentBase. More...
 
using InitTaskType = OutputPortTasks::InitTask
 Defines a task for initializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by an initialization task class derived from InitTaskBase. Even if the task does not do anything, at least it has to call InitTaskBase::InitFuncImpl() of the derived instrument's initialization task class. More...
 
using ExitTaskType = OutputPortTasks::ExitTask
 Defines a task for deinitializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by a deinitialization task class derived from ExitTaskBase. Even if the task does not do anything, at least it has to call ExitTaskBase::ExitFuncImpl() of the derived instrument's deinitialization task class. More...
 
using UpdateTaskType = OutputPortTasks::UpdateTask
 Defines a task for updating an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by an update task class derived from UpdateTaskBase. Even if the task does not do anything, at least it has to call UpdateTaskBase::UpdateFuncImpl() of the derived instrument's update task class. More...
 
- Public Types inherited from DynExpInstr::FunctionGenerator
enum class  WaveformCapsType {
  UserDefined , Sine , Rect , Ramp ,
  Pulse , NUM_ELEMENTS
}
 Type enumerating waveform types the function generator might be able to produce (in hardware). More...
 
enum class  QuantityCapsType { Amplitude , Frequency , Phase , NUM_ELEMENTS }
 Type enumerating quantities the function generator might be able to modulate or sweep (in hardware). More...
 
enum class  TriggerCapsType { CanConfigure , CanForce , NUM_ELEMENTS }
 Type enumerating trigger features the function generator might be capable of (in hardware). More...
 
using ParamsType = FunctionGeneratorParams
 Type of the parameter class belonging to this Object type. Declare this alias in every derived class with the respective parameter class accompanying the derived Object. More...
 
using ConfigType = FunctionGeneratorConfigurator
 Type of the configurator class belonging to this Object type. Declare this alias in every derived class with the respective configurator class accompanying the derived Object. More...
 
using InstrumentDataType = FunctionGeneratorData
 Type of the data class belonging to this InstrumentBase type. Declare this alias in every derived class with the respective data class accompanying the derived InstrumentBase. More...
 
using InitTaskType = FunctionGeneratorTasks::InitTask
 Defines a task for initializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by an initialization task class derived from InitTaskBase. Even if the task does not do anything, at least it has to call InitTaskBase::InitFuncImpl() of the derived instrument's initialization task class. More...
 
using ExitTaskType = FunctionGeneratorTasks::ExitTask
 Defines a task for deinitializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by a deinitialization task class derived from ExitTaskBase. Even if the task does not do anything, at least it has to call ExitTaskBase::ExitFuncImpl() of the derived instrument's deinitialization task class. More...
 
using UpdateTaskType = FunctionGeneratorTasks::UpdateTask
 Defines a task for updating an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by an update task class derived from UpdateTaskBase. Even if the task does not do anything, at least it has to call UpdateTaskBase::UpdateFuncImpl() of the derived instrument's update task class. More...
 
- Public Types inherited from DynExpInstr::DataStreamInstrument
using ParamsType = DataStreamInstrumentParams
 Type of the parameter class belonging to this Object type. Declare this alias in every derived class with the respective parameter class accompanying the derived Object. More...
 
using ConfigType = DataStreamInstrumentConfigurator
 Type of the configurator class belonging to this Object type. Declare this alias in every derived class with the respective configurator class accompanying the derived Object. More...
 
using InstrumentDataType = DataStreamInstrumentData
 Type of the data class belonging to this InstrumentBase type. Declare this alias in every derived class with the respective data class accompanying the derived InstrumentBase. More...
 
using InitTaskType = DataStreamInstrumentTasks::InitTask
 Defines a task for initializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by an initialization task class derived from InitTaskBase. Even if the task does not do anything, at least it has to call InitTaskBase::InitFuncImpl() of the derived instrument's initialization task class. More...
 
using ExitTaskType = DataStreamInstrumentTasks::ExitTask
 Defines a task for deinitializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by a deinitialization task class derived from ExitTaskBase. Even if the task does not do anything, at least it has to call ExitTaskBase::ExitFuncImpl() of the derived instrument's deinitialization task class. More...
 
using UpdateTaskType = DataStreamInstrumentTasks::UpdateTask
 Defines a task for updating an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by an update task class derived from UpdateTaskBase. Even if the task does not do anything, at least it has to call UpdateTaskBase::UpdateFuncImpl() of the derived instrument's update task class. More...
 
- Public Types inherited from DynExp::InstrumentBase
using ParamsType = InstrumentParamsBase
 Type of the parameter class belonging to this Object type. Declare this alias in every derived class with the respective parameter class accompanying the derived Object. More...
 
using ConfigType = InstrumentConfiguratorBase
 Type of the configurator class belonging to this Object type. Declare this alias in every derived class with the respective configurator class accompanying the derived Object. More...
 
using InstrumentDataType = InstrumentDataBase
 Type of the data class belonging to this InstrumentBase type. Declare this alias in every derived class with the respective data class accompanying the derived InstrumentBase. More...
 
using InstrumentDataTypeSyncPtrType = Util::SynchronizedPointer< InstrumentDataType >
 Alias for the return type of InstrumentBase::GetInstrumentData(). Data class instances wrapped into Util::SynchronizedPointer can be accessed in a thread-safe way. More...
 
using InstrumentDataTypeSyncPtrConstType = Util::SynchronizedPointer< const InstrumentDataType >
 Alias for the return type of InstrumentBase::GetInstrumentData() const. Data class instances wrapped into Util::SynchronizedPointer can be accessed in a thread-safe way. More...
 
using InitTaskType = InitTaskBase
 Defines a task for initializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by an initialization task class derived from InitTaskBase. Even if the task does not do anything, at least it has to call InitTaskBase::InitFuncImpl() of the derived instrument's initialization task class. More...
 
using ExitTaskType = ExitTaskBase
 Defines a task for deinitializing an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by a deinitialization task class derived from ExitTaskBase. Even if the task does not do anything, at least it has to call ExitTaskBase::ExitFuncImpl() of the derived instrument's deinitialization task class. More...
 
using UpdateTaskType = UpdateTaskBase
 Defines a task for updating an instrument within an instrument inheritance hierarchy. Each instrument (indirectly) derived from class InstrumentBase must be accompanied by an update task class derived from UpdateTaskBase. Even if the task does not do anything, at least it has to call UpdateTaskBase::UpdateFuncImpl() of the derived instrument's update task class. More...
 
using InstrumentDataGetterType = Util::CallableMemberWrapper< InstrumentBase, InstrumentDataTypeSyncPtrType(InstrumentBase::*)(const std::chrono::milliseconds)>
 Invoking an instance of this alias is supposed to call InstrumentBase::GetInstrumentData() of the instance the Util::CallableMemberWrapper has been constructed with. More...
 
- Public Types inherited from DynExp::RunnableObject
using ParamsType = RunnableObjectParams
 Type of the parameter class belonging to this Object type. Declare this alias in every derived class with the respective parameter class accompanying the derived Object. More...
 
using ConfigType = RunnableObjectConfigurator
 Type of the configurator class belonging to this Object type. Declare this alias in every derived class with the respective configurator class accompanying the derived Object. More...
 
- Public Types inherited from DynExp::Object
using ParamsType = ParamsBase
 Type of the parameter class belonging to this Object type. Declare this alias in every derived class with the respective parameter class accompanying the derived Object. More...
 
using ParamsTypeSyncPtrType = Util::SynchronizedPointer< ParamsType >
 Alias for the return type of Object::GetParams(). Parameters wrapped into Util::SynchronizedPointer can be accessed in a thread-safe way. More...
 
using ParamsConstTypeSyncPtrType = Util::SynchronizedPointer< const ParamsType >
 Alias for the return type of Object::GetParams() const. Parameters wrapped into Util::SynchronizedPointer can be accessed in a thread-safe way. More...
 
using ConfigType = ConfiguratorBase
 Type of the configurator class belonging to this Object type. Declare this alias in every derived class with the respective configurator class accompanying the derived Object. More...
 
using ParamsGetterType = Util::CallableMemberWrapper< Object, decltype(&Object::GetParams)>
 Invoking an instance of this alias is supposed to call Object::GetParams() of the instance the Util::CallableMemberWrapper has been constructed with. More...
 

Public Member Functions

 NIDAQDigitalOut (const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
 
virtual ~NIDAQDigitalOut ()
 
virtual std::string GetName () const override
 Returns the name of this Object type. More...
 
virtual StreamSizeParamsExtension::ValueType GetStreamSizeParams () const override
 Retrieves the size of the instrument's data stream from the instrument parameters. Refer to OutputPortTasks::InitTask::InitFuncImpl(dispatch_tag<FunctionGeneratorTasks::InitTask>, DynExp::InstrumentInstance&). More...
 
virtual NumericSampleStreamParamsExtension::ValueType GetNumericSampleStreamParams () const override
 Retrieves sample stream settings of the instrument's data stream from the instrument's or from the underlying hardware's parameters. More...
 
virtual void WriteData (DynExp::TaskBase::CallbackType CallbackFunc) const override
 Enqueues a task to write data from the data stream to the hardware. More...
 
virtual void ClearData (DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
 Enqueues a task to clear the underlying hardware adapter's buffer. More...
 
virtual void Start (DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
 Enqueues a task to make the underlying hardware adapter start data acquisition or writing data. More...
 
virtual void Stop (DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
 Enqueues a task to make the underlying hardware adapter stop data acquisition or writing data. More...
 
void Restart (DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
 Enqueues a task to make the underlying hardware adapter restart data acquisition or writing data. The default implementation calls Stop() and then Start(). More...
 
virtual Util::OptionalBool HasFinished () const override
 Determines whether the underlying hardware adapter finished data acquisition or writing data. More...
 
virtual void SetDefault (DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
 Writes DigitalOutParams::DefaultValue to the sample stream. CallbackFunc gets called after the task DataStreamInstrument::WriteData() has written the sample to the underlying hardware adapter. More...
 
- Public Member Functions inherited from DynExpInstr::DigitalOut
 DigitalOut (const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
 Constructs an instrument instance. More...
 
virtual ~DigitalOut ()=0
 
virtual std::string GetCategory () const override
 Returns the category of this Object type. More...
 
virtual DataStreamInstrumentData::ValueType GetHardwareMinValue () const noexcept override final
 Indicates the minimal value the underlying hardware can generate. Also refer to GetUserMinValue(). More...
 
virtual DataStreamInstrumentData::ValueType GetHardwareMaxValue () const noexcept override final
 Indicates the maximal value the underlying hardware can generate. Also refer to GetUserMaxValue(). More...
 
virtual DataStreamInstrumentData::ValueType GetHardwareResolution () const noexcept override final
 Indicates the value's resolution the underlying hardware can generate. More...
 
virtual DataStreamInstrumentData::UnitType GetValueUnit () const noexcept override final
 Determines which unit corresponds to the values managed by this DataStreamInstrument instance. Do not enforce noexcept to allow overriding functions which throw exceptions. More...
 
virtual DataStreamInstrumentData::ValueType GetUserMinValue () const override
 Indicates the minimal allowed value to generate as defined by the user/software. This value should be larger than the value returned by GetHardwareMinValue(). More...
 
virtual DataStreamInstrumentData::ValueType GetUserMaxValue () const override
 Indicates the maximal allowed value to generate as defined by the user/software. This value should be smaller than the value returned by GetHardwareMaxValue(). More...
 
virtual void Set (DigitalOutData::SampleStreamType::SampleType Sample, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
 Writes one sample to the sample stream. CallbackFunc gets called after the task DataStreamInstrument::WriteData() has written the sample to the underlying hardware adapter. More...
 
virtual void SetSync (DigitalOutData::SampleStreamType::SampleType Sample) const
 Synchronized version of Set(), which blocks until Sample has been written. More...
 
- Public Member Functions inherited from DynExpInstr::OutputPort
 OutputPort (const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
 Constructs an instrument instance. More...
 
virtual ~OutputPort ()=0
 
virtual void ResetStreamSize (DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
 Enqueues a task to reset the size of the instrument's sample stream to its default value. More...
 
- Public Member Functions inherited from DynExpInstr::FunctionGenerator
 FunctionGenerator (const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
 Constructs an instrument instance. More...
 
virtual ~FunctionGenerator ()=0
 
FunctionGeneratorDefs::FunctionDescType GetMinCaps () const
 Returns the minimal values assignable to a description of a generic periodic function. More...
 
FunctionGeneratorDefs::FunctionDescType GetMaxCaps () const
 Returns the maximal values assignable to a description of a generic periodic function. More...
 
FunctionGeneratorDefs::FunctionDescType GetParamDefaults () const
 Returns the default values to assign to a description of a generic periodic function. More...
 
Util::FeatureTester< WaveformCapsTypeGetWaveformCaps () const
 Returns the waveform types the function generator is able to produce. More...
 
Util::FeatureTester< QuantityCapsTypeGetModulationCaps () const
 Returns the modulation types the function generator is capable of. More...
 
Util::FeatureTester< QuantityCapsTypeGetSweepCaps () const
 Returns the sweep types the function generator is capable of. More...
 
Util::FeatureTester< TriggerCapsTypeGetTriggerCaps () const
 Returns the trigger features the function generator is capable of. More...
 
virtual void SetSineFunction (const FunctionGeneratorDefs::SineFunctionDescType &FunctionDesc, bool PersistParams=false, bool Autostart=false, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
 Generates a sine function. More...
 
virtual void SetRectFunction (const FunctionGeneratorDefs::RectFunctionDescType &FunctionDesc, bool PersistParams=false, bool Autostart=false, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
 Generates a rectangular function. More...
 
virtual void SetRampFunction (const FunctionGeneratorDefs::RampFunctionDescType &FunctionDesc, bool PersistParams=false, bool Autostart=false, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
 Generates a ramp function. More...
 
virtual void SetPulseFunction (const FunctionGeneratorDefs::PulsesDescType &FunctionDesc, bool PersistParams=false, bool Autostart=false, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
 Generates a function consisting of pulse segments. More...
 
virtual void SetArbitraryFunction (DataStreamBase::BasicSampleListType &&Samples, bool Autostart=false, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
 Generates an arbitrary function defined by the function samples. More...
 
virtual void SetModulation (const FunctionGeneratorDefs::ModulationDescType &ModulationDesc, bool PersistParams=false, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
 Configures the function generator to perform a modulation. More...
 
virtual void SetSweep (const FunctionGeneratorDefs::SweepDescType &SweepDesc, bool PersistParams=false, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
 Configures the function generator to perform a sweep. More...
 
void SetTrigger (const FunctionGeneratorDefs::TriggerDescType &TriggerDesc, bool PersistParams=false, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
 SetTrigger() configures the function generator's trigger, which determines when the waveform generation is started. It firstly enqueues the task FunctionGeneratorTasks::SetTriggerTask ignoring CallbackFunc. Then, SetTriggerChild() is called, which should enqueue another task making use of CallbackFunc to configure the actual hardware accordingly. This ensures that CallbackFunc is called last in this series of multiple tasks. More...
 
virtual void ForceTrigger (DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
 Forces the generation of the waveform ignoring the trigger. More...
 
virtual void ForceTriggerSync () const
 Synchronized version of ForceTrigger(), which blocks until the task enqueued by ForceTrigger() has been executed. More...
 
virtual bool IsPhaseAdjustable () const noexcept
 Determines whether the function generator has the capability to set the phase of the generated waveform. More...
 
- Public Member Functions inherited from DynExpInstr::DataStreamInstrument
 DataStreamInstrument (const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
 Constructs an instrument instance. More...
 
virtual ~DataStreamInstrument ()=0
 
const char * GetValueUnitStr () const noexcept
 Builds and returns a descriptive string of the unit corresponding to the values managed by this DataStreamInstrument instance. More...
 
bool CanRead (const std::chrono::milliseconds Timeout=GetInstrumentDataTimeoutDefault) const
 Calls ReadData(), locks the instrument data, and determines whether at least one sample can be read from the instrument's data stream. More...
 
void Clear (const std::chrono::milliseconds Timeout=GetInstrumentDataTimeoutDefault) const
 Immediately clears the instrument's data stream and then issues a ClearData task by locking the instrument data first, calling DataStreamBase::Clear(), and finally calling ClearData(). More...
 
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 nothing. More...
 
virtual void SetStreamSize (size_t BufferSizeInSamples, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
 Enqueues a task to set the size of the instrument's sample stream. The default implementation just calls DataStreamBase::SetStreamSize() via a DataStreamInstrumentTasks::SetStreamSizeTask task. More...
 
virtual Util::OptionalBool IsRunning () const
 Determines whether the underlying hardware adapter is running a data acquisition or writing data. More...
 
- Public Member Functions inherited from DynExp::InstrumentBase
 InstrumentBase (const std::thread::id OwnerThreadID, ParamsBasePtrType &&Params)
 Constructs an instrument instance. More...
 
virtual ~InstrumentBase ()=0
 
template<typename DerivedInstrT , typename... TaskFuncArgTs, typename... ArgTs>
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 synchronously. This means that AsSyncTask() blocks until the task has been executed or aborted. This is achieved by passing a callback function to the task which in turn sets a flag after the task execution. The thread calling AsSyncTask() blocks (via std::this_thread::yield()) until this flag is set. More...
 
InstrumentDataTypeSyncPtrType GetInstrumentData (const std::chrono::milliseconds Timeout=GetInstrumentDataTimeoutDefault)
 Locks the mutex of the instrument data class instance InstrumentData assigned to this InstrumentBase instance and returns a pointer to the locked InstrumentData. Instrument data should not be locked by having called this function while subsequently calling a derived instrument's method which also makes use of the instrument's data by locking it. If this happens (e.g. in a module thread), the instrument data's mutex is locked recursively. In principle, this does no harm since Util::ISynchronizedPointerLockable supports that. But, it is not considered good practice. More...
 
InstrumentDataTypeSyncPtrConstType GetInstrumentData (const std::chrono::milliseconds Timeout=GetInstrumentDataTimeoutDefault) const
 Locks the mutex of the instrument data class instance InstrumentData assigned to this InstrumentBase instance and returns a pointer to the locked InstrumentData. Instrument data should not be locked by having called this function while subsequently calling a derived instrument's method which also makes use of the instrument's data by locking it. If this happens (e.g. in a module thread), the instrument data's mutex is locked recursively. In principle, this does no harm since Util::ISynchronizedPointerLockable supports that. But, it is not considered good practice. More...
 
void UpdateData () const
 Enqueues an update task (instance of class UpdateTaskBase). More...
 
void EnqueueArriveAtLatchTask (std::latch &Latch) const
 Enqueues a task which arrives at a latch when executed (instance of class ArriveAtLatchTask). More...
 
bool IsInitialized () const
 Getter for Initialized. More...
 
virtual std::chrono::milliseconds GetTaskQueueDelay () const
 Specifies in which time intervals the instrument's task queue runs to handle pending tasks. More...
 
- Public Member Functions inherited from DynExp::RunnableObject
 RunnableObject (const std::thread::id OwnerThreadID, ParamsBasePtrType &&Params)
 Constructs an Object instance. More...
 
virtual ~RunnableObject ()=0
 
void SetPaused (bool Pause, std::string Description="")
 Pauses or resumes a RunnableObject instance. Its thread stays running, but the instance does not perform any action while it is paused. More...
 
bool IsRunning () const noexcept
 Returns Running. More...
 
bool IsPaused () const noexcept
 Returns Paused. More...
 
bool IsExiting () const noexcept
 Returns ShouldExit. More...
 
auto GetStartupType () const noexcept
 Returns Startup. More...
 
auto GetReasonWhyPaused () const
 Returns ReasonWhyPaused. More...
 
bool Run (QWidget *ParentWidget=nullptr)
 Starts the RunnableObject instance's thread and ensures that all Object instances linked to this instance via ObjectLink parameters are in a ready state. Calls RunChild() which is to be overridden by derived classes to start a thread and to pass this thread back by calling StoreThread(). More...
 
bool RunIfRunAutomatic ()
 Calls Run() if RunnableObjectParams::Startup is set to RunnableObjectParams::Automatic. More...
 
bool RunIfRunOnCreation ()
 Calls Run() if RunnableObjectParams::Startup is set to RunnableObjectParams::OnCreation. More...
 
void Terminate (bool Force=false, const std::chrono::milliseconds Timeout=TerminateTimeoutDefault)
 Notifies the RunnableObject instance's thread to terminate and waits until it has ended. Calls TerminateImpl(). More...
 
- Public Member Functions inherited from Util::INonCopyable
 INonCopyable (const INonCopyable &)=delete
 
INonCopyableoperator= (const INonCopyable &)=delete
 
- Public Member Functions inherited from DynExp::Object
ItemIDType GetID () const noexcept
 Returns the ID of this Object instance. Thread-safe since ID is const. More...
 
std::string GetCategoryAndName () const
 Builds a string from an Object's category and name to allow the user to identify an Object's type. More...
 
void EnsureReadyState (bool IsAutomaticStartup)
 Ensures that this Object instance is ready by possibly starting its worker thread or by opening connections to hardware devices. More...
 
void CheckLinkedObjectStates () const
 Checks whether Object instances this instance uses are in a ready state. Override CheckLinkedObjectStatesChild() to implement this behavior. More...
 
void Reset ()
 Resets this Object instance (including all its derived classes) by calling ResetImpl(). A reset implies that the derived classes reload all their parameters from Params and that all LinkedObjectWrapper instances owned by this Object instance become invalidated. More...
 
void BlockIfUnused (const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout)
 Blocks this Object instance setting Object::IsBlocked to true. Refer to Object::IsBlocked for the consequences. More...
 
ParamsConstTypeSyncPtrType GetParams (const std::chrono::milliseconds Timeout=GetParamsTimeoutDefault) const
 Locks the mutex of the parameter class instance Params assigned to this Object instance and returns a pointer to the locked Params. More...
 
ParamsTypeSyncPtrType GetParams (const std::chrono::milliseconds Timeout=GetParamsTimeoutDefault)
 Locks the mutex of the parameter class instance Params assigned to this Object instance and returns a pointer to the locked Params. More...
 
auto GetObjectName (const std::chrono::milliseconds Timeout=GetParamsTimeoutDefault) const
 Returns the name of this Object instance. More...
 
bool IsSharedUsageEnabled (const std::chrono::milliseconds Timeout=GetParamsTimeoutDefault) const
 Returns whether shared usage has been enabled for this Object instance. Refer to ParamsBase::UsageType. More...
 
void SetWarning (std::string Description, int ErrorCode) const
 Setter for Object::Warning. Sets the warning by a description and an error code. More...
 
void SetWarning (const Util::Exception &e) const
 Setter for Object::Warning. Sets the warning by retrieving the warning data from an exception e. More...
 
void ClearWarning () const
 Resets Object::Warning. More...
 
auto GetWarning () const
 Returns Object::Warning in a thread-safe way by copying its internal data. More...
 
std::exception_ptr GetException (const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) const
 Returns a pointer to the exception which has caused this Object instance to fail. More...
 
bool IsReady () const
 Returns wheter this Object instance is ready (e.g. it is running or connected to a hardware device) and not blocked (refer to Object::IsBlocked). More...
 
auto GetUseCount (const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) const
 Counts the registered useres in a thread-safe way. More...
 
bool IsUnused (const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) const
 Returns whether this Object instance is used by other instances. More...
 
auto GetUserIDs (const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) const
 Returns a list of the IDs of the registered users in a thread-safe way. More...
 
auto GetUserNamesString (const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) const
 Builds a string describing which users are registered containing their object names, categories and type names in a thread-safe way. More...
 

Static Public Member Functions

constexpr static auto Name () noexcept
 
- Static Public Member Functions inherited from DynExpInstr::DigitalOut
constexpr static auto Name () noexcept
 Every derived class has to redefine this function. More...
 
constexpr static auto Category () noexcept
 Every derived class has to redefine this function. More...
 
- Static Public Member Functions inherited from DynExpInstr::OutputPort
constexpr static auto Name () noexcept
 Every derived class has to redefine this function. More...
 
constexpr static auto Category () noexcept
 Every derived class has to redefine this function. More...
 
- Static Public Member Functions inherited from DynExpInstr::FunctionGenerator
constexpr static auto Name () noexcept
 Every derived class has to redefine this function. More...
 
constexpr static auto Category () noexcept
 Every derived class has to redefine this function. More...
 
- Static Public Member Functions inherited from DynExpInstr::DataStreamInstrument
constexpr static auto Name () noexcept
 Every derived class has to redefine this function. More...
 
constexpr static auto Category () noexcept
 Every derived class has to redefine this function. More...
 
- Static Public Member Functions inherited from DynExp::InstrumentBase
constexpr static auto Category () noexcept
 Every derived class has to redefine this function. More...
 
- Static Public Member Functions inherited from DynExp::Object
static std::string CategoryAndNameToStr (const std::string &Category, const std::string &Name)
 Builds a string from an Object's category and name to allow the user to identify an Object's type. More...
 

Private Member Functions

virtual void OnErrorChild () const override
 Derived classes can perform critical shutdown actions after an error has occurred. Override OnErrorChild() to adjust behavior. More...
 
void ResetImpl (dispatch_tag< DigitalOut >) override final
 Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every derived class gets called - starting from DynExp::Object, descending the inheritance hierarchy. More...
 
virtual void ResetImpl (dispatch_tag< NIDAQDigitalOut >)
 
virtual Util::FeatureTester< WaveformCapsTypeGetWaveformCapsChild () const override
 Returns the waveform types the function generator is able to produce. More...
 
virtual std::unique_ptr< DynExp::InitTaskBaseMakeInitTask () const override
 Factory function for an init task (InitTaskBase). Override to define the desired initialization task in derived classes only if the respective task really does something and if it has no pure virtual function. More...
 
virtual std::unique_ptr< DynExp::ExitTaskBaseMakeExitTask () const override
 Factory function for an exit task (ExitTaskBase). Override to define the desired deinitialization task in derived classes only if the respective task really does something and if it has no pure virtual function. More...
 
virtual std::unique_ptr< DynExp::UpdateTaskBaseMakeUpdateTask () const override
 Factory function for an update task (UpdateTaskBase). Override to define the desired update task in derived classes only if the respective task really does something and if it has no pure virtual function. More...
 

Additional Inherited Members

- Public Attributes inherited from DynExp::InstrumentBase
InstrumenThreadOnlyType InstrumentThreadOnly
 Allow exclusive access to some of InstrumentBase's private methods to the instrument thread InstrumentThreadMain(). More...
 
- Public Attributes inherited from DynExp::RunnableObject
RunnableInstanceOnlyType RunnableInstanceOnly
 Allow exclusive access to some of RunnableObject's private methods to class RunnableInstance. More...
 
- Public Attributes inherited from DynExp::Object
LinkedObjectWrapperOnlyType LinkedObjectWrapperOnly
 Allow exclusive access to some of Object's private methods to any LinkedObjectWrapper<T>. More...
 
- Static Public Attributes inherited from DynExp::InstrumentBase
static constexpr auto GetInstrumentDataTimeoutDefault = std::chrono::milliseconds(1000)
 Determines the default timeout for GetInstrumentData() to lock the mutex synchronizing the instrument's data InstrumentData. More...
 
- Static Public Attributes inherited from DynExp::RunnableObject
static constexpr auto ShortTimeoutDefault = std::chrono::milliseconds(50)
 Default timeout e.g. used as a default for calls to InstrumentBase::GetInstrumentData or ModuleBase::GetModuleData. More...
 
static constexpr auto TerminateTimeoutDefault = std::chrono::milliseconds(3000)
 Default timeout used as a default for calls to RunnableObject::Terminate. More...
 
- Static Public Attributes inherited from DynExp::Object
static constexpr std::chrono::milliseconds GetParamsTimeoutDefault = std::chrono::milliseconds(100)
 Default timeout used by Object::GetParams() to lock the mutex of the parameter instance assigned to this Object instance. More...
 
- Protected Member Functions inherited from DynExp::InstrumentBase
template<typename TaskT , typename... ArgTs>
void MakeAndEnqueueTask (ArgTs &&...Args) const
 Calls MakeTask() to construct a new task and subsequently enqueues the task into the instrument's task queue. Logical const-ness: this is a const member function to allow pointers to const InstrumentBase inserting tasks into the instrument's task queue. These kind of pointers are e.g. returned by RunnableInstance::GetOwner() which can be called by tasks' TaskBase::RunChild() functions. For const InstrumentBase*, it is possible to insert tasks into the task queue, but not to change the InstrumentBase object itself (e.g. calling Object::Reset()). More...
 
- Protected Member Functions inherited from DynExp::RunnableObject
void Init ()
 Initializes member variables in case of a reset. More...
 
std::promise< void > MakeThreadExitedPromise ()
 Helper function to be used by overridden RunChild() functions in derived classes to (re)initialize the ThreadExitedSignal future and to provide the derived class a promise to signal the RunnableObject instance that its thread has terminated. More...
 
void StoreThread (std::thread &&Thread) noexcept
 Stores a thread constructed by a derived class overriding RunChild() in Thread taking ownership of the thread. Only call this function within RunChild()! More...
 
bool IsCallFromRunnableThread () const
 Checks whether Thread's id matches the id of the calling thread. This is thread-safe if the function is called by the RunnableObject instance's thread since Terminate() joins the threads before changing the Thread member. It is also thread-safe if the function is called by the thread owning the the RunnableObject instance since Run() and Terminate() can only be called by this thread. Only Run() and Terminate() (indirectly) modify Thread. More...
 
void EnsureCallFromRunnableThread () const
 Asserts that the call to this function is performed from the RunnableObject instance's thread by calling IsCallFromRunnableThread(). More...
 
void SetReasonWhyPaused (std::string Description)
 Sets the reason why this RunnableObject instance has been paused. More...
 
void SetReasonWhyPaused (const Util::Exception &e)
 Sets the reason why this RunnableObject instance has been paused. More...
 
void ClearReasonWhyPaused ()
 Removes the reason why this RunnableObject instance has been paused (since it is resumed). More...
 
- Protected Member Functions inherited from Util::INonCopyable
constexpr INonCopyable ()=default
 
 ~INonCopyable ()=default
 
- Protected Member Functions inherited from DynExp::Object
 Object (const std::thread::id OwnerThreadID, ParamsBasePtrType &&Params)
 Constructs an Object instance. More...
 
virtual ~Object ()=0
 
void EnsureCallFromOwningThread () const
 Asserts that the call to this function is performed from the thread which constructed this Object instance (the thread with the id stored in Object::OwnerThreadID). More...
 
ParamsTypeSyncPtrType GetNonConstParams (const std::chrono::milliseconds Timeout=GetParamsTimeoutDefault) const
 Allows derived Objects to edit their own parameters - even in const task functions (for instruments) or event functions (for modules). More...
 
auto LockUserList (const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout)
 Locks the user list for thread-safe manipulation. More...
 
void DeregisterAllUnsafe ()
 Deregisters all users and notifies them that they need to check the states of their used linked objects. More...
 
auto GetUseCountUnsafe ()
 
auto GetUserNamesStringUnsafe () const
 
bool IsUnusedUnsafe ()
 Returns whether this Object instance is used by other instances (not thread-safe). More...
 
- Static Protected Member Functions inherited from DynExp::InstrumentBase
static auto GetExceptionUnsafe (const InstrumentDataTypeSyncPtrConstType &InstrumentDataPtr)
 Getter for InstrumentDataBase::InstrumentException. More...
 

Detailed Description

Definition at line 134 of file NIDAQDigitalOut.h.

Member Typedef Documentation

◆ ConfigType

◆ InstrumentDataType

◆ ParamsType

Constructor & Destructor Documentation

◆ NIDAQDigitalOut()

DynExpInstr::NIDAQDigitalOut::NIDAQDigitalOut ( const std::thread::id  OwnerThreadID,
DynExp::ParamsBasePtrType &&  Params 
)

Definition at line 90 of file NIDAQDigitalOut.cpp.

◆ ~NIDAQDigitalOut()

virtual DynExpInstr::NIDAQDigitalOut::~NIDAQDigitalOut ( )
inlinevirtual

Definition at line 144 of file NIDAQDigitalOut.h.

Member Function Documentation

◆ ClearData()

virtual void DynExpInstr::NIDAQDigitalOut::ClearData ( DynExp::TaskBase::CallbackType  CallbackFunc = nullptr) const
inlineoverridevirtual

Enqueues a task to clear the underlying hardware adapter's buffer.

Parameters
CallbackFuncThis callback function is called after the task has finished (either successfully or not) with a reference to the current task and with a reference to the exception which occurred during the task execution (if an exception has occurred).

Reimplemented from DynExpInstr::DataStreamInstrument.

Definition at line 152 of file NIDAQDigitalOut.h.

◆ GetName()

virtual std::string DynExpInstr::NIDAQDigitalOut::GetName ( ) const
inlineoverridevirtual

Returns the name of this Object type.

Reimplemented from DynExpInstr::DigitalOut.

Definition at line 146 of file NIDAQDigitalOut.h.

◆ GetNumericSampleStreamParams()

NumericSampleStreamParamsExtension::ValueType DynExpInstr::NIDAQDigitalOut::GetNumericSampleStreamParams ( ) const
overridevirtual

Retrieves sample stream settings of the instrument's data stream from the instrument's or from the underlying hardware's parameters.

Returns
Returns user-defined sample stream settings. The default implementation returns a default-constructed NumericSampleStreamParamsExtension::ValueType instance.

Reimplemented from DynExpInstr::DigitalOut.

Definition at line 103 of file NIDAQDigitalOut.cpp.

◆ GetStreamSizeParams()

StreamSizeParamsExtension::ValueType DynExpInstr::NIDAQDigitalOut::GetStreamSizeParams ( ) const
overridevirtual

Retrieves the size of the instrument's data stream from the instrument parameters. Refer to OutputPortTasks::InitTask::InitFuncImpl(dispatch_tag<FunctionGeneratorTasks::InitTask>, DynExp::InstrumentInstance&).

Returns
Returns the user-defined buffer size to apply to the data stream. The default implementation returns a stream size of 1.

Reimplemented from DynExpInstr::OutputPort.

Definition at line 95 of file NIDAQDigitalOut.cpp.

◆ GetWaveformCapsChild()

virtual Util::FeatureTester<WaveformCapsType> DynExpInstr::NIDAQDigitalOut::GetWaveformCapsChild ( ) const
inlineoverrideprivatevirtual

Returns the waveform types the function generator is able to produce.

Implements DynExpInstr::FunctionGenerator.

Definition at line 165 of file NIDAQDigitalOut.h.

◆ HasFinished()

Util::OptionalBool DynExpInstr::NIDAQDigitalOut::HasFinished ( ) const
overridevirtual

Determines whether the underlying hardware adapter finished data acquisition or writing data.

Returns
Returns Util::OptionalBool::Values::True if the hardware adapter has completed its action, Util::OptionalBool::Values::False if it is still running, or Util::OptionalBool::Values::Unknown if its state is not known.

Reimplemented from DynExpInstr::DataStreamInstrument.

Definition at line 111 of file NIDAQDigitalOut.cpp.

◆ MakeExitTask()

virtual std::unique_ptr<DynExp::ExitTaskBase> DynExpInstr::NIDAQDigitalOut::MakeExitTask ( ) const
inlineoverrideprivatevirtual

Factory function for an exit task (ExitTaskBase). Override to define the desired deinitialization task in derived classes only if the respective task really does something and if it has no pure virtual function.

Returns
Pointer to the task (transferring ownership) or nullptr if no exit task is required. A task can be created with MakeTask().

Reimplemented from DynExpInstr::DigitalOut.

Definition at line 168 of file NIDAQDigitalOut.h.

◆ MakeInitTask()

virtual std::unique_ptr<DynExp::InitTaskBase> DynExpInstr::NIDAQDigitalOut::MakeInitTask ( ) const
inlineoverrideprivatevirtual

Factory function for an init task (InitTaskBase). Override to define the desired initialization task in derived classes only if the respective task really does something and if it has no pure virtual function.

Returns
Pointer to the task (transferring ownership) or nullptr if no init task is required. A task can be created with MakeTask().

Reimplemented from DynExpInstr::DigitalOut.

Definition at line 167 of file NIDAQDigitalOut.h.

◆ MakeUpdateTask()

virtual std::unique_ptr<DynExp::UpdateTaskBase> DynExpInstr::NIDAQDigitalOut::MakeUpdateTask ( ) const
inlineoverrideprivatevirtual

Factory function for an update task (UpdateTaskBase). Override to define the desired update task in derived classes only if the respective task really does something and if it has no pure virtual function.

Returns
Pointer to the task (transferring ownership) or nullptr if no update task is required. A task can be created with MakeTask().

Reimplemented from DynExpInstr::DigitalOut.

Definition at line 169 of file NIDAQDigitalOut.h.

◆ Name()

constexpr static auto DynExpInstr::NIDAQDigitalOut::Name ( )
inlinestaticconstexprnoexcept

Definition at line 141 of file NIDAQDigitalOut.h.

◆ OnErrorChild()

void DynExpInstr::NIDAQDigitalOut::OnErrorChild ( ) const
overrideprivatevirtual

Derived classes can perform critical shutdown actions after an error has occurred. Override OnErrorChild() to adjust behavior.

Reimplemented from DynExp::InstrumentBase.

Definition at line 137 of file NIDAQDigitalOut.cpp.

◆ ResetImpl() [1/2]

void DynExpInstr::NIDAQDigitalOut::ResetImpl ( dispatch_tag< DigitalOut )
finaloverrideprivatevirtual

Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every derived class gets called - starting from DynExp::Object, descending the inheritance hierarchy.

Implements DynExpInstr::DigitalOut.

Definition at line 144 of file NIDAQDigitalOut.cpp.

◆ ResetImpl() [2/2]

virtual void DynExpInstr::NIDAQDigitalOut::ResetImpl ( dispatch_tag< NIDAQDigitalOut )
inlineprivatevirtual

Definition at line 163 of file NIDAQDigitalOut.h.

◆ Restart()

void DynExpInstr::NIDAQDigitalOut::Restart ( DynExp::TaskBase::CallbackType  CallbackFunc = nullptr) const
inlineoverridevirtual

Enqueues a task to make the underlying hardware adapter restart data acquisition or writing data. The default implementation calls Stop() and then Start().

Parameters
CallbackFuncThis callback function is called after the task has finished (either successfully or not) with a reference to the current task and with a reference to the exception which occurred during the task execution (if an exception has occurred).

Reimplemented from DynExpInstr::DataStreamInstrument.

Definition at line 155 of file NIDAQDigitalOut.h.

◆ SetDefault()

void DynExpInstr::NIDAQDigitalOut::SetDefault ( DynExp::TaskBase::CallbackType  CallbackFunc = nullptr) const
overridevirtual

Writes DigitalOutParams::DefaultValue to the sample stream. CallbackFunc gets called after the task DataStreamInstrument::WriteData() has written the sample to the underlying hardware adapter.

Parameters
CallbackFuncThis callback function is called after the task has finished (either successfully or not) with a reference to the current task and with a reference to the exception which occurred during the task execution (if an exception has occurred).

Reimplemented from DynExpInstr::DigitalOut.

Definition at line 118 of file NIDAQDigitalOut.cpp.

◆ Start()

virtual void DynExpInstr::NIDAQDigitalOut::Start ( DynExp::TaskBase::CallbackType  CallbackFunc = nullptr) const
inlineoverridevirtual

Enqueues a task to make the underlying hardware adapter start data acquisition or writing data.

Parameters
CallbackFuncThis callback function is called after the task has finished (either successfully or not) with a reference to the current task and with a reference to the exception which occurred during the task execution (if an exception has occurred).

Reimplemented from DynExpInstr::DataStreamInstrument.

Definition at line 153 of file NIDAQDigitalOut.h.

◆ Stop()

virtual void DynExpInstr::NIDAQDigitalOut::Stop ( DynExp::TaskBase::CallbackType  CallbackFunc = nullptr) const
inlineoverridevirtual

Enqueues a task to make the underlying hardware adapter stop data acquisition or writing data.

Parameters
CallbackFuncThis callback function is called after the task has finished (either successfully or not) with a reference to the current task and with a reference to the exception which occurred during the task execution (if an exception has occurred).

Reimplemented from DynExpInstr::DataStreamInstrument.

Definition at line 154 of file NIDAQDigitalOut.h.

◆ WriteData()

virtual void DynExpInstr::NIDAQDigitalOut::WriteData ( DynExp::TaskBase::CallbackType  CallbackFunc) const
inlineoverridevirtual

Enqueues a task to write data from the data stream to the hardware.

Parameters
CallbackFuncThis callback function is called after the task has finished (either successfully or not) with a reference to the current task and with a reference to the exception which occurred during the task execution (if an exception has occurred).
Exceptions
Util::NotImplementedExceptionis thrown by the default implementation, which does not do anything more.

Reimplemented from DynExpInstr::DataStreamInstrument.

Definition at line 151 of file NIDAQDigitalOut.h.


The documentation for this class was generated from the following files: