13 #include "../MetaInstruments/Stage.h"
14 #include "../MetaInstruments/DataStreamInstrument.h"
15 #include "../Instruments/InterModuleCommunicator.h"
20 #include "ui_Trajectory1D.h"
34 bool AllowResize() const noexcept override final {
return false; }
36 const auto&
GetUI() const noexcept {
return ui; }
78 void ResetImpl(dispatch_tag<QModuleDataBase>)
override final;
89 std::chrono::milliseconds
DwellTime = std::chrono::milliseconds(100);
108 virtual const char*
GetParamClassTag() const noexcept
override {
return "Trajectory1DParams"; }
111 "TrajectoryDataInstr",
"Trajectory data stream",
"Data stream instrument to stream position data from",
DynExpUI::Icons::Instrument };
115 "InterModuleCommunicator",
"Inter-module communicator",
"Inter-module communicator to control this module with",
DynExpUI::Icons::Instrument,
true };
118 "Trigger action which starts streaming the position data",
true, Trajectory1DData::TriggerModeType::Manual };
120 "Determines how many times the trajectory data stream should be played back after a trigger event has occurred",
true, 1, 1 };
122 "Dwell time used for data streams containing samples without time data",
true, 100, 1 };
148 constexpr
static auto Name() noexcept {
return "1D Trajectory Positioning"; }
149 constexpr
static auto Category() noexcept {
return "Motion Control"; }
158 std::chrono::milliseconds
GetMainLoopDelay() const override final {
return std::chrono::milliseconds(1); }
163 void ResetImpl(dispatch_tag<QModuleBase>)
override final;
165 std::unique_ptr<DynExp::QModuleWidget>
MakeUIWidget() override final;
176 void OnInit(
DynExp::ModuleInstance* Instance) const override final;
177 void OnExit(
DynExp::ModuleInstance* Instance) const override final;
Provides common events for inter-module communication. Also refer to DynExp::InterModuleEventBase.
Defines DynExp's core module as an interface between the UI and DynExp objects.
std::vector< BasicSample > BasicSampleListType
Type of a list containing data stream samples of type BasicSample.
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...
virtual ~Trajectory1DConfigurator()=default
Trajectory1DConfigurator()=default
void SetTriggerMode(TriggerModeType TriggerMode) noexcept
void SetCurrentPlaybackPos(size_t CurrentPlaybackPos) noexcept
auto GetCurrentPlaybackPos() const noexcept
void SetSamples(DynExpInstr::DataStreamBase::BasicSampleListType &&Samples) noexcept
void SetTrajectoryStartedTime(std::chrono::time_point< std::chrono::system_clock > TrajectoryStartedTime) noexcept
virtual void ResetImpl(dispatch_tag< Trajectory1DData >)
auto GetTrajectoryStartedTime() const noexcept
size_t LastWrittenSampleID
size_t CurrentPlaybackPos
0 means waiting for trigger. Values > 0 mean running. They indicate the sample to be written next.
auto IsReady() const noexcept
DynExp::LinkedObjectWrapperContainer< DynExpInstr::PositionerStage > PositionerStage
void SetDwellTime(std::chrono::milliseconds DwellTime) noexcept
void SetReady(bool Ready) noexcept
auto GetLastWrittenSampleID() const noexcept
auto GetDwellTime() const noexcept
void SetCurrentRepeatCount(size_t CurrentRepeatCount) noexcept
auto & GetPositionerStage()
const auto & GetSamples() const noexcept
DynExp::LinkedObjectWrapperContainer< DynExpInstr::InterModuleCommunicator > Communicator
DynExpInstr::DataStreamBase::BasicSampleListType Samples
auto & GetSamples() noexcept
std::chrono::time_point< std::chrono::system_clock > TrajectoryStartedTime
bool IsTriggered() const noexcept
TriggerModeType TriggerMode
void SetRepeatCount(size_t RepeatCount) noexcept
DynExp::LinkedObjectWrapperContainer< DynExpInstr::DataStreamInstrument > TrajectoryDataInstr
auto & GetTrajectoryDataInstr()
void ResetImpl(dispatch_tag< QModuleDataBase >) override final
auto GetCurrentRepeatCount() const noexcept
virtual ~Trajectory1DData()=default
auto GetTriggerMode() const noexcept
size_t CurrentRepeatCount
bool Ready
Running (not necessarily triggered yet) if true.
void SetLastWrittenSampleID(size_t LastWrittenSampleID) noexcept
std::chrono::milliseconds DwellTime
auto GetRepeatCount() const noexcept
virtual ~Trajectory1DParams()=default
Trajectory1DParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
Param< DynExp::ObjectLink< DynExpInstr::PositionerStage > > PositionerStage
static Util::TextValueListType< Trajectory1DData::TriggerModeType > TriggerModeTypeStrList()
Param< ParamsConfigDialog::NumberType > RepeatCount
Param< ParamsConfigDialog::NumberType > DwellTime
Param< DynExp::ObjectLink< DynExpInstr::InterModuleCommunicator > > Communicator
Param< Trajectory1DData::TriggerModeType > TriggerMode
void ConfigureParamsImpl(dispatch_tag< QModuleParamsBase >) override final
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< DynExp::ObjectLink< DynExpInstr::DataStreamInstrument > > TrajectoryDataInstr
void ResetImpl(dispatch_tag< QModuleBase >) override final
void UpdateStream(Util::SynchronizedPointer< ModuleDataType > &ModuleData)
std::unique_ptr< DynExp::QModuleWidget > MakeUIWidget() override final
Used by InitUI() as a factory function for the module's user interface widget. Create the widget here...
virtual ~Trajectory1D()=default
void Start(Util::SynchronizedPointer< ModuleDataType > &ModuleData) const
void OnTriggerClicked(DynExp::ModuleInstance *Instance, bool) const
void OnTrigger(DynExp::ModuleInstance *Instance) const
std::chrono::milliseconds GetMainLoopDelay() const override final
Specifies in which time intervals the module's event queue runs to handle pending events.
void Trigger(Util::SynchronizedPointer< ModuleDataType > &ModuleData) const
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...
virtual std::string GetName() const override
Returns the name of this Object type.
size_t NumFailedUpdateAttempts
void OnStartClicked(DynExp::ModuleInstance *Instance, bool) const
void Stop(Util::SynchronizedPointer< ModuleDataType > &ModuleData) const
Trajectory1DData ModuleDataType
void OnExit(DynExp::ModuleInstance *Instance) const override final
This event is triggered right before the module thread terminates (not due to an exception,...
constexpr static auto Name() noexcept
void OnStopClicked(DynExp::ModuleInstance *Instance, bool) const
void OnStop(DynExp::ModuleInstance *Instance) const
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...
Trajectory1D(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
void OnStart(DynExp::ModuleInstance *Instance) const
constexpr static auto Category() noexcept
void Move(Util::SynchronizedPointer< ModuleDataType > &ModuleData)
virtual std::string GetCategory() const override
Returns the category of this Object type.
void UpdateUIChild(const ModuleBase::ModuleDataGetterType &ModuleDataGetter) override final
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...
Util::CallableMemberWrapper< ModuleBase, ModuleDataTypeSyncPtrType(ModuleBase::*)(const std::chrono::milliseconds)> ModuleDataGetterType
Invoking an instance of this alias is supposed to call ModuleBase::GetModuleData() of the instance th...
const std::unique_ptr< ModuleDataType > ModuleData
Module data belonging to this ModuleBase instance.
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.
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...
Base class for modules with a Qt-based user interface. Derive from this class to implement modules wi...
QModuleBase(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
Constructs a QModuleBase instance.
Configurator class for QModuleBase.
Data class for QModuleBase.
Parameter class for QModuleBase.
QModuleParamsBase(ItemIDType ID, const DynExpCore &Core)
Constructs the parameters for a QModuleBase instance.
DynExp's module namespace contains the implementation of DynExp modules which extend DynExp's core fu...
constexpr auto Instrument
DynExp's main namespace contains the implementation of DynExp including classes to manage resources (...
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
DynExp's Util namespace contains commonly used functions and templates as well as extensions to Qt an...
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.