MMDevice  70
Public Types | Public Member Functions | List of all members
CStateDeviceBase< U > Class Template Reference

#include <DeviceBase.h>

Inheritance diagram for CStateDeviceBase< U >:
CDeviceBase< MM::State, U > MM::State MM::Device

Public Types

typedef CStateDeviceBase< U > CStateBase
 
- Public Types inherited from CDeviceBase< MM::State, U >
typedef MM::Action< U > CPropertyAction
 
typedef MM::ActionEx< U > CPropertyActionEx
 

Public Member Functions

virtual int SetPosition (long pos)
 
virtual int SetPosition (const char *label)
 
virtual int SetGateOpen (bool open)
 
virtual int GetGateOpen (bool &open)
 
virtual int GetPosition (long &pos) const
 
virtual int GetPosition (char *label) const
 
virtual int GetPositionLabel (long pos, char *label) const
 
virtual int SetPositionLabel (long pos, const char *label)
 
virtual int GetLabelPosition (const char *label, long &pos) const
 
int OnLabel (MM::PropertyBase *pProp, MM::ActionType eAct)
 
int OnStateChanged (long position)
 
- Public Member Functions inherited from CDeviceBase< MM::State, U >
virtual HDEVMODULE GetModuleHandle () const
 
virtual void SetModuleName (const char *name)
 
virtual void GetModuleName (char *name) const
 
virtual void SetDescription (const char *descr)
 
virtual void GetDescription (char *name) const
 
virtual void SetModuleHandle (HDEVMODULE hModule)
 
virtual void SetLabel (const char *label)
 
virtual void GetLabel (char *name) const
 
virtual double GetDelayMs () const
 
virtual void SetDelayMs (double delay)
 
virtual void SetCallback (MM::Core *cbk)
 
virtual bool UsesDelay ()
 
virtual unsigned GetNumberOfProperties () const
 
virtual int GetProperty (const char *name, char *value) const
 
int GetProperty (const char *name, double &val)
 
int GetProperty (const char *name, long &val)
 
bool IsPropertyEqualTo (const char *name, const char *val) const
 
virtual int GetPropertyReadOnly (const char *name, bool &readOnly) const
 
virtual int GetPropertyInitStatus (const char *name, bool &preInit) const
 
virtual int HasPropertyLimits (const char *name, bool &hasLimits) const
 
virtual int GetPropertyLowerLimit (const char *name, double &lowLimit) const
 
virtual int GetPropertyUpperLimit (const char *name, double &hiLimit) const
 
virtual int IsPropertySequenceable (const char *name, bool &sequenceable) const
 
virtual int GetPropertySequenceMaxLength (const char *name, long &nrEvents) const
 
virtual int StartPropertySequence (const char *name)
 
virtual int StopPropertySequence (const char *name)
 
virtual int ClearPropertySequence (const char *name)
 
virtual int AddToPropertySequence (const char *name, const char *value)
 
virtual int SendPropertySequence (const char *name)
 
virtual bool GetPropertyName (unsigned uIdx, char *name) const
 
virtual int GetPropertyType (const char *name, MM::PropertyType &pt) const
 
virtual int SetProperty (const char *name, const char *value)
 
virtual bool HasProperty (const char *name) const
 
virtual unsigned GetNumberOfPropertyValues (const char *propertyName) const
 
virtual bool GetPropertyValueAt (const char *propertyName, unsigned index, char *value) const
 
int CreateProperty (const char *name, const char *value, MM::PropertyType eType, bool readOnly, MM::ActionFunctor *pAct=0, bool isPreInitProperty=false)
 
int CreatePropertyWithHandler (const char *name, const char *value, MM::PropertyType eType, bool readOnly, int(U::*memberFunction)(MM::PropertyBase *pProp, MM::ActionType eAct), bool isPreInitProperty=false)
 
int CreateIntegerProperty (const char *name, long value, bool readOnly, MM::ActionFunctor *pAct=0, bool isPreInitProperty=false)
 
