MMDevice  70
Public Types | Public Member Functions | Protected Member Functions | List of all members
CDeviceBase< T, U > Class Template Reference

#include <DeviceBase.h>

Inheritance diagram for CDeviceBase< T, U >:

Public Types

typedef MM::Action< U > CPropertyAction
 
typedef MM::ActionEx< U > CPropertyActionEx
 

Public Member Functions

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
 

Protected Member Functions

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
 
template<class T_HUB >
T_HUB * AssignToHub ()
 

Detailed Description

template<class T, class U>
class CDeviceBase< T, U >

Implements functionality common to all devices. Typically used as the base class for actual device adapters. In general, derived class do not override DeviceBase methods, but rather take advantage of using them to simplify development of specific drivers.

Member Function Documentation

◆ AddAllowedValue() [1/2]

template<class T , class U >
int CDeviceBase< T, U >::AddAllowedValue ( const char *  name,
const char *  value 
)
inline

Add a single allowed value.

◆ AddAllowedValue() [2/2]

template<class T , class U >
int CDeviceBase< T, U >::AddAllowedValue ( const char *  name,
const char *  value,
long  data 
)
inline

Add a single allowed value, plus an additional data.

◆ AddToPropertySequence()

template<class T , class U >
virtual int CDeviceBase< T, U >::AddToPropertySequence ( const char *  name,
const char *  value 
)
inlinevirtual

This function is used by the Core to communicate a sequence to the device

Parameters
name- name of the sequenceable property

◆ ApplyProperty()

template<class T , class U >
int CDeviceBase< T, U >::ApplyProperty ( const char *  name)
inline

Apply the current property value to the hardware.

◆ AssignToHub()

template<class T , class U >
template<class T_HUB >
T_HUB* CDeviceBase< T, U >::AssignToHub ( )
inlineprotected

Returns the parent Hub device pointer, or null if there isn't any. Makes sure the Parent ID has been assigned.

References CDeviceBase< T, U >::GetParentHub(), and CDeviceBase< T, U >::LogMessage().

◆ ClearAllowedValues()

template<class T , class U >
int CDeviceBase< T, U >::ClearAllowedValues ( const char *  name)
inline

Clears allowed values, and makes any value valid.

◆ ClearPropertySequence()

template<class T , class U >
virtual int CDeviceBase< T, U >::ClearPropertySequence ( const char *  name)
inlinevirtual

This function is used by the Core to communicate a sequence to the device

Parameters
name- name of the sequenceable property

◆ CreateFloatProperty()

template<class T , class U >
int CDeviceBase< T, U >::CreateFloatProperty ( const char *  name,
double  value,
bool  readOnly,
MM::ActionFunctor pAct = 0,
bool  isPreInitProperty = false 
)
inline

Create a float-valued property for the device

References CDeviceBase< T, U >::CreateProperty().

◆ CreateHubIDProperty()

template<class T , class U >
void CDeviceBase< T, U >::CreateHubIDProperty ( )
inlineprotected

Utility method to create read-only property displaying parentID (hub label). By looking at this HubID property we can see which hub this peripheral belongs to. Can be called anywhere in the device code, but the most logical place is the constructor. Use is optional, to provide useful info.

References CDeviceBase< T, U >::CreateProperty().

◆ CreateIntegerProperty()

template<class T , class U >
int CDeviceBase< T, U >::CreateIntegerProperty ( const char *  name,
long  value,
bool  readOnly,
MM::ActionFunctor pAct = 0,
bool  isPreInitProperty = false 
)
inline

Create an integer-valued property for the device

References CDeviceBase< T, U >::CreateProperty().

◆ CreateProperty()

template<class T , class U >
int CDeviceBase< T, U >::CreateProperty ( const char *  name,
const char *  value,
MM::PropertyType  eType,
bool  readOnly,
MM::ActionFunctor pAct = 0,
bool  isPreInitProperty = false 
)
inline

Creates a new property for the device.

