|
DynExp
Highly flexible laboratory automation for dynamically changing experiments.
|
#include <HardwareAdapterPVCam.h>
Inheritance diagram for DynExpHardware::PVCamHardwareAdapter:Classes | |
| class | PVCamInitializer |
Only one instance of this class is allowed for synchronizing calls to the PVCam library from any PVCamHardwareAdapter instance. More... | |
| struct | PVCamReadoutOptionType |
Public Types | |
| using | ParamsType = PVCamHardwareAdapterParams |
| using | ConfigType = PVCamHardwareAdapterConfigurator |
| using | TimeType = std::chrono::milliseconds |
Public Types inherited from DynExp::HardwareAdapterBase | |
| using | ParamsType = HardwareAdapterParamsBase |
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. " | |
| using | ConfigType = HardwareAdapterConfiguratorBase |
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. | |
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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
Public Member Functions | |
| PVCamHardwareAdapter (const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params) | |
| virtual | ~PVCamHardwareAdapter () |
| virtual std::string | GetName () const override |
Returns the name of this Object type. | |
| virtual std::string | GetCategory () const override |
Returns the category of this Object type. | |
| bool | IsOpened () const noexcept |
| auto | GetCameraState () const noexcept |
| decltype(PVCamSyms::rgn_type::s2) | GetImageWidth () const |
| decltype(PVCamSyms::rgn_type::p2) | GetImageHeight () const |
| DynExpInstr::CameraData::CameraModesType | GetCameraModes () const |
| auto | GetBitDepth () const noexcept |
| auto | GetColorMode () const noexcept |
| TimeType | GetMinExposureTime () const |
| TimeType | GetMaxExposureTime () const |
| TimeType | GetExposureTime () const |
| float | GetFPS () const |
| Util::BlobDataType | GetCurrentImage () const |
| Util::BlobDataType | GetCurrentImageCopy () const |
| void | SetCameraMode (size_t ID) const |
| void | SetExposureTime (TimeType Time) const |
| void | CaptureSingle () const |
| void | StartCapturing () const |
| void | StopCapturing () const |
Public Member Functions inherited from DynExp::HardwareAdapterBase | |
| HardwareAdapterBase (const std::thread::id OwnerThreadID, ParamsBasePtrType &&Params) | |
| Constructs a hardware adapter instance. | |
| virtual | ~HardwareAdapterBase ()=0 |
| void | ResetException () const |
| Sets LastException to nullptr in a thread-safe way. | |
| bool | IsConnected () const noexcept |
| Determines the connection status of the hardware interface. | |
Public Member Functions inherited from Util::INonCopyable | |
| INonCopyable (const INonCopyable &)=delete | |
| INonCopyable & | operator= (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. | |
| std::string | GetCategoryAndName () const |
Builds a string from an Object's category and name to allow the user to identify an Object's type. | |
| void | EnsureReadyState (bool IsAutomaticStartup) |
Ensures that this Object instance is ready by possibly starting its worker thread or by opening connections to hardware devices. | |
| void | CheckLinkedObjectStates () const |
Checks whether Object instances this instance uses are in a ready state. Override CheckLinkedObjectStatesChild() to implement this behavior. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| auto | GetObjectName (const std::chrono::milliseconds Timeout=GetParamsTimeoutDefault) const |
Returns the name of this Object instance. | |
| bool | IsSharedUsageEnabled (const std::chrono::milliseconds Timeout=GetParamsTimeoutDefault) const |
Returns whether shared usage has been enabled for this Object instance. Refer to ParamsBase::UsageType. | |
| void | SetWarning (std::string Description, int ErrorCode) const |
| Setter for Object::Warning. Sets the warning by a description and an error code. | |
| void | SetWarning (const Util::Exception &e) const |
Setter for Object::Warning. Sets the warning by retrieving the warning data from an exception e. | |
| void | ClearWarning () const |
| Resets Object::Warning. | |
| auto | GetWarning () const |
| Returns Object::Warning in a thread-safe way by copying its internal data. | |
| 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. | |
| 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). | |
| auto | GetUseCount (const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) const |
| Counts the registered useres in a thread-safe way. | |
| bool | IsUnused (const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) const |
Returns whether this Object instance is used by other instances. | |
| 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. | |
| 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. | |
Static Public Member Functions | |
| static constexpr auto | Name () noexcept |
| static constexpr auto | Category () noexcept |
| static constexpr auto | BytesPerPixel () noexcept |
| static auto | Enumerate () |
Static Public Member Functions inherited from DynExp::HardwareAdapterBase | |
| static constexpr auto | Category () noexcept |
| Every derived class has to redefine this function. | |
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. | |
Private Types | |
| using | CameraStateType = DynExpInstr::CameraData::CapturingStateType |
| using | PVCamEnumType = std::pair< PVCamSyms::int32, std::string > |
| using | PVCamEnumVectorType = std::vector< PVCamEnumType > |
Private Member Functions | |
| void | Init () |
| void | ResetImpl (dispatch_tag< HardwareAdapterBase >) override final |
| virtual void | ResetImpl (dispatch_tag< PVCamHardwareAdapter >) |
| void | EnsureReadyStateChild () override final |
Ensures that this Object instance is ready by possibly starting its worker thread or by opening connections to hardware devices. | |
| bool | IsReadyChild () const override final |
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). | |
| bool | IsConnectedChild () const noexcept override final |
| Determines the connection status of the hardware interface. | |
| void | CheckError (const PVCamSyms::rs_bool Result, bool OnlyLog=false, const std::source_location Location=std::source_location::current()) const |
| void | OpenUnsafe () |
| void | CloseUnsafe () |
| void | ReserveMemory (const PVCamSyms::uns32 BytesRequired) const |
| PVCamEnumVectorType | ReadPVCamEnumUnsafe (PVCamSyms::uns32 ParamID, std::string ParamName) |
| void | SetupSpeedTableUnsafe () |
| void | SetCameraModeUnsafe (size_t ID) const |
| void | StartCapturingUnsafe () const |
| void | StopCapturingUnsafe () const |
| void | ReadMinMaxExposureTimeUnsafe () const |
| void | ReadExposureTimeUnsafe () const |
| void | NewFrame (PVCamSyms::FRAME_INFO *FrameInfo) noexcept |
Static Private Member Functions | |
| static void PV_DECL | NewFrameCallback (PVCamSyms::FRAME_INFO *FrameInfo, void *PVCamHardwareAdapterPtr) |
Private Attributes | |
| std::atomic< CameraStateType > | CameraState |
| std::string | CameraName |
| std::vector< PVCamReadoutOptionType > | CameraSpeedTable |
| TimeType | MinExpTime |
| TimeType | MaxExpTime |
| TimeType | ExposureTime |
| float | CurrentFPS |
| PVCamSyms::rgn_type | Region |
| std::atomic< PVCamSyms::int16 > | BitDepth |
| std::atomic< PVCamSyms::PL_COLOR_MODES > | ColorMode |
| Util::BlobDataType | ImageData |
| Util::BlobDataType | CopiedImageData |
| std::atomic< bool > | PVCamHandleValid |
| PVCamSyms::int16 | PVCamHandle |
Static Private Attributes | |
| static constexpr unsigned int | NumFramesInBuffer = 2 |
Additional Inherited Members | |
Public Attributes inherited from DynExp::Object | |
| LinkedObjectWrapperOnlyType | LinkedObjectWrapperOnly |
Allow exclusive access to some of Object's private methods to any LinkedObjectWrapper<T>. | |
Static Public Attributes inherited from DynExp::HardwareAdapterBase | |
| static constexpr auto | ShortTimeoutDefault = std::chrono::milliseconds(10) |
| Default timeout e.g. used as a default for calls to Object::GetException(). | |
| static constexpr auto | HardwareOperationTimeout = std::chrono::milliseconds(100) |
| Default timeout used to lock the mutex provided by the base class Util::ILockable to synchronize access to the hardware interface in between multiple instrument threads. | |
Static Public Attributes inherited from Util::ILockable | |
| static constexpr std::chrono::milliseconds | DefaultTimeout = std::chrono::milliseconds(10) |
| Duration which is used as a default timeout within all methods of this class if no different duration is passed to them. | |
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. | |
Protected Types inherited from Util::ILockable | |
| using | MutexType = std::timed_mutex |
| using | LockType = std::unique_lock< MutexType > |
Protected Member Functions inherited from DynExp::HardwareAdapterBase | |
| void | ThrowException (std::exception_ptr Exception) const |
Stores Exception in LastException, wraps it in a Util::ForwardedException and throws the wrapped excetion by calling Util::ForwardException(). | |
| void | ThrowExceptionUnsafe (std::exception_ptr Exception) const |
Stores Exception in LastException, wraps it in a Util::ForwardedException and throws the wrapped excetion by calling Util::ForwardException(). | |
| void | SetExceptionUnsafe (std::exception_ptr Exception) const |
Stores Exception in LastException. | |
| auto | GetExceptionUnsafe () const |
| Getter for LastException. | |
Protected Member Functions inherited from Util::ILockable | |
| ILockable ()=default | |
| ~ILockable ()=default | |
| LockType | AcquireLock (const std::chrono::milliseconds Timeout=DefaultTimeout) const |
| Locks the internal mutex. Blocks until the mutex is locked or until the timeout duration is exceeded. | |
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. | |
| 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). | |
| 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). | |
| auto | LockUserList (const std::chrono::milliseconds Timeout=Util::ILockable::DefaultTimeout) |
| Locks the user list for thread-safe manipulation. | |
| void | DeregisterAllUnsafe () |
| Deregisters all users and notifies them that they need to check the states of their used linked objects. | |
| auto | GetUseCountUnsafe () |
| auto | GetUserNamesStringUnsafe () const |
| bool | IsUnusedUnsafe () |
Returns whether this Object instance is used by other instances (not thread-safe). | |
Definition at line 64 of file HardwareAdapterPVCam.h.
|
private |
Definition at line 137 of file HardwareAdapterPVCam.h.
Definition at line 95 of file HardwareAdapterPVCam.h.
Definition at line 94 of file HardwareAdapterPVCam.h.
|
private |
Definition at line 138 of file HardwareAdapterPVCam.h.
|
private |
Definition at line 139 of file HardwareAdapterPVCam.h.
| using DynExpHardware::PVCamHardwareAdapter::TimeType = std::chrono::milliseconds |
Definition at line 97 of file HardwareAdapterPVCam.h.
| DynExpHardware::PVCamHardwareAdapter::PVCamHardwareAdapter | ( | const std::thread::id | OwnerThreadID, |
| DynExp::ParamsBasePtrType && | Params | ||
| ) |
Definition at line 79 of file HardwareAdapterPVCam.cpp.
|
virtual |
Definition at line 85 of file HardwareAdapterPVCam.cpp.
|
inlinestaticconstexprnoexcept |
Definition at line 101 of file HardwareAdapterPVCam.h.
| void DynExpHardware::PVCamHardwareAdapter::CaptureSingle | ( | ) | const |
Definition at line 192 of file HardwareAdapterPVCam.cpp.
|
inlinestaticconstexprnoexcept |
Definition at line 100 of file HardwareAdapterPVCam.h.
|
private |
Definition at line 302 of file HardwareAdapterPVCam.cpp.
|
private |
Definition at line 372 of file HardwareAdapterPVCam.cpp.
|
finaloverrideprivatevirtual |
Ensures that this Object instance is ready by possibly starting its worker thread or by opening connections to hardware devices.
Implements DynExp::HardwareAdapterBase.
Definition at line 278 of file HardwareAdapterPVCam.cpp.
|
static |
Definition at line 8 of file HardwareAdapterPVCam.cpp.
|
inlinenoexcept |
Definition at line 115 of file HardwareAdapterPVCam.h.
| DynExpInstr::CameraData::CameraModesType DynExpHardware::PVCamHardwareAdapter::GetCameraModes | ( | ) | const |
Definition at line 105 of file HardwareAdapterPVCam.cpp.
|
inlinenoexcept |
Definition at line 111 of file HardwareAdapterPVCam.h.
|
inlineoverridevirtual |
Returns the category of this Object type.
Reimplemented from DynExp::HardwareAdapterBase.
Definition at line 108 of file HardwareAdapterPVCam.h.
|
inlinenoexcept |
Definition at line 116 of file HardwareAdapterPVCam.h.
| Util::BlobDataType DynExpHardware::PVCamHardwareAdapter::GetCurrentImage | ( | ) | const |
Definition at line 145 of file HardwareAdapterPVCam.cpp.
| Util::BlobDataType DynExpHardware::PVCamHardwareAdapter::GetCurrentImageCopy | ( | ) | const |
Definition at line 153 of file HardwareAdapterPVCam.cpp.
| PVCamHardwareAdapter::TimeType DynExpHardware::PVCamHardwareAdapter::GetExposureTime | ( | ) | const |
Definition at line 131 of file HardwareAdapterPVCam.cpp.
| float DynExpHardware::PVCamHardwareAdapter::GetFPS | ( | ) | const |
Definition at line 138 of file HardwareAdapterPVCam.cpp.
| decltype(PVCamSyms::rgn_type::p2) DynExpHardware::PVCamHardwareAdapter::GetImageHeight | ( | ) | const |
Definition at line 98 of file HardwareAdapterPVCam.cpp.
| decltype(PVCamSyms::rgn_type::s2) DynExpHardware::PVCamHardwareAdapter::GetImageWidth | ( | ) | const |
Definition at line 91 of file HardwareAdapterPVCam.cpp.
| PVCamHardwareAdapter::TimeType DynExpHardware::PVCamHardwareAdapter::GetMaxExposureTime | ( | ) | const |
Definition at line 124 of file HardwareAdapterPVCam.cpp.
| PVCamHardwareAdapter::TimeType DynExpHardware::PVCamHardwareAdapter::GetMinExposureTime | ( | ) | const |
Definition at line 117 of file HardwareAdapterPVCam.cpp.
|
inlineoverridevirtual |
Returns the name of this Object type.
Implements DynExp::Object.
Definition at line 107 of file HardwareAdapterPVCam.h.
|
private |
Definition at line 245 of file HardwareAdapterPVCam.cpp.
|
finaloverrideprivatevirtualnoexcept |
Determines the connection status of the hardware interface.
Implements DynExp::HardwareAdapterBase.
Definition at line 297 of file HardwareAdapterPVCam.cpp.
|
inlinenoexcept |
Definition at line 110 of file HardwareAdapterPVCam.h.
|
finaloverrideprivatevirtual |
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).
Object instance is ready, false otherwise. Implements DynExp::Object.
Definition at line 287 of file HardwareAdapterPVCam.cpp.
|
inlinestaticconstexprnoexcept |
Definition at line 99 of file HardwareAdapterPVCam.h.
|
privatenoexcept |
Definition at line 605 of file HardwareAdapterPVCam.cpp.
|
staticprivate |
Definition at line 239 of file HardwareAdapterPVCam.cpp.
|
private |
Definition at line 330 of file HardwareAdapterPVCam.cpp.
|
private |
Definition at line 596 of file HardwareAdapterPVCam.cpp.
|
private |
Definition at line 582 of file HardwareAdapterPVCam.cpp.
|
private |
Definition at line 399 of file HardwareAdapterPVCam.cpp.
|
private |
Definition at line 391 of file HardwareAdapterPVCam.cpp.
|
finaloverrideprivate |
Definition at line 263 of file HardwareAdapterPVCam.cpp.
|
inlineprivatevirtual |
Definition at line 166 of file HardwareAdapterPVCam.h.
| void DynExpHardware::PVCamHardwareAdapter::SetCameraMode | ( | size_t | ID | ) | const |
Definition at line 161 of file HardwareAdapterPVCam.cpp.
|
private |
Definition at line 502 of file HardwareAdapterPVCam.cpp.
| void DynExpHardware::PVCamHardwareAdapter::SetExposureTime | ( | TimeType | Time | ) | const |
Definition at line 175 of file HardwareAdapterPVCam.cpp.
|
private |
Definition at line 431 of file HardwareAdapterPVCam.cpp.
| void DynExpHardware::PVCamHardwareAdapter::StartCapturing | ( | ) | const |
Definition at line 219 of file HardwareAdapterPVCam.cpp.
|
private |
Definition at line 544 of file HardwareAdapterPVCam.cpp.
| void DynExpHardware::PVCamHardwareAdapter::StopCapturing | ( | ) | const |
Definition at line 229 of file HardwareAdapterPVCam.cpp.
|
private |
Definition at line 566 of file HardwareAdapterPVCam.cpp.
|
mutableprivate |
Definition at line 199 of file HardwareAdapterPVCam.h.
|
private |
Definition at line 192 of file HardwareAdapterPVCam.h.
|
private |
Definition at line 193 of file HardwareAdapterPVCam.h.
|
mutableprivate |
Definition at line 190 of file HardwareAdapterPVCam.h.
|
private |
Definition at line 200 of file HardwareAdapterPVCam.h.
|
mutableprivate |
Definition at line 205 of file HardwareAdapterPVCam.h.
|
private |
Definition at line 197 of file HardwareAdapterPVCam.h.
|
mutableprivate |
Definition at line 196 of file HardwareAdapterPVCam.h.
|
mutableprivate |
Definition at line 204 of file HardwareAdapterPVCam.h.
|
mutableprivate |
Definition at line 195 of file HardwareAdapterPVCam.h.
|
mutableprivate |
Definition at line 194 of file HardwareAdapterPVCam.h.
|
staticconstexprprivate |
Definition at line 188 of file HardwareAdapterPVCam.h.
|
private |
Definition at line 208 of file HardwareAdapterPVCam.h.
|
private |
Definition at line 207 of file HardwareAdapterPVCam.h.
|
private |
Definition at line 198 of file HardwareAdapterPVCam.h.