int CreateFloatProperty (const char *name, double value, bool readOnly, MM::ActionFunctor *pAct=0, bool isPreInitProperty=false)
 
int CreateStringProperty (const char *name, const char *value, bool readOnly, MM::ActionFunctor *pAct=0, bool isPreInitProperty=false)
 
int SetPropertyLimits (const char *name, double low, double high)
 
int SetAllowedValues (const char *name, std::vector< std::string > &values)
 
int ClearAllowedValues (const char *name)
 
int AddAllowedValue (const char *name, const char *value)
 
int AddAllowedValue (const char *name, const char *value, long data)
 
int GetPropertyData (const char *name, const char *value, long &data)
 
int GetCurrentPropertyData (const char *name, long &data)
 
int UpdateStatus ()
 
int UpdateProperty (const char *name)
 
int ApplyProperty (const char *name)
 
virtual bool GetErrorText (int errorCode, char *text) const
 
virtual bool SupportsDeviceDetection (void)
 
virtual MM::DeviceDetectionStatus DetectDevice (void)
 
virtual void SetParentID (const char *parentId)
 
virtual void GetParentID (char *parentID) const
 
- Public Member Functions inherited from MM::State
virtual DeviceType GetType () const
 
virtual unsigned long GetNumberOfPositions () const =0
 
- Public Member Functions inherited from MM::Device
virtual bool Busy ()=0
 
 MM_DEPRECATED (virtual HDEVMODULE GetModuleHandle() const)=0
 
 MM_DEPRECATED (virtual void SetModuleHandle(HDEVMODULE hLibraryHandle))=0
 
virtual int Initialize ()=0
 
virtual int Shutdown ()=0
 
virtual void GetName (char *name) const =0
 

Additional Inherited Members

- Static Public Attributes inherited from MM::State
static const DeviceType Type = StateDevice
 
- Protected Member Functions inherited from CDeviceBase< MM::State, U >
void SetErrorText (int errorCode, const char *text)
 
const char * GetMorePropertyErrorInfo (void) const
 
void SetMorePropertyErrorInfo (const char *ptext) const
 
int LogMessage (const char *msg, bool debugOnly=false) const
 
int LogMessage (const std::string &msg, bool debugOnly=false) const
 
int LogMessageCode (const int errorCode, bool debugOnly=false) const
 
int LogTimeDiff (MM::MMTime start, MM::MMTime end, const std::string &message, bool debugOnly=false) const
 
int LogTimeDiff (MM::MMTime start, MM::MMTime end, bool debugOnly=false) const
 
void InitializeDefaultErrorMessages ()
 
MM::DeviceGetDevice (const char *deviceLabel) const
 
void GetLoadedDeviceOfType (MM::DeviceType devType, char *deviceName, const unsigned int deviceIterator)
 
int WriteToComPort (const char *portLabel, const unsigned char *buf, unsigned bufLength)
 
int SendSerialCommand (const char *portName, const char *command, const char *term)
 
int GetSerialAnswer (const char *portName, const char *term, std::string &ans)
 
int ReadFromComPort (const char *portLabel, unsigned char *buf, unsigned bufLength, unsigned long &read)
 
int PurgeComPort (const char *portLabel)
 
MM::PortType GetSerialPortType (const char *portLabel)
 
int OnPropertiesChanged ()
 
int OnPropertyChanged (const char *propName, const char *propValue)
 
int OnStagePositionChanged (double pos)
 
int OnXYStagePositionChanged (double xPos, double yPos)
 
int OnExposureChanged (double exposure)
 
int OnSLMExposureChanged (double exposure)
 
int OnMagnifierChanged ()
 
unsigned long GetClockTicksUs ()
 
MM::MMTime GetCurrentMMTime ()
 
bool IsCallbackRegistered () const
 
MM::CoreGetCoreCallback () const
 
void EnableDelay (bool state=true)
 
void CreateHubIDProperty ()
 
MM::HubGetParentHub () const
 
T_HUB * AssignToHub ()
 