Parameters
name- property name
value- initial value
eType- property type (string, integer or float)
readOnly- is the property read-only or not
pAct- function object called on the property actions
isPreInitProperty- whether to create a "pre-init" property, whose value will be available before Initialize() is called

Referenced by CDeviceBase< T, U >::CreateFloatProperty(), CDeviceBase< T, U >::CreateHubIDProperty(), CDeviceBase< T, U >::CreateIntegerProperty(), CDeviceBase< T, U >::CreatePropertyWithHandler(), and CDeviceBase< T, U >::CreateStringProperty().

◆ CreatePropertyWithHandler()

template<class T , class U >
int CDeviceBase< T, U >::CreatePropertyWithHandler ( const char *  name,
const char *  value,
MM::PropertyType  eType,
bool  readOnly,
int(U::*)(MM::PropertyBase *pProp, MM::ActionType eAct)  memberFunction,
bool  isPreInitProperty = false 
)
inline

Creates a new property for the device.

Parameters
name- property name
value- initial value
eType- property type (string, integer or float)
readOnly- is the property read-only or not
memberFunction- Function pointer to the device object "OnProperty" member function, e.g. &MyDevice::OnState
isPreInitProperty- whether to create a "pre-init" property, whose value will be available before Initialize() is called

References CDeviceBase< T, U >::CreateProperty().

◆ CreateStringProperty()

template<class T , class U >
int CDeviceBase< T, U >::CreateStringProperty ( const char *  name,
const char *  value,
bool  readOnly,
MM::ActionFunctor pAct = 0,
bool  isPreInitProperty = false 
)
inline

Create a string-valued property for the device

References CDeviceBase< T, U >::CreateProperty().

◆ EnableDelay()

template<class T , class U >
void CDeviceBase< T, U >::EnableDelay ( bool  state = true)
inlineprotected

If this flag is set the device signals to the rest of the system that it will respond to delay settings.

◆ GetClockTicksUs()

template<class T , class U >
unsigned long CDeviceBase< T, U >::GetClockTicksUs ( )
inlineprotected

Gets the system ticks in microseconds. OBSOLETE, use GetCurrentTime()

◆ GetCoreCallback()

template<class T , class U >
MM::Core* CDeviceBase< T, U >::GetCoreCallback ( ) const
inlineprotected

Get the callback object.

Referenced by CDeviceBase< T, U >::GetParentHub().

◆ GetCurrentMMTime()

template<class T , class U >
MM::MMTime CDeviceBase< T, U >::GetCurrentMMTime ( )
inlineprotected

Gets current time.

◆ GetCurrentPropertyData()

template<class T , class U >
int CDeviceBase< T, U >::GetCurrentPropertyData ( const char *  name,
long &  data 
)
inline

Obtains data field associated with the currently applied property value.

◆ GetDelayMs()

template<class T , class U >
virtual double CDeviceBase< T, U >::GetDelayMs ( ) const
inlinevirtual

Returns device delay used for synchronization by the calling code. Delay of 0 means that the device should be synchronized by polling with the Busy() method.

◆ GetDescription()

template<class T , class U >
virtual void CDeviceBase< T, U >::GetDescription ( char *  name) const
inlinevirtual

Returns device description (for use only by the calling code).

References CDeviceUtils::CopyLimitedString().

◆ GetDevice()

template<class T , class U >
MM::Device* CDeviceBase< T, U >::GetDevice ( const char *  deviceLabel) const
inlineprotected

Gets the handle (pointer) to the specified device label. With this method we can get a handle to other devices loaded in the system, if we know the device name.

References MM::Core::GetDevice().

◆ GetErrorText()

template<class T , class U >
virtual bool CDeviceBase< T, U >::GetErrorText ( int  errorCode,
char *  text 
) const
inlinevirtual

Obtains the error text associated with the error code.

References CDeviceUtils::CopyLimitedString().

Referenced by CDeviceBase< T, U >::LogMessageCode().

◆ GetLabel()

template<class T , class U >
virtual void CDeviceBase< T, U >::GetLabel ( char *  name) const
inlinevirtual

Returns the device label (for use only by the calling code). Labels are usually manipulated by the parent application and used for high-level programming.

References CDeviceUtils::CopyLimitedString().

◆ GetLoadedDeviceOfType()

template<class T , class U >
void CDeviceBase< T, U >::GetLoadedDeviceOfType ( MM::DeviceType  devType,
char *  deviceName,
const unsigned int  deviceIterator 
)
inlineprotected

Provides access to the names of devices of a given type deviceIterator determines which device in the list of devices of the given type will become accessible in deviceName. If deviceIterator exceeds the number of devices of the given type, no action will be taked (i.e., the memory pointed to by deviceName will be unchanged).

References MM::Core::GetLoadedDeviceOfType().

◆ GetModuleHandle()

template<class T , class U >
virtual HDEVMODULE CDeviceBase< T, U >::GetModuleHandle ( ) const
inlinevirtual

Returns the library handle (for use only by the calling code).

◆ GetModuleName()

template<class T , class U >
virtual void CDeviceBase< T, U >::GetModuleName ( char *  name) const
inlinevirtual

Returns the module name (for use only by the calling code).

References CDeviceUtils::CopyLimitedString().

◆ GetNumberOfProperties()

template<class T , class U >
virtual unsigned CDeviceBase< T, U >::GetNumberOfProperties ( ) const
inlinevirtual

Returns the number of properties.

◆ GetNumberOfPropertyValues()

template<class T , class U >
virtual unsigned CDeviceBase< T, U >::GetNumberOfPropertyValues ( const char *  propertyName) const
inlinevirtual

Returns the number of allowed property values. If the set of property values is not defined, not bounded, or property does not exist, the call returns 0.

◆ GetParentHub()

template<class T , class U >
MM::Hub* CDeviceBase< T, U >::GetParentHub ( ) const
inlineprotected

Returns the parent Hub device pointer, or null if there isn't any. GetParentHub() call Makes sure that the hub pointer belongs to a class from the same module (device library). This is to avoid using dynamic_cast<> which won't work for Linux.

References CDeviceBase< T, U >::GetCoreCallback(), and CDeviceBase< T, U >::IsCallbackRegistered().

Referenced by CDeviceBase< T, U >::AssignToHub().

◆ GetProperty() [1/3]

template<class T , class U >
virtual int CDeviceBase< T, U >::GetProperty ( const char *  name,
char *  value 
) const
inlinevirtual

Obtains the value of the property.

Parameters
name- property identifier (name)
value- the value of the property

References CDeviceUtils::CopyLimitedString().

◆ GetProperty() [2/3]

template<class T , class U >
int CDeviceBase< T, U >::GetProperty ( const char *  name,
double &  val 
)
inline

Obtains the value of the property.

Parameters
name- property identifier (name)
value- the value of the property

◆ GetProperty() [3/3]

template<class T , class U >
int CDeviceBase< T, U >::GetProperty ( const char *  name,
long &  val 
)
inline

Obtains the value of the property.

Parameters
name- property identifier (name)
value- the value of the property

◆ GetPropertyData()

template<class T , class U >
int CDeviceBase< T, U >::GetPropertyData ( const char *  name,
const char *  value,
long &  data 
)
inline

Obtains data field associated with the allowed property value.

◆ GetPropertyInitStatus()

template<class T , class U >
virtual int CDeviceBase< T, U >::GetPropertyInitStatus ( const char *  name,
bool &  preInit 
) const
inlinevirtual

Checks whether the property is read-only.

Parameters
name- property identifier (name)
readOnly- read-only or not

◆ GetPropertyLowerLimit()

template<class T , class U >
virtual int CDeviceBase< T, U >::GetPropertyLowerLimit ( const char *  name,
double &  lowLimit 
) const
inlinevirtual

Provides lower limit for a property that has property limits

Parameters
name- property identifier (name)
lowLimit- returns lower limit

◆ GetPropertyName()

template<class T , class U >
virtual bool CDeviceBase< T, U >::GetPropertyName ( unsigned  uIdx,
char *  name 
) const
inlinevirtual

