13 #include "../MetaInstruments/Stage.h"
17 #include "../include/SmarAct/SmarActControl.h"
28 const std::source_location Location = std::source_location::current()) noexcept
39 virtual const char*
GetParamClassTag() const noexcept
override {
return "SmarActHardwareAdapterParams"; }
42 "Descriptor of the SmarAct controller to connect with" };
72 constexpr
static auto Name() noexcept {
return "SmarAct"; }
73 constexpr
static auto Category() noexcept {
return "Positioners"; }
79 virtual std::string
GetName()
const override {
return Name(); }
108 void ResetImpl(dispatch_tag<HardwareAdapterBase>)
override final;
116 void CheckError(const SmarActSyms::SA_CTL_Result_t Result, const std::source_location Location = std::source_location::current()) const;
Implementation of DynExp hardware adapter objects.
SmarActException(std::string Description, const int ErrorCode, const std::source_location Location=std::source_location::current()) noexcept
SmarActHardwareAdapterConfigurator()=default
virtual ~SmarActHardwareAdapterConfigurator()=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...
SmarActHardwareAdapterParams(DynExp::ItemIDType ID, const DynExp::DynExpCore &Core)
Param< TextList > DeviceDescriptor
virtual void ConfigureParamsImpl(dispatch_tag< SmarActHardwareAdapterParams >)
void ConfigureParamsImpl(dispatch_tag< HardwareAdapterParamsBase >) 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...
virtual ~SmarActHardwareAdapterParams()=default
virtual std::string GetCategory() const override
Returns the category of this Object type.
PositionType GetVelocity(const ChannelType Channel) const
int32_t GetChannelState(const ChannelType Channel) const
void MoveAbsolute(const ChannelType Channel, PositionType Position) const
constexpr static auto Name() noexcept
bool IsConnectedChild() const noexcept override final
Determines the connection status of the hardware interface.
constexpr static auto Category() noexcept
void ResetImpl(dispatch_tag< HardwareAdapterBase >) override final
std::atomic< bool > SmarActHandleValid
void MoveRelative(const ChannelType Channel, PositionType Position) const
virtual void ResetImpl(dispatch_tag< SmarActHardwareAdapter >)
void CheckError(const SmarActSyms::SA_CTL_Result_t Result, const std::source_location Location=std::source_location::current()) const
PositionType GetTargetPosition(const ChannelType Channel) const
SmarActSyms::SA_CTL_DeviceHandle_t SmarActHandle
void EnsureReadyStateChild() override final
Ensures that this Object instance is ready by possibly starting its worker thread or by opening conne...
void Calibrate(const ChannelType Channel) const
void SetVelocity(const ChannelType Channel, PositionType Velocity) const
bool IsOpened() const noexcept
void Reference(const ChannelType Channel) const
SmarActHardwareAdapter(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
std::string DeviceDescriptor
bool IsReadyChild() const override final
Returns wheter this Object instance is ready (e.g. it is running or connected to a hardware device) a...
virtual ~SmarActHardwareAdapter()
virtual std::string GetName() const override
Returns the name of this Object type.
void StopMotion(const ChannelType Channel) const
PositionType GetCurrentPosition(const ChannelType Channel) const
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 ...
Defines the base class for a hardware adapter object. Hardware adapters describe interfaces/connectio...
Configurator class for HardwareAdapterBase.
Parameter class for HardwareAdapterBase.
HardwareAdapterParamsBase(ItemIDType ID, const DynExpCore &Core)
Constructs the parameters for a HardwareAdapterBase 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.
Refer to ParamsBase::dispatch_tag.
const ItemIDType ID
ID of the Object this parameter class instance belongs to.
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 exceptions are derived from this class. It contains basic information about the cause of the e...
Exception(std::string Description, const ErrorType Type=ErrorType::Error, const int ErrorCode=-1, const std::source_location Location=std::source_location::current()) noexcept
Constructs an exception. Constructor is noexcept, although std::runtime_error() might throw std::bad_...
const int ErrorCode
DynExp error code from DynExpErrorCodes::DynExpErrorCodes
DynExp's hardware namespace contains the implementation of DynExp hardware adapters which extend DynE...
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.
DynExp's Util namespace contains commonly used functions and templates as well as extensions to Qt an...
ErrorType
DynExp's error types
Accumulates include statements to provide a precompiled header.