MMDevice 70
Public Member Functions | List of all members
MM::Core Class Referenceabstract

Callback API to the core control module. More...

#include <MMDevice.h>

Public Member Functions

virtual int LogMessage (const Device *caller, const char *msg, bool debugOnly) const =0
 Log a message (msg) in the Corelog output, labeled with the device name (derived from caller).
 
virtual DeviceGetDevice (const Device *caller, const char *label)=0
 Get a pointer to another device.
 
virtual int GetDeviceProperty (const char *deviceName, const char *propName, char *value)=0
 
virtual int SetDeviceProperty (const char *deviceName, const char *propName, const char *value)=0
 
virtual void GetLoadedDeviceOfType (const Device *caller, MM::DeviceType devType, char *pDeviceName, const unsigned int deviceIterator)=0
 Get the names of currently loaded devices of a given type.
 
virtual int SetSerialProperties (const char *portName, const char *answerTimeout, const char *baudRate, const char *delayBetweenCharsMs, const char *handshaking, const char *parity, const char *stopBits)=0
 
virtual int SetSerialCommand (const Device *caller, const char *portName, const char *command, const char *term)=0
 
virtual int GetSerialAnswer (const Device *caller, const char *portName, unsigned long ansLength, char *answer, const char *term)=0
 
virtual int WriteToSerial (const Device *caller, const char *port, const unsigned char *buf, unsigned long length)=0
 
virtual int ReadFromSerial (const Device *caller, const char *port, unsigned char *buf, unsigned long length, unsigned long &read)=0
 
virtual int PurgeSerial (const Device *caller, const char *portName)=0
 
virtual MM::PortType GetSerialPortType (const char *portName) const =0
 
virtual int OnPropertiesChanged (const Device *caller)=0
 
virtual int OnPropertyChanged (const Device *caller, const char *propName, const char *propValue)=0
 Signal the UI that a property changed.
 
virtual int OnStagePositionChanged (const Device *caller, double pos)=0
 Signal the UI when the stage has reached a new position.
 
virtual int OnXYStagePositionChanged (const Device *caller, double xPos, double yPos)=0
 Signal the UI when the XY stage has reached a new position.
 
virtual int OnExposureChanged (const Device *caller, double newExposure)=0
 Inform the UI when the exposure time has changed.
 
virtual int OnSLMExposureChanged (const Device *caller, double newExposure)=0
 Inform the UI when the SLM exposure time has changed.
 
virtual int OnMagnifierChanged (const Device *caller)=0
 Signal changes in magnification.
 
virtual int OnShutterOpenChanged (const Device *caller, bool open)=0
 Signal that the shutter opened or closed.
 
virtual unsigned long GetClockTicksUs (const Device *caller)=0
 
virtual MM::MMTime GetCurrentMMTime ()=0
 
virtual int AcqFinished (const Device *caller, int statusCode)=0
 
virtual int PrepareForAcq (const Device *caller)=0
 
virtual int InsertImage (const Device *caller, const unsigned char *buf, unsigned width, unsigned height, unsigned byteDepth, unsigned nComponents, const char *serializedMetadata, const bool doProcess=true)=0
 Send a frame to the Core during sequence acquisition.
 
virtual int InsertImage (const Device *caller, const unsigned char *buf, unsigned width, unsigned height, unsigned byteDepth, const char *serializedMetadata=nullptr, const bool doProcess=true)=0
 Send a grayscale frame to the Core during sequence acquisition.
 
virtual bool InitializeImageBuffer (unsigned channels, unsigned slices, unsigned int w, unsigned int h, unsigned int pixDepth)=0
 Prepare the sequence buffer for the given image size and pixel format.
 
virtual MMDEVICE_DEPRECATED int GetFocusPosition (double &pos)=0
 
virtual MMDEVICE_DEPRECATED MM::SignalIOGetSignalIODevice (const MM::Device *caller, const char *deviceName)=0
 
virtual MM::HubGetParentHub (const MM::Device *caller) const =0
 

Detailed Description

Callback API to the core control module.

Devices use this abstract interface to use Core services.

Member Function Documentation

◆ GetDevice()

virtual Device * MM::Core::GetDevice ( const Device caller,
const char *  label 
)
pure virtual

Get a pointer to another device.

Be aware of potential threading issues. Provide a valid label for the device and receive a pointer to the desired device.

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

◆ GetLoadedDeviceOfType()

virtual void MM::Core::GetLoadedDeviceOfType ( const Device caller,
MM::DeviceType  devType,
char *  pDeviceName,
const unsigned int  deviceIterator 
)
pure virtual

Get the names of currently loaded devices of a given type.

If deviceIterator exceeds or is equal to the number of currently loaded devices of type devType, an empty string is returned.

Parameters
callerthe calling device
devTypethe device type
pDeviceNamebuffer in which device name will be returned
deviceIteratorindex of device (within the given type)

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

◆ InitializeImageBuffer()

virtual bool MM::Core::InitializeImageBuffer ( unsigned  channels,
unsigned  slices,
unsigned int  w,
unsigned int  h,
unsigned int  pixDepth 
)
pure virtual

Prepare the sequence buffer for the given image size and pixel format.

Cameras normally do not need to call this explicitly. 'channels' is ignored (should be 1) and 'slices' must be 1.

◆ InsertImage() [1/2]

virtual int MM::Core::InsertImage ( const Device caller,
const unsigned char *  buf,
unsigned  width,
unsigned  height,
unsigned  byteDepth,
const char *  serializedMetadata = nullptr,
const bool  doProcess = true 
)
pure virtual

Send a grayscale frame to the Core during sequence acquisition.

Same as the overload with the added nComponents parameter. Assumes nComponents == 1 (grayscale).

◆ InsertImage() [2/2]

virtual int MM::Core::InsertImage ( const Device caller,
const unsigned char *  buf,
unsigned  width,
unsigned  height,
unsigned  byteDepth,
unsigned  nComponents,
const char *  serializedMetadata,
const bool  doProcess = true 
)
pure virtual

Send a frame to the Core during sequence acquisition.

Cameras must call this function during sequence acquisition to send each frame to the Core.

byteDepth: 1 or 2 for grayscale images; 4 for BGR_

nComponents: 1 for grayscale; 4 for BGR_ (_: unused component)

serializedMetadata: must be the result of md.serialize().c_str() (md being an instance of Metadata)

doProcess: must be true, except for the case mentioned below

Legacy note: Previously, cameras were required to perform special handling when InsertImage() returns DEVICE_BUFFER_OVERFLOW and stopOnOverflow == false. However, InsertImage() no longer ever returns that particular error when stopOnOverflow == false. So cameras should always just stop the acquisition if InsertImage() returns any error.

◆ LogMessage()

virtual int MM::Core::LogMessage ( const Device caller,
const char *  msg,
bool  debugOnly 
) const
pure virtual

Log a message (msg) in the Corelog output, labeled with the device name (derived from caller).

If debugOnly flag is true, the output will only be logged if the general system has been set to output debug logging.

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

◆ OnPropertyChanged()

virtual int MM::Core::OnPropertyChanged ( const Device caller,
const char *  propName,
const char *  propValue 
)
pure virtual

Signal the UI that a property changed.

The Core will check if groups or pixel size changed as a consequence of the change of this property and inform the UI.

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


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