20 namespace SmarActTasks
127 constexpr
bool IsMoving() const noexcept {
return ByteCode & (SA_CTL_CH_STATE_BIT_ACTIVELY_MOVING); }
138 return ByteCode & (SA_CTL_CH_STATE_BIT_FOLLOWING_LIMIT_REACHED | SA_CTL_CH_STATE_BIT_MOVEMENT_FAILED
139 | SA_CTL_CH_STATE_BIT_POSITIONER_OVERLOAD | SA_CTL_CH_STATE_BIT_OVER_TEMPERATURE
140 | SA_CTL_CH_STATE_BIT_POSITIONER_FAULT);
188 "Channel of the SmarAct controller this instrument refers to",
true, 0, 0, std::numeric_limits<uint8_t>::max(), 1, 0 };
215 constexpr
static auto Name() noexcept {
return "SmarAct"; }
231 virtual void SetHome()
const override { MakeAndEnqueueTask<SmarActTasks::SetHomeTask>(); }
239 virtual void StopMotion()
const override { MakeAndEnqueueTask<SmarActTasks::StopMotionTask>(); }
244 void ResetImpl(dispatch_tag<PositionerStage>)
override final;
247 virtual std::unique_ptr<DynExp::InitTaskBase>
MakeInitTask()
const override {
return DynExp::MakeTask<SmarActTasks::InitTask>(); }
248 virtual std::unique_ptr<DynExp::ExitTaskBase>
MakeExitTask()
const override {
return DynExp::MakeTask<SmarActTasks::ExitTask>(); }
249 virtual std::unique_ptr<DynExp::UpdateTaskBase>
MakeUpdateTask()
const override {
return DynExp::MakeTask<SmarActTasks::UpdateTask>(); }
Defines DynExp's core module as an interface between the UI and DynExp objects.
Implementation of a hardware adapter to control SmarAct MCS2 hardware.
Implementation of a meta instrument to control single-axis positioner stages.
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.
virtual ~SmarActConfigurator()=default
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...
SmarActConfigurator()=default
PositionType HomePosition
virtual bool IsMovingChild() const noexcept override
Returns whether the stage is currently moving (result of IsMovingChild())
virtual bool HasArrivedChild() const noexcept override
Returns whether the stage has arrived at its destiny position (result of HasArrivedChild())
auto GetSmarActChannelStatus() const noexcept
DynExpHardware::SmarActHardwareAdapter::ChannelType Channel
auto & GetSmarActChannelStatus() noexcept
auto GetChannel() const noexcept
virtual ~SmarActData()=default
virtual void ResetImpl(dispatch_tag< SmarActData >)
void SetHomePosition(PositionType HomePosition) noexcept
virtual bool HasFailedChild() const noexcept override
Returns whether the stage is in an error state, i.e. moving has failed (result of HasFailedChild())
void ResetImpl(dispatch_tag< PositionerStageData >) override final
Refer to DynExp::InstrumentDataBase::Reset(). Using tag dispatch mechanism to ensure that ResetImpl()...
size_t NumFailedStatusUpdateAttempts
auto GetHomePosition() const noexcept
virtual bool IsReferencedChild() const noexcept override
Returns whether a closed-loop positioner knows its position in respect to its zero point (result of I...
DynExp::LinkedObjectWrapperContainer< DynExpHardware::SmarActHardwareAdapter > HardwareAdapter
SmarActChannelStatusType SmarActChannelStatus
virtual void ConfigureParamsImpl(dispatch_tag< SmarActParams >)
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< DynExpHardware::SmarActHardwareAdapter > > HardwareAdapter
SmarActParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
void ConfigureParamsImpl(dispatch_tag< PositionerStageParams >) override final
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to...
virtual ~SmarActParams()=default
Param< ParamsConfigDialog::NumberType > Channel
CalibrateTask(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...
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)
MoveAbsoluteTask(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...
MoveRelativeTask(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
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(CallbackType CallbackFunc) noexcept
const PositionerStageData::PositionType Velocity
SetVelocityTask(PositionerStageData::PositionType Velocity) 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...
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...
virtual void UpdateFuncImpl(dispatch_tag< UpdateTask >, DynExp::InstrumentInstance &Instance)
void UpdateFuncImpl(dispatch_tag< PositionerStageTasks::UpdateTask >, DynExp::InstrumentInstance &Instance) override final
Updates the respective instrument within the instrument inheritance hierarchy. Call UpdateFuncImpl() ...
virtual std::unique_ptr< DynExp::ExitTaskBase > MakeExitTask() const override
Factory function for an exit task (ExitTaskBase). Override to define the desired deinitialization tas...
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 SetVelocity(PositionerStageData::PositionType Velocity) const override
Sets the positioner's velocity in its native units. Do divide units of PositionerStageData::Velocity ...
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 Reference([[maybe_unused]] DirectionType Direction=DirectionType::Forward, DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
virtual void OnErrorChild() const override
Derived classes can perform critical shutdown actions after an error has occurred....
virtual std::string GetName() const override
Returns the name of this Object type.
SmarAct(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
virtual void Calibrate(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Calibrates the positioner. The meaning of such a calibration is solely specified by the hardware manu...
constexpr static auto Name() noexcept
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 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::InitTaskBase > MakeInitTask() const override
Factory function for an init task (InitTaskBase). Override to define the desired initialization task ...
virtual void MoveToHome(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Moves the positioner to its stored home position. Also refer to SetHome().
virtual void StopMotion() const override
Stops any motion or position stabilization of the positioner immediately.
virtual double GetStepNanoMeterRatio() const noexcept override
Determines the conversion factor in between internal PositionerStageData::PositionType positiond and ...
virtual void SetHome() const override
Stores the positioner's home position. Also refer to MoveToHome().
virtual void ResetImpl(dispatch_tag< SmarAct >)
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 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 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 bool IsUsingSIUnits() const noexcept override
Determines whether the underlying hardware expects SI units for positions and velocities or arbitrary...
void ResetImpl(dispatch_tag< PositionerStage >) override final
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
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,...
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,...
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.
Base class for instruments. Instruments comprise virtual devices (meta instruments) and physial devic...
Configurator class for InstrumentBase.
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 InstrumentBase instance. Refer to RunnableInstance.
Parameter class for InstrumentBase.
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.
Refer to ParamsBase::dispatch_tag.
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 all tasks being processed by instruments. The class must not contain public virtual fu...
std::function< void(const TaskBase &, ExceptionContainer &)> CallbackType
Type of a callback function which is invoked when a task has finished, failed or has been aborted....
TaskBase(CallbackType CallbackFunc=nullptr) noexcept
Constructs an instrument task.
const CallbackType CallbackFunc
This callback function is called after the task has finished (either successfully or not) with a refe...
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.
constexpr bool IsReferencing() const noexcept
constexpr void Set(int32_t ByteCode) noexcept
constexpr bool IsSensorPresent() const noexcept
constexpr bool IsEndStopReached() const noexcept
constexpr bool IsCalibrated() const noexcept
constexpr bool IsErrorState() const noexcept
constexpr bool IsRangeLimitReached() const noexcept
constexpr bool IsClosedLoopActive() const noexcept
constexpr bool IsMoving() const noexcept
constexpr bool IsReferenced() const noexcept
constexpr bool IsCalibrating() const noexcept