Obtains the property name given the index. Can be used for enumerating properties.

Parameters
uIdx- property index
name- property name

References CDeviceUtils::CopyLimitedString().

◆ GetPropertyReadOnly()

template<class T , class U >
virtual int CDeviceBase< T, U >::GetPropertyReadOnly ( const char *  name,
bool &  readOnly 
) const
inlinevirtual

Checks whether the property is read-only.

Parameters
name- property identifier (name)
readOnly- read-only or not

◆ GetPropertySequenceMaxLength()

template<class T , class U >
virtual int CDeviceBase< T, U >::GetPropertySequenceMaxLength ( const char *  name,
long &  nrEvents 
) const
inlinevirtual

Provides the maximum number of events that can be executed by this sequenceable property

Parameters
name- property identifier (name)
nrEvents- maximum number of events that can be handles by the device

References CDeviceBase< T, U >::IsPropertySequenceable().

◆ GetPropertyType()

template<class T , class U >
virtual int CDeviceBase< T, U >::GetPropertyType ( const char *  name,
MM::PropertyType &  pt 
) const
inlinevirtual

Obtain property type (string, float or integer)

◆ GetPropertyUpperLimit()

template<class T , class U >
virtual int CDeviceBase< T, U >::GetPropertyUpperLimit ( const char *  name,
double &  hiLimit 
) const
inlinevirtual

Provides upper limit for a property that has property limits

Parameters
name- property identifier (name)
hiLimit- returns upper limit

◆ GetPropertyValueAt()

template<class T , class U >
virtual bool CDeviceBase< T, U >::GetPropertyValueAt ( const char *  propertyName,
unsigned  index,
char *  value 
) const
inlinevirtual

Returns the allowed value of the property, given its index. Intended for enumerating allowed property values.

Parameters
propertyName
index
value

References CDeviceUtils::CopyLimitedString().

◆ GetSerialAnswer()

template<class T , class U >
int CDeviceBase< T, U >::GetSerialAnswer ( const char *  portName,
const char *  term,
std::string &  ans 
)
inlineprotected

Gets the received string from the serial port, waiting for the terminating character sequence.

Parameters
portName
term- terminating string, e.g. CR or CR,LF, or something else
ans- answer string without the terminating characters

◆ GetSerialPortType()

template<class T , class U >
MM::PortType CDeviceBase< T, U >::GetSerialPortType ( const char *  portLabel)
inlineprotected

Not to be confused with MM::PortType MM::Serial::GetPortType() const.

◆ HasProperty()

template<class T , class U >
virtual bool CDeviceBase< T, U >::HasProperty ( const char *  name) const
inlinevirtual

Checks if device supports a given property.

◆ InitializeDefaultErrorMessages()

template<class T , class U >
void CDeviceBase< T, U >::InitializeDefaultErrorMessages ( )
inlineprotected

Sets-up the standard set of error codes and error messages.

References CDeviceBase< T, U >::SetErrorText().

◆ IsCallbackRegistered()

template<class T , class U >
bool CDeviceBase< T, U >::IsCallbackRegistered ( ) const
inlineprotected

Check if we have callback mechanism set up.

Referenced by CDeviceBase< T, U >::GetParentHub().

◆ IsPropertyEqualTo()

template<class T , class U >
bool CDeviceBase< T, U >::IsPropertyEqualTo ( const char *  name,
const char *  val 
) const
inline

Check if the property value is equal to a specific string

Returns
true only if property exists and is equal to, false otherwise
Parameters
name- property identifier (name)
value- the value to compare to

◆ IsPropertySequenceable()

template<class T , class U >
virtual int CDeviceBase< T, U >::IsPropertySequenceable ( const char *  name,
bool &  sequenceable 
) const
inlinevirtual

Checks whether the property can be run in a sequence

Parameters
name- property identifier (name)
sequenceable- sequenceable or not

Referenced by CDeviceBase< T, U >::GetPropertySequenceMaxLength(), CDeviceBase< T, U >::StartPropertySequence(), and CDeviceBase< T, U >::StopPropertySequence().