Detailed Description

template<class U>
class CStateDeviceBase< U >

Base class for creating state device adapters such as filter wheels, objective, turrets, etc.

Member Function Documentation

◆ GetLabelPosition()

template<class U >
virtual int CStateDeviceBase< U >::GetLabelPosition ( const char *  label,
long &  pos 
) const
inlinevirtual

Obtains the position associated with a label.

Implements MM::State.

Referenced by CStateDeviceBase< U >::OnLabel().

◆ GetPosition() [1/2]

template<class U >
virtual int CStateDeviceBase< U >::GetPosition ( char *  label) const
inlinevirtual

Obtains the state (position) label of the device. Assumes that "State" property is implemented for the device.

Implements MM::State.

References CStateDeviceBase< U >::GetPosition(), and CStateDeviceBase< U >::GetPositionLabel().

◆ GetPosition() [2/2]

template<class U >
virtual int CStateDeviceBase< U >::GetPosition ( long &  pos) const
inlinevirtual

Obtains the state (position) index of the device. Assumes that "State" property is implemented for the device.

Implements MM::State.

References CDeviceBase< MM::State, U >::GetProperty(), and CDeviceBase< MM::State, U >::HasProperty().

Referenced by CStateDeviceBase< U >::GetPosition(), CStateDeviceBase< U >::OnLabel(), and CStateDeviceBase< U >::SetGateOpen().

◆ GetPositionLabel()

template<class U >
virtual int CStateDeviceBase< U >::GetPositionLabel ( long  pos,
char *  label 
) const
inlinevirtual

Obtains the label associated with the position (state).

Implements MM::State.

References CDeviceUtils::CopyLimitedString().

Referenced by CStateDeviceBase< U >::GetPosition(), and CStateDeviceBase< U >::OnStateChanged().

◆ OnLabel()

template<class U >
int CStateDeviceBase< U >::OnLabel ( MM::PropertyBase pProp,
MM::ActionType  eAct 
)
inline

◆ OnStateChanged()

template<class U >
int CStateDeviceBase< U >::OnStateChanged ( long  position)
inline

Signals to the core that the state has changed, so that both "State" and "Label" properties should be updated.

References CDeviceUtils::ConvertToString(), CStateDeviceBase< U >::GetPositionLabel(), and CDeviceBase< MM::State, U >::OnPropertyChanged().

◆ SetGateOpen()

template<class U >
virtual int CStateDeviceBase< U >::SetGateOpen ( bool  open)
inlinevirtual

Implements a gate, i.e. a position where the state device is closed The gate needs to be implemented in the adapter's 'OnState function (which is called through SetPosition)

Implements MM::State.

References CStateDeviceBase< U >::GetPosition(), and CStateDeviceBase< U >::SetPosition().

◆ SetPosition() [1/2]

template<class U >
virtual int CStateDeviceBase< U >::SetPosition ( const char *  label)
inlinevirtual

Sets the state (position) of the device based on the state label. Assumes that "State" property is implemented for the device.

Implements MM::State.

References CStateDeviceBase< U >::SetPosition().

◆ SetPosition() [2/2]

template<class U >
virtual int CStateDeviceBase< U >::SetPosition ( long  pos)
inlinevirtual

Sets the state (position) of the device based on the state index. Assumes that "State" property is implemented for the device.

Implements MM::State.

References CDeviceUtils::ConvertToString(), and CDeviceBase< MM::State, U >::SetProperty().

Referenced by CStateDeviceBase< U >::OnLabel(), CStateDeviceBase< U >::SetGateOpen(), and CStateDeviceBase< U >::SetPosition().

◆ SetPositionLabel()

template<class U >
virtual int CStateDeviceBase< U >::SetPositionLabel ( long  pos,
const char *  label 
)
inlinevirtual

Creates new label for the given position, or overrides the existing one.

Implements MM::State.

References CDeviceBase< MM::State, U >::SetAllowedValues().


The documentation for this class was generated from the following file: