18 namespace NP_Conex_CC_Tasks
326 virtual const char*
GetParamClassTag() const noexcept
override {
return "NP_Conex_CC_Params"; }
331 "Address (1-31) of the Conex controller to be used",
true, 1, 1, 31 };
358 static std::string AnswerToNumberString(std::string&& Answer,
const char* StartCode);
360 constexpr static auto Name() noexcept {
return "NP Conex-CC"; }
365 virtual std::string
GetName()
const override {
return Name(); }
375 virtual std::chrono::milliseconds
GetTaskQueueDelay()
const override {
return std::chrono::milliseconds(1000); }
377 virtual void SetHome()
const override { MakeAndEnqueueTask<NP_Conex_CC_Tasks::SetHomeTask>(); }
384 virtual void StopMotion()
const override { MakeAndEnqueueTask<NP_Conex_CC_Tasks::StopMotionTask>(); }
387 virtual void OnErrorChild()
const override;
389 void ResetImpl(dispatch_tag<PositionerStage>)
override final;
392 virtual std::unique_ptr<DynExp::InitTaskBase>
MakeInitTask()
const override {
return DynExp::MakeTask<NP_Conex_CC_Tasks::InitTask>(); }
393 virtual std::unique_ptr<DynExp::ExitTaskBase>
MakeExitTask()
const override {
return DynExp::MakeTask<NP_Conex_CC_Tasks::ExitTask>(); }
394 virtual std::unique_ptr<DynExp::UpdateTaskBase>
MakeUpdateTask()
const override {
return DynExp::MakeTask<NP_Conex_CC_Tasks::UpdateTask>(); }
Defines DynExp's core module as an interface between the UI and DynExp objects.
Implementation of a meta instrument to control single-axis positioner stages.
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 ~NP_Conex_CC_Configurator()=default
NP_Conex_CC_Configurator()=default
virtual void ConfigureParamsImpl(dispatch_tag< NP_Conex_CC_Params >)
virtual ~NP_Conex_CC_Params()=default
void ConfigureParamsImpl(dispatch_tag< PositionerStageParams >) 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...
NP_Conex_CC_Params(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
virtual bool HasFailedChild() const noexcept override
Returns whether the stage is in an error state, i.e. moving has failed (result of HasFailedChild())
virtual bool IsMovingChild() const noexcept override
Returns whether the stage is currently moving (result of IsMovingChild())
size_t NumFailedStatusUpdateAttempts
virtual void ResetImpl(dispatch_tag< NP_Conex_CC_StageData >)
auto GetConex_CCStatus() const noexcept
auto GetErrorCode() const noexcept
virtual bool HasArrivedChild() const noexcept override
Returns whether the stage has arrived at its destiny position (result of HasArrivedChild())
NP_Conex_CC_StageData()=default
auto GetChannel() const noexcept
DynExp::LinkedObjectWrapperContainer< DynExp::SerialCommunicationHardwareAdapter > HardwareAdapter
void ResetImpl(dispatch_tag< PositionerStageData >) override final
Refer to DynExp::InstrumentDataBase::Reset(). Using tag dispatch mechanism to ensure that ResetImpl()...
Conex_CCStatusType Conex_CCStatus
virtual ~NP_Conex_CC_StageData()=default
virtual void ExitFuncImpl(dispatch_tag< ExitTask >, DynExp::InstrumentInstance &Instance)
void ExitFuncImpl(dispatch_tag< PositionerStageTasks::ExitTask >, DynExp::InstrumentInstance &Instance) override final
Deinitializes the respective instrument within the instrument inheritance hierarchy....
void InitFuncImpl(dispatch_tag< PositionerStageTasks::InitTask >, DynExp::InstrumentInstance &Instance) override final
Initializes the respective instrument within the instrument inheritance hierarchy....
virtual void InitFuncImpl(dispatch_tag< InitTask >, DynExp::InstrumentInstance &Instance)
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
const PositionerStageData::PositionType Position
MoveAbsoluteExecutionTask(PositionerStageData::PositionType Position, CallbackType CallbackFunc, std::chrono::system_clock::time_point DeferUntil={}) noexcept
In this task, some commands cannot be send right after each other to the controller....
const PositionerStageData::PositionType Position
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
MoveAbsoluteTask(PositionerStageData::PositionType Position, CallbackType CallbackFunc) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
const PositionerStageData::PositionType Position
MoveRelativeExecutionTask(PositionerStageData::PositionType Position, CallbackType CallbackFunc, std::chrono::system_clock::time_point DeferUntil={}) noexcept
In this task, some commands cannot be send right after each other to the controller....
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
MoveRelativeTask(PositionerStageData::PositionType Position, CallbackType CallbackFunc) noexcept
const PositionerStageData::PositionType Position
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
MoveToHomeExecutionTask(CallbackType CallbackFunc, std::chrono::system_clock::time_point DeferUntil={}) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
ReferenceExecutionTask(CallbackType CallbackFunc, std::chrono::system_clock::time_point DeferUntil={}) noexcept
In this task, some commands cannot be send right after each other to the controller....
const PositionerStage::DirectionType Direction
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
ReferenceTask(PositionerStage::DirectionType Direction, CallbackType CallbackFunc) noexcept
ResetTask(CallbackType CallbackFunc=nullptr, std::chrono::system_clock::time_point DeferUntil={}) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
SetHomeExecutionTask(CallbackType CallbackFunc, std::chrono::system_clock::time_point DeferUntil={}) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
SetReadyTask(CallbackType CallbackFunc=nullptr, std::chrono::system_clock::time_point DeferUntil={}) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
SetVelocityTask(PositionerStageData::PositionType Velocity, CallbackType CallbackFunc=nullptr, std::chrono::system_clock::time_point DeferUntil={}) noexcept
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
const PositionerStageData::PositionType Velocity
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
void UpdateFuncImpl(dispatch_tag< PositionerStageTasks::UpdateTask >, DynExp::InstrumentInstance &Instance) override final
Updates the respective instrument within the instrument inheritance hierarchy. Call UpdateFuncImpl() ...
virtual void UpdateFuncImpl(dispatch_tag< UpdateTask >, DynExp::InstrumentInstance &Instance)
virtual void SetHome() const override
Stores the positioner's home position. Also refer to MoveToHome().
virtual void SetVelocity(PositionerStageData::PositionType Velocity) const override
Sets the positioner's velocity in its native units. Do divide units of PositionerStageData::Velocity ...
virtual void Reference(DirectionType Direction=DirectionType::Forward, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
References the positioner such that it finds its zero position or end stop.
virtual PositionerStageData::PositionType GetMinPosition() const noexcept override
Returns the minimal position the stage can move to in nm if the stage supports SI units,...
virtual std::unique_ptr< DynExp::InitTaskBase > MakeInitTask() const override
Factory function for an init task (InitTaskBase). Override to define the desired initialization task ...
double GetInputValuePositionTypeRatio() const noexcept
virtual PositionerStageData::PositionType GetMaxPosition() const noexcept override
Returns the maximal position the stage can move to in nm if the stage supports SI units,...
virtual void MoveRelative(PositionerStageData::PositionType Position, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Moves the positioner to a position relative to its current position. The position offset Steps has to...
virtual void MoveAbsolute(PositionerStageData::PositionType Position, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Moves the positioner to an absolute position in its native units. Do divide units of PositionerStageD...
virtual PositionerStageData::PositionType GetResolution() const noexcept override
Returns the stage's position resolution (precision) in nm if the stage supports SI units,...
virtual PositionerStageData::PositionType GetMinVelocity() const noexcept override
Returns the minimal velocity the stage can move with in nm/s if the stage supports SI units,...
virtual void StopMotion() const override
Stops any motion or position stabilization of the positioner immediately.
virtual PositionerStageData::PositionType GetDefaultVelocity() const noexcept override
Returns the stage's default velocity in nm/s if the stage supports SI units, in steps/s otherwise.
virtual std::unique_ptr< DynExp::ExitTaskBase > MakeExitTask() const override
Factory function for an exit task (ExitTaskBase). Override to define the desired deinitialization tas...
static constexpr auto Name() noexcept
virtual void MoveToHome(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Moves the positioner to its stored home position. Also refer to SetHome().
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...
virtual void ResetImpl(dispatch_tag< NP_Conex_CC >)
virtual std::string GetName() const override
Returns the name of this Object type.
virtual std::chrono::milliseconds GetTaskQueueDelay() const override
Specifies in which time intervals the instrument's task queue runs to handle pending tasks.
virtual PositionerStageData::PositionType GetMaxVelocity() const noexcept override
Returns the maximal velocity the stage can move with in nm/s if the stage supports SI units,...
Configurator class for PositionerStage.
Data class for PositionerStage.
signed long long PositionType
Numeric type to store the stage positions.
Parameter class for PositionerStage.
Defines a task for deinitializing an instrument within an instrument inheritance hierarchy....
Defines a task for initializing an instrument within an instrument inheritance hierarchy....
Defines a task for updating an instrument within an instrument inheritance hierarchy....
Implementation of a meta instrument to control single-axis positioner stages.
DirectionType
Type to determine the direction of the positioner stage's movements.
DynExp's core class acts as the interface between the user interface and DynExp's internal data like ...
Refer to DynExp::ParamsBase::dispatch_tag.
Refer to DynExp::ParamsBase::dispatch_tag.
Refer to ParamsBase::dispatch_tag.
Defines data for a thread belonging to a InstrumentBase instance. Refer to RunnableInstance.
This class holds a pointer (LinkedObjectWrapperPointer) to a LinkedObjectWrapper. Intances of this cl...
Refer to ParamsBase::dispatch_tag.
Tag for function dispatching mechanism within this class used when derived classes are not intended t...
Type owning a callback function which is invoked when a task has finished, failed,...
Base class for all tasks being processed by instruments. The class must not contain public virtual fu...
CallbackType CallbackFunc
This callback function is called after the task has finished (either successfully or not) with a poin...
const std::chrono::system_clock::time_point DeferUntil
The execution of this task is deferred until the specified point in time is reached if time_since_epo...
TaskBase(CallbackType CallbackFunc=nullptr, std::chrono::system_clock::time_point DeferUntil={}) noexcept
Constructs an instrument task.
Defines the return type of task functions.
Refer to DynExp::ParamsBase::dispatch_tag.
DynExp's instrument namespace contains the implementation of DynExp instruments which extend DynExp's...
constexpr auto HardwareAdapter
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.
Accumulates include statements to provide a precompiled header.
Interprets and queries the controller's internal state based on the TS command byte code.
constexpr bool NotReferencedFromMoving() const noexcept
Controller is NOT REFERENCED, entered from MOVING. (ByteCode == 0x0F)
constexpr bool NotReferencedFromConfiguration() const noexcept
Controller is NOT REFERENCED, entered from CONFIGURATION. (ByteCode == 0x0C)
constexpr bool NotReferencedFromHoming() const noexcept
Controller is NOT REFERENCED, entered from HOMING. (ByteCode == 0x0B)
constexpr bool DisableFromReadyT() const noexcept
Controller is DISABLED, entered from READY T. (ByteCode == 0x3F)
constexpr bool NotReferencedNoParams() const noexcept
Controller is NOT REFERENCED, with no parameters in memory. (ByteCode == 0x10)
constexpr bool TrackingFromReadyT() const noexcept
Controller is TRACKING, entered from READY T. (ByteCode == 0x46)
constexpr bool ReadyTFromReady() const noexcept
Controller is READY (Tracking), entered from READY. (ByteCode == 0x36)
constexpr bool NotReferencedFromReset() const noexcept
Controller is NOT REFERENCED, entered from RESET. (ByteCode == 0x0A)
constexpr bool TrackingFromTracking() const noexcept
Controller is TRACKING, entered from TRACKING. (ByteCode == 0x47)
constexpr bool DisableFromTracking() const noexcept
Controller is DISABLED, entered from TRACKING. (ByteCode == 0x3E)
constexpr bool ReadyTFromTracking() const noexcept
Controller is READY (Tracking), entered from TRACKING. (ByteCode == 0x37)
constexpr bool Homing() const noexcept
Controller is in HOMING state. (ByteCode == 0x1E)
constexpr bool DisableFromMoving() const noexcept
Controller is DISABLED, entered from MOVING. (ByteCode == 0x3D)
constexpr bool Moving() const noexcept
Controller is in MOVING state. (ByteCode == 0x28)
constexpr void Set(uint8_t ByteCode) noexcept
constexpr bool ReadyFromDisable() const noexcept
Controller is READY, entered from DISABLE. (ByteCode == 0x34)
constexpr bool Configuration() const noexcept
Controller is in CONFIGURATION state. (ByteCode == 0x14)
constexpr bool NotReferencedFromDisable() const noexcept
Controller is NOT REFERENCED, entered from DISABLE. (ByteCode == 0x0D)
constexpr bool DisableFromReady() const noexcept
Controller is DISABLED, entered from READY. (ByteCode == 0x3C)
constexpr bool NotReferencedFromReady() const noexcept
Controller is NOT REFERENCED, entered from READY. (ByteCode == 0x0E)
constexpr bool ReadyFromHoming() const noexcept
Controller is READY, entered from HOMING. (ByteCode == 0x32)
constexpr bool ReadyTFromDisableT() const noexcept
Controller is READY (Tracking), entered from DISABLE T. (ByteCode == 0x38)
constexpr bool ReadyFromMoving() const noexcept
Controller is READY, entered from MOVING. (ByteCode == 0x33)