◆ LogMessage() [1/2]

template<class T , class U >
int CDeviceBase< T, U >::LogMessage ( const char *  msg,
bool  debugOnly = false 
) const
inlineprotected

Output the specified text message to the log stream.

Parameters
msg- message text
debugOnly- if true the message will be sent only in the log-debug mode

References MM::Core::LogMessage().

Referenced by CDeviceBase< T, U >::AssignToHub(), and CDeviceBase< T, U >::SetPropertyLimits().

◆ LogMessage() [2/2]

template<class T , class U >
int CDeviceBase< T, U >::LogMessage ( const std::string &  msg,
bool  debugOnly = false 
) const
inlineprotected

Output the specified text message to the log stream.

Parameters
msg- message text
debugOnly- if true the message will be sent only in the log-debug mode

References MM::Core::LogMessage().

◆ LogMessageCode()

template<class T , class U >
int CDeviceBase< T, U >::LogMessageCode ( const int  errorCode,
bool  debugOnly = false 
) const
inlineprotected

Output the text message of specified code to the log stream.

Parameters
errorCode- error code
debugOnly- if true the message will be sent only in the log-debug mode

References CDeviceBase< T, U >::GetErrorText(), and MM::Core::LogMessage().

◆ LogTimeDiff() [1/2]

template<class T , class U >
int CDeviceBase< T, U >::LogTimeDiff ( MM::MMTime  start,
MM::MMTime  end,
bool  debugOnly = false 
) const
inlineprotected

Outputs time difference between two time stamps. Handy for hardware profiling

Parameters
start- Time stamp for start of Process
end- Time stamp for end of Process
debugOnly- if true the message will be sent only in the log-debug mode

References CDeviceBase< T, U >::LogTimeDiff().

◆ LogTimeDiff() [2/2]

template<class T , class U >
int CDeviceBase< T, U >::LogTimeDiff ( MM::MMTime  start,
MM::MMTime  end,
const std::string &  message,
bool  debugOnly = false 
) const
inlineprotected

Outputs time difference between two time stamps. Handy for hardware profiling

Parameters
start- Time stamp for start of Process
end- Time stamp for end of Process
message- message that will be displayed in output
debugOnly- if true the message will be sent only in the log-debug mode

References MM::Core::LogMessage().

Referenced by CDeviceBase< T, U >::LogTimeDiff().

◆ OnPropertiesChanged()

template<class T , class U >
int CDeviceBase< T, U >::OnPropertiesChanged ( )
inlineprotected

Something changed in the property structure. Signals the need for GUI update. This function should be called only after the initialize function finished. Calling it in the constructor or in the Initialize function will cause other device adapters to be called before they are initialized.

◆ OnPropertyChanged()

template<class T , class U >
int CDeviceBase< T, U >::OnPropertyChanged ( const char *  propName,
const char *  propValue 
)
inlineprotected

Signals to the core that a property value has changed.

References MM::Core::OnPropertyChanged().

◆ PurgeComPort()

template<class T , class U >
int CDeviceBase< T, U >::PurgeComPort ( const char *  portLabel)
inlineprotected

Clears the serial port buffers

◆ ReadFromComPort()

template<class T , class U >
int CDeviceBase< T, U >::ReadFromComPort ( const char *  portLabel,
unsigned char *  buf,
unsigned  bufLength,
unsigned long &  read 
)
inlineprotected

Reads the current contents of Rx serial buffer.

◆ SendPropertySequence()

template<class T , class U >
virtual int CDeviceBase< T, U >::SendPropertySequence ( const char *  name)
inlinevirtual

This function is used by the Core to communicate a sequence to the device Sends the sequence to the device by calling the properties functor

Parameters
name- name of the sequenceable property

◆ SendSerialCommand()

template<class T , class U >
int CDeviceBase< T, U >::SendSerialCommand ( const char *  portName,
const char *  command,
const char *  term 
)
inlineprotected

Sends an ASCII string withe the specified terminating characters to the serial port.

