MMDevice
Loading...
Searching...
No Matches
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

 Core ()
 
virtual ~Core ()
 
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
 Inform the UI that a property changed.
 
virtual int OnStagePositionChanged (const Device *caller, double pos)=0
 Inform the UI when a stage has changed its position.
 
virtual int OnXYStagePositionChanged (const Device *caller, double xPos, double yPos)=0
 Inform the UI when an XY stage has changed its 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 bytePerPixel, unsigned nComponents, const char *serializedMetadata=nullptr)=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 bytePerPixel, const char *serializedMetadata=nullptr)=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 int GetFocusPosition (double &pos)=0
 
virtual 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.

Constructor & Destructor Documentation

◆ Core()

MM::Core::Core ( )
inline

◆ ~Core()

virtual MM::Core::~Core ( )
inlinevirtual

Member Function Documentation

◆ AcqFinished()

virtual int MM::Core::AcqFinished ( const Device * caller,
int statusCode )
pure virtual

◆ GetClockTicksUs()

virtual unsigned long MM::Core::GetClockTicksUs ( const Device * caller)
pure virtual

◆ GetCurrentMMTime()

virtual MM::MMTime MM::Core::GetCurrentMMTime ( )
pure virtual

◆ 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.

◆ GetDeviceProperty()

virtual int MM::Core::GetDeviceProperty ( const char * deviceName,
const char * propName,
char * value )
pure virtual

◆ GetFocusPosition()

virtual int MM::Core::GetFocusPosition ( double & pos)
pure virtual

◆ 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)

◆ GetParentHub()

virtual MM::Hub * MM::Core::GetParentHub ( const MM::Device * caller) const
pure virtual

◆ GetSerialAnswer()

virtual int MM::Core::GetSerialAnswer ( const Device * caller,
const char * portName,
unsigned long ansLength,
char * answer,
const char * term )
pure virtual

◆ GetSerialPortType()

virtual MM::PortType MM::Core::GetSerialPortType ( const char * portName) const
pure virtual

◆ GetSignalIODevice()

virtual MM::SignalIO * MM::Core::GetSignalIODevice ( const MM::Device * caller,
const char * deviceName )
pure virtual

◆ 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 bytePerPixel,
const char * serializedMetadata = nullptr )
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 bytePerPixel,
unsigned nComponents,
const char * serializedMetadata = nullptr )
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.

bytesPerPixel: 1 or 2 for grayscale images; 4 or 8 for BGRx

nComponents: 1 for grayscale; 4 for BGRx (x: an unused component)

(8-byte BGRx may not be supported by the Micro-Manager GUI)

serializedMetadata: must be the result of md.Serialize() (md being an instance of MM::CameraImageMetadata) or nullptr (= no tags)

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.

◆ OnExposureChanged()

virtual int MM::Core::OnExposureChanged ( const Device * caller,
double newExposure )
pure virtual

Inform the UI when the exposure time has changed.

◆ OnMagnifierChanged()

virtual int MM::Core::OnMagnifierChanged ( const Device * caller)
pure virtual

Signal changes in magnification.

◆ OnPropertiesChanged()

virtual int MM::Core::OnPropertiesChanged ( const Device * caller)
pure virtual

◆ OnPropertyChanged()

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

Inform 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.

◆ OnShutterOpenChanged()

virtual int MM::Core::OnShutterOpenChanged ( const Device * caller,
bool open )
pure virtual

Signal that the shutter opened or closed.

◆ OnSLMExposureChanged()

virtual int MM::Core::OnSLMExposureChanged ( const Device * caller,
double newExposure )
pure virtual

Inform the UI when the SLM exposure time has changed.

◆ OnStagePositionChanged()

virtual int MM::Core::OnStagePositionChanged ( const Device * caller,
double pos )
pure virtual

Inform the UI when a stage has changed its position.

See also
CDeviceBase::OnStagePositionChanged().

◆ OnXYStagePositionChanged()

virtual int MM::Core::OnXYStagePositionChanged ( const Device * caller,
double xPos,
double yPos )
pure virtual

Inform the UI when an XY stage has changed its position.

See also
CDeviceBase::OnXYStagePositionChanged()

◆ PrepareForAcq()

virtual int MM::Core::PrepareForAcq ( const Device * caller)
pure virtual

◆ PurgeSerial()

virtual int MM::Core::PurgeSerial ( const Device * caller,
const char * portName )
pure virtual

◆ ReadFromSerial()

virtual int MM::Core::ReadFromSerial ( const Device * caller,
const char * port,
unsigned char * buf,
unsigned long length,
unsigned long & read )
pure virtual

◆ SetDeviceProperty()

virtual int MM::Core::SetDeviceProperty ( const char * deviceName,
const char * propName,
const char * value )
pure virtual

◆ SetSerialCommand()

virtual int MM::Core::SetSerialCommand ( const Device * caller,
const char * portName,
const char * command,
const char * term )
pure virtual

◆ SetSerialProperties()

virtual int MM::Core::SetSerialProperties ( const char * portName,
const char * answerTimeout,
const char * baudRate,
const char * delayBetweenCharsMs,
const char * handshaking,
const char * parity,
const char * stopBits )
pure virtual

◆ WriteToSerial()

virtual int MM::Core::WriteToSerial ( const Device * caller,
const char * port,
const unsigned char * buf,
unsigned long length )
pure virtual

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