Parameters
portName
command- command string
term- terminating string, e.g. CR or CR,LF, or something else

◆ SetAllowedValues()

template<class T , class U >
int CDeviceBase< T, U >::SetAllowedValues ( const char *  name,
std::vector< std::string > &  values 
)
inline

Sets an entire array of allowed values.

◆ SetCallback()

template<class T , class U >
virtual void CDeviceBase< T, U >::SetCallback ( MM::Core cbk)
inlinevirtual

Sets the callback for accessing parent functionality (used only by the calling code).

◆ SetDelayMs()

template<class T , class U >
virtual void CDeviceBase< T, U >::SetDelayMs ( double  delay)
inlinevirtual

Returns the device delay used for synchronization by the calling code. Delay of 0 means that the device should be synchronized by polling with the Busy() method.

◆ SetDescription()

template<class T , class U >
virtual void CDeviceBase< T, U >::SetDescription ( const char *  descr)
inlinevirtual

Assigns description string for a device (for use only by the calling code).

◆ SetErrorText()

template<class T , class U >
void CDeviceBase< T, U >::SetErrorText ( int  errorCode,
const char *  text 
)
inlineprotected

Defines the error text associated with the code.

Referenced by CDeviceBase< T, U >::InitializeDefaultErrorMessages().

◆ SetLabel()

template<class T , class U >
virtual void CDeviceBase< T, U >::SetLabel ( const char *  label)
inlinevirtual

Sets the device label (for use only by the calling code). Labels are usually manipulated by the parent application and used for high-level programming.

◆ SetModuleHandle()

template<class T , class U >
virtual void CDeviceBase< T, U >::SetModuleHandle ( HDEVMODULE  hModule)
inlinevirtual

Sets the library handle (for use only by the calling code).

◆ SetModuleName()

template<class T , class U >
virtual void CDeviceBase< T, U >::SetModuleName ( const char *  name)
inlinevirtual

Assigns a name for the module (for use only by the calling code).

◆ SetProperty()

template<class T , class U >
virtual int CDeviceBase< T, U >::SetProperty ( const char *  name,
const char *  value 
)
inlinevirtual

Sets the property value.

Parameters
name- property name
value- property value

◆ SetPropertyLimits()

template<class T , class U >
int CDeviceBase< T, U >::SetPropertyLimits ( const char *  name,
double  low,
double  high 
)
inline

Define limits for properties with continuous range of values

References CDeviceBase< T, U >::LogMessage().

◆ StartPropertySequence()

template<class T , class U >
virtual int CDeviceBase< T, U >::StartPropertySequence ( const char *  name)
inlinevirtual

Starts a (TTL-triggered) sequence for the given property Should be overridden by the device adapter (when a sequence is implemented)

Parameters
name- property for which the sequence should be started

References CDeviceBase< T, U >::IsPropertySequenceable().

◆ StopPropertySequence()

template<class T , class U >
virtual int CDeviceBase< T, U >::StopPropertySequence ( const char *  name)
inlinevirtual

Stops a (TTL-triggered) sequence for the given property Should be overridden by the device adapter (when a sequence is implemented)

Parameters
name- property for which the sequence should be started

References CDeviceBase< T, U >::IsPropertySequenceable().

◆ UpdateProperty()

template<class T , class U >
int CDeviceBase< T, U >::UpdateProperty ( const char *  name)
inline

Update property value from the hardware.

◆ UpdateStatus()

template<class T , class U >
int CDeviceBase< T, U >::UpdateStatus ( )
inline

Refresh the entire state of the device and synchronize property values with the actual state of the hardware.

◆ UsesDelay()

template<class T , class U >
virtual bool CDeviceBase< T, U >::UsesDelay ( )
inlinevirtual

Signals if the device responds to different delay settings. Default device behavior is to ignore delays and use busy signals instead.

◆ WriteToComPort()

template<class T , class U >
int CDeviceBase< T, U >::WriteToComPort ( const char *  portLabel,
const unsigned char *  buf,
unsigned  bufLength 
)
inlineprotected

Sends an array of bytes to the com port.


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