MMDevice
Loading...
Searching...
No Matches
MMDevice.h
Go to the documentation of this file.
1
2// FILE: MMDevice.h
3// PROJECT: Micro-Manager
4// SUBSYSTEM: MMDevice - Device adapter kit
5//-----------------------------------------------------------------------------
6// DESCRIPTION: The interface to the Micro-Manager devices. Defines the
7// plugin API for all devices.
8//
9// AUTHOR: Nenad Amodaj, nenad@amodaj.com, 06/08/2005
10//
11// COPYRIGHT: University of California, San Francisco, 2006-2014
12// 100X Imaging Inc, 2008
13//
14// LICENSE: This file is distributed under the BSD license.
15// License text is included with the source distribution.
16//
17// This file is distributed in the hope that it will be useful,
18// but WITHOUT ANY WARRANTY; without even the implied warranty
19// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20//
21// IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES.
24
25#pragma once
26
27// Device Interface Version — see README.md for the full versioning policy.
28// Must be incremented for any binary-incompatible change.
29#define DEVICE_INTERFACE_VERSION 75
30
31// N.B. Method parameters and return values in Device and its derived
32// classes must be POD types or pointers (no std::string, etc.) to
33// maintain binary compatibility across compilers and runtimes.
34
35#include "MMDeviceConstants.h"
36#include "DeviceUtils.h"
37#include "DeviceThreads.h"
38
39#include <climits>
40#include <cstdlib>
41#include <cstring>
42#include <iomanip>
43#include <sstream>
44#include <string>
45#include <vector>
46
47
48namespace MM {
49
50 // forward declaration for the MMCore callback class
51 class Core;
52
57 class MMTime
58 {
59 long long microseconds_;
60
61 public:
62 MMTime() : microseconds_(0LL) {}
63
64 explicit MMTime(double uSecTotal) :
65 microseconds_(static_cast<long long>(uSecTotal))
66 {}
67
68 explicit MMTime(long sec, long uSec) :
69 microseconds_(sec * 1'000'000LL + uSec)
70 {}
71
72 static MMTime fromUs(long long us)
73 {
74 // Work around our lack of a constructor that directly sets the
75 // internal representation.
76 // (Note that we cannot add a constructor from 'long long' because
77 // many existing uses would then get an error (ambiguous with the
78 // 'double' overload).)
79 MMTime ret;
80 ret.microseconds_ = us;
81 return ret;
82 }
83
84 static MMTime fromMs(double ms)
85 {
86 return MMTime(ms * 1000.0);
87 }
88
89 static MMTime fromSeconds(long secs)
90 {
91 return MMTime(secs, 0);
92 }
93
94 MMTime operator+(const MMTime &other) const
95 {
96 return fromUs(microseconds_ + other.microseconds_);
97 }
98
99 MMTime operator-(const MMTime &other) const
100 {
101 return fromUs(microseconds_ - other.microseconds_);
102 }
103
104 bool operator>(const MMTime &other) const
105 {
106 return microseconds_ > other.microseconds_;
107 }
108
109 bool operator>=(const MMTime &other) const
110 {
111 return microseconds_ >= other.microseconds_;
112 }
113
114 bool operator<(const MMTime &other) const
115 {
116 return microseconds_ < other.microseconds_;
117 }
118
119 bool operator<=(const MMTime &other) const
120 {
121 return microseconds_ <= other.microseconds_;
122 }
123
124 bool operator==(const MMTime &other) const
125 {
126 return microseconds_ == other.microseconds_;
127 }
128
129 bool operator!=(const MMTime &other) const
130 {
131 return !(*this == other);
132 }
133
134 double getMsec() const
135 {
136 return microseconds_ / 1000.0;
137 }
138
139 double getUsec() const
140 {
141 return static_cast<double>(microseconds_);
142 }
143
144 std::string toString() const {
145 long long absUs = std::abs(microseconds_);
146 long long seconds = absUs / 1'000'000LL;
147 long long fracUs = absUs - seconds * 1'000'000LL;
148 const char *sign = microseconds_ < 0 ? "-" : "";
149
150 using namespace std;
151 ostringstream s;
152 s << sign << seconds << '.' <<
153 setfill('0') << right << setw(6) << fracUs;
154 return s.str();
155 }
156 };
157
158
163 {
164 public:
165 // arguments: MMTime start time, millisecond interval time
166 explicit TimeoutMs(const MMTime startTime, const unsigned long intervalMs) :
167 startTime_(startTime),
168 interval_(0, 1000*intervalMs)
169 {
170 }
171 explicit TimeoutMs(const MMTime startTime, const MMTime interval) :
172 startTime_(startTime),
173 interval_(interval)
174 {
175 }
176
177 bool expired(const MMTime tnow)
178 {
179 MMTime elapsed = tnow - startTime_;
180 return ( interval_ < elapsed );
181 }
182
183 private:
184 MMTime startTime_; // start time
185 MMTime interval_; // interval in milliseconds
186 };
187
188
192 class Device {
193 public:
195 virtual ~Device() {}
196
197 virtual unsigned GetNumberOfProperties() const = 0;
198 virtual int GetProperty(const char* name, char* value) const = 0;
199 virtual int SetProperty(const char* name, const char* value) = 0;
200 virtual bool HasProperty(const char* name) const = 0;
201 virtual bool GetPropertyName(unsigned idx, char* name) const = 0;
202 virtual int GetPropertyReadOnly(const char* name, bool& readOnly) const = 0;
203 virtual int GetPropertyInitStatus(const char* name, bool& preInit) const = 0;
204 virtual int HasPropertyLimits(const char* name, bool& hasLimits) const = 0;
205 virtual int GetPropertyLowerLimit(const char* name, double& lowLimit) const = 0;
206 virtual int GetPropertyUpperLimit(const char* name, double& hiLimit) const = 0;
207 virtual int GetPropertyType(const char* name, MM::PropertyType& pt) const = 0;
208 virtual unsigned GetNumberOfPropertyValues(const char* propertyName) const = 0;
209 virtual bool GetPropertyValueAt(const char* propertyName, unsigned index, char* value) const = 0;
220 virtual int IsPropertySequenceable(const char* name, bool& isSequenceable) const = 0;
224 virtual int GetPropertySequenceMaxLength(const char* propertyName, long& nrEvents) const = 0;
228 virtual int StartPropertySequence(const char* propertyName) = 0;
232 virtual int StopPropertySequence(const char* propertyName) = 0;
236 virtual int ClearPropertySequence(const char* propertyName) = 0;
240 virtual int AddToPropertySequence(const char* propertyName, const char* value) = 0;
245 virtual int SendPropertySequence(const char* propertyName) = 0;
246
247 virtual bool GetErrorText(int errorCode, char* errMessage) const = 0;
248 virtual bool Busy() = 0;
249 virtual double GetDelayMs() const = 0;
250 virtual void SetDelayMs(double delay) = 0;
251 virtual bool UsesDelay() = 0;
252
253 virtual void SetLabel(const char* label) = 0;
254 virtual void GetLabel(char* name) const = 0;
255 virtual void SetModuleName(const char* moduleName) = 0;
256 virtual void GetModuleName(char* moduleName) const = 0;
257 virtual void SetDescription(const char* description) = 0;
258 virtual void GetDescription(char* description) const = 0;
259
260 virtual int Initialize() = 0;
270 virtual int Shutdown() = 0;
271
272 virtual DeviceType GetType() const = 0;
273 virtual void GetName(char* name) const = 0;
274 virtual void SetCallback(Core* callback) = 0;
275
276 //device discovery API
277 virtual bool SupportsDeviceDetection(void) = 0;
279
280 // hub-peripheral relationship
281 virtual void SetParentID(const char* parentId) = 0;
282 virtual void GetParentID(char* parentID) const = 0;
283 // virtual void SetID(const char* id) = 0;
284 // virtual void GetID(char* id) const = 0;
285 };
286
290 class Generic : public Device
291 {
292 public:
293 virtual DeviceType GetType() const { return Type; }
294 static const DeviceType Type;
295 };
296
300 class Camera : public Device {
301 public:
303 virtual ~Camera() {}
304
305 virtual DeviceType GetType() const { return Type; }
306 static const DeviceType Type;
307
308 // Camera API
318 virtual int SnapImage() = 0;
343 virtual const unsigned char* GetImageBuffer() = 0;
357 virtual const unsigned char* GetImageBuffer(unsigned channelNr) = 0;
361 virtual const unsigned int* GetImageBufferAsRGB32() = 0;
367 virtual unsigned GetNumberOfComponents() const = 0;
368
375 virtual int unsigned GetNumberOfChannels() const = 0;
381 virtual int GetChannelName(unsigned channel, char* name) = 0;
388 virtual long GetImageBufferSize() const = 0;
394 virtual unsigned GetImageWidth() const = 0;
400 virtual unsigned GetImageHeight() const = 0;
406 virtual unsigned GetImageBytesPerPixel() const = 0;
414 virtual unsigned GetBitDepth() const = 0;
418 virtual int GetBinning() const = 0;
422 virtual int SetBinning(int binSize) = 0;
426 virtual void SetExposure(double exp_ms) = 0;
430 virtual double GetExposure() const = 0;
446 virtual int SetROI(unsigned x, unsigned y, unsigned xSize, unsigned ySize) = 0;
450 virtual int GetROI(unsigned& x, unsigned& y, unsigned& xSize, unsigned& ySize) = 0;
454 virtual int ClearROI() = 0;
455 virtual bool SupportsMultiROI() = 0;
456 virtual bool IsMultiROISet() = 0;
457 virtual int GetMultiROICount(unsigned& count) = 0;
458 virtual int SetMultiROI(const unsigned* xs, const unsigned* ys,
459 const unsigned* widths, const unsigned* heights,
460 unsigned numROIs) = 0;
461 virtual int GetMultiROI(unsigned* xs, unsigned* ys, unsigned* widths,
462 unsigned* heights, unsigned* length) = 0;
466 virtual int StartSequenceAcquisition(long numImages, double interval_ms, bool stopOnOverflow) = 0;
472 virtual int StartSequenceAcquisition(double interval_ms) = 0;
476 virtual int StopSequenceAcquisition() = 0;
482 virtual bool IsCapturing() = 0;
483
490 virtual void GetTags(char* serializedMetadata) = 0;
491
500 virtual void AddTag(const char* key, const char* deviceLabel, const char* value) = 0;
501
508 virtual void RemoveTag(const char* key) = 0;
509
516 virtual int IsExposureSequenceable(bool& isSequenceable) const = 0;
517
518 // Sequence functions
519 // Sequences can be used for fast acquisitions, synchronized by TTLs rather than
520 // computer commands.
521 // Sequences of exposures can be uploaded to the camera. The camera will cycle through
522 // the uploaded list of exposures (triggered by either an internal or
523 // external trigger). If the device is capable (and ready) to do so isSequenceable will
524 // be true. If your device can not execute this (true for most cameras)
525 // simply set IsExposureSequenceable to false
526 virtual int GetExposureSequenceMaxLength(long& nrEvents) const = 0;
527 virtual int StartExposureSequence() = 0;
528 virtual int StopExposureSequence() = 0;
529 // Remove all values in the sequence
530 virtual int ClearExposureSequence() = 0;
531 // Add one value to the sequence
532 virtual int AddToExposureSequence(double exposureTime_ms) = 0;
533 // Signal that we are done sending sequence values so that the adapter can send the whole sequence to the device
534 virtual int SendExposureSequence() const = 0;
535 };
536
540 class Shutter : public Device
541 {
542 public:
544 virtual ~Shutter() {}
545
546 // Device API
547 virtual DeviceType GetType() const { return Type; }
548 static const DeviceType Type;
549
550 // Shutter API
551 virtual int SetOpen(bool open = true) = 0;
552 virtual int GetOpen(bool& open) = 0;
558 virtual int Fire(double deltaT) = 0;
559 };
560
564 class Stage : public Device
565 {
566 public:
567 Stage() {}
568 virtual ~Stage() {}
569
570 // Device API
571 virtual DeviceType GetType() const { return Type; }
572 static const DeviceType Type;
573
574 // Stage API
575 virtual int SetPositionUm(double pos) = 0;
576 virtual int SetRelativePositionUm(double d) = 0;
577 virtual int Move(double velocity) = 0;
578 virtual int Stop() = 0;
579 virtual int Home() = 0;
580 virtual int SetAdapterOriginUm(double d) = 0;
581 virtual int GetPositionUm(double& pos) = 0;
582 virtual int SetPositionSteps(long steps) = 0;
583 virtual int GetPositionSteps(long& steps) = 0;
584 virtual int SetOrigin() = 0;
585 virtual int GetLimits(double& lower, double& upper) = 0;
586
596 virtual int UsesOnStagePositionChanged(bool& result) const = 0;
597
611 virtual int GetFocusDirection(FocusDirection& direction) = 0;
612
621 virtual int IsStageSequenceable(bool& isSequenceable) const = 0;
622
630 virtual int IsStageLinearSequenceable(bool& isSequenceable) const = 0;
631
632 // Check if a stage has continuous focusing capability (positions can be set while continuous focus runs).
633 virtual bool IsContinuousFocusDrive() const = 0;
634
635 // Sequence functions
636 // Sequences can be used for fast acquisitions, synchronized by TTLs rather than
637 // computer commands.
638 // Sequences of positions can be uploaded to the stage. The device will cycle through
639 // the uploaded list of states (triggered by an external trigger - most often coming
640 // from the camera). If the device is capable (and ready) to do so isSequenceable will
641 // be true. If your device can not execute this (true for most stages)
642 // simply set isSequenceable to false
643 virtual int GetStageSequenceMaxLength(long& nrEvents) const = 0;
644 virtual int StartStageSequence() = 0;
645 virtual int StopStageSequence() = 0;
649 virtual int ClearStageSequence() = 0;
653 virtual int AddToStageSequence(double position) = 0;
658 virtual int SendStageSequence() = 0;
659
668 virtual int SetStageLinearSequence(double dZ_um, long nSlices) = 0;
669 };
670
674 class XYStage : public Device
675 {
676 public:
678 virtual ~XYStage() {}
679
680 // Device API
681 virtual DeviceType GetType() const { return Type; }
682 static const DeviceType Type;
683
684 // XYStage API
685 // it is recommended that device adapters implement the "Steps" methods
686 // taking long integers but leave the default implementations (in
687 // DeviceBase.h) for the "Um" methods taking doubles. The latter utilize
688 // directionality and origin settings set by user and operate via the
689 // "Steps" methods. The step size is the inherent minimum distance/step
690 // and should be defined by the adapter.
691 virtual int SetPositionUm(double x, double y) = 0;
692 virtual int SetRelativePositionUm(double dx, double dy) = 0;
693 virtual int SetAdapterOriginUm(double x, double y) = 0;
694 virtual int GetPositionUm(double& x, double& y) = 0;
695 virtual int GetLimitsUm(double& xMin, double& xMax, double& yMin, double& yMax) = 0;
696 virtual int Move(double vx, double vy) = 0;
697
698 virtual int SetPositionSteps(long x, long y) = 0;
699 virtual int GetPositionSteps(long& x, long& y) = 0;
700 virtual int SetRelativePositionSteps(long x, long y) = 0;
701 virtual int Home() = 0;
702 virtual int Stop() = 0;
703
713 virtual int UsesOnXYStagePositionChanged(bool &result) const = 0;
714
718 virtual int SetOrigin() = 0;
719
725 virtual int SetXOrigin() = 0;
726
732 virtual int SetYOrigin() = 0;
733
734 virtual int GetStepLimits(long& xMin, long& xMax, long& yMin, long& yMax) = 0;
735 virtual double GetStepSizeXUm() = 0;
736 virtual double GetStepSizeYUm() = 0;
743 virtual int IsXYStageSequenceable(bool& isSequenceable) const = 0;
744 // Sequence functions
745 // Sequences can be used for fast acquisitions, synchronized by TTLs rather than
746 // computer commands.
747 // Sequences of positions can be uploaded to the XY stage. The device will cycle through
748 // the uploaded list of states (triggered by an external trigger - most often coming
749 // from the camera). If the device is capable (and ready) to do so isSequenceable will
750 // be true. If your device can not execute this (true for most XY stages
751 // simply set isSequenceable to false
752 virtual int GetXYStageSequenceMaxLength(long& nrEvents) const = 0;
753 virtual int StartXYStageSequence() = 0;
754 virtual int StopXYStageSequence() = 0;
758 virtual int ClearXYStageSequence() = 0;
762 virtual int AddToXYStageSequence(double positionX, double positionY) = 0;
767 virtual int SendXYStageSequence() = 0;
768
769 };
770
774 class State : public Device
775 {
776 public:
777 State() {}
778 virtual ~State() {}
779
780 // MMDevice API
781 virtual DeviceType GetType() const { return Type; }
782 static const DeviceType Type;
783
784 // MMStateDevice API
785 virtual int SetPosition(long pos) = 0;
786 virtual int SetPosition(const char* label) = 0;
787 virtual int GetPosition(long& pos) const = 0;
788 virtual int GetPosition(char* label) const = 0;
789 virtual int GetPositionLabel(long pos, char* label) const = 0;
790 virtual int GetLabelPosition(const char* label, long& pos) const = 0;
791 virtual int SetPositionLabel(long pos, const char* label) = 0;
792 virtual unsigned long GetNumberOfPositions() const = 0;
793 virtual int SetGateOpen(bool open = true) = 0;
794 virtual int GetGateOpen(bool& open) = 0;
795 };
796
800 class Serial : public Device
801 {
802 public:
804 virtual ~Serial() {}
805
806 // MMDevice API
807 virtual DeviceType GetType() const { return Type; }
808 static const DeviceType Type;
809
810 // Serial API
811 virtual PortType GetPortType() const = 0;
812 virtual int SetCommand(const char* command, const char* term) = 0;
813 virtual int GetAnswer(char* txt, unsigned maxChars, const char* term) = 0;
814 virtual int Write(const unsigned char* buf, unsigned long bufLen) = 0;
815 virtual int Read(unsigned char* buf, unsigned long bufLen, unsigned long& charsRead) = 0;
816 virtual int Purge() = 0;
817 };
818
822 class AutoFocus : public Device
823 {
824 public:
826 virtual ~AutoFocus() {}
827
828 // MMDevice API
829 virtual DeviceType GetType() const { return Type; }
830 static const DeviceType Type;
831
832 // AutoFocus API
833 virtual int SetContinuousFocusing(bool state) = 0;
834 virtual int GetContinuousFocusing(bool& state) = 0;
835 virtual bool IsContinuousFocusLocked() = 0;
836 virtual int FullFocus() = 0;
837 virtual int IncrementalFocus() = 0;
838 virtual int GetLastFocusScore(double& score) = 0;
839 virtual int GetCurrentFocusScore(double& score) = 0;
840 virtual int AutoSetParameters() = 0;
841 virtual int GetOffset(double &offset) = 0;
842 virtual int SetOffset(double offset) = 0;
843 };
844
848 class ImageProcessor : public Device
849 {
850 public:
852 virtual ~ImageProcessor() {}
853
854 // MMDevice API
855 virtual DeviceType GetType() const { return Type; }
856 static const DeviceType Type;
857
858 // image processor API
859 virtual int Process(unsigned char* buffer, unsigned width, unsigned height, unsigned byteDepth) = 0;
860
861
862 };
863
867 class SignalIO : public Device
868 {
869 public:
871 virtual ~SignalIO() {}
872
873 // MMDevice API
874 virtual DeviceType GetType() const { return Type; }
875 static const DeviceType Type;
876
877 // signal io API
878 virtual int SetGateOpen(bool open = true) = 0;
879 virtual int GetGateOpen(bool& open) = 0;
880 virtual int SetSignal(double volts) = 0;
881 virtual int GetSignal(double& volts) = 0;
882 virtual int GetLimits(double& minVolts, double& maxVolts) = 0;
883
898 virtual int IsDASequenceable(bool& isSequenceable) const = 0;
899
900 // Sequence functions
901 // Sequences can be used for fast acquisitions, synchronized by TTLs rather than
902 // computer commands.
903 // Sequences of voltages can be uploaded to the DA. The device will cycle through
904 // the uploaded list of voltages (triggered by an external trigger - most often coming
905 // from the camera). If the device is capable (and ready) to do so isSequenceable will
906 // be true. If your device can not execute this simply set isSequenceable to false
913 virtual int GetDASequenceMaxLength(long& nrEvents) const = 0;
920 virtual int StartDASequence() = 0;
926 virtual int StopDASequence() = 0;
937 virtual int ClearDASequence() = 0;
938
947 virtual int AddToDASequence(double voltage) = 0;
956 virtual int SendDASequence() = 0;
957
958 };
959
963 class Magnifier : public Device
964 {
965 public:
967 virtual ~Magnifier() {}
968
969 // MMDevice API
970 virtual DeviceType GetType() const { return Type; }
971 static const DeviceType Type;
972
973 virtual double GetMagnification() = 0;
974 };
975
976
986 class SLM : public Device
987 {
988 public:
989 SLM() {}
990 virtual ~SLM() {}
991
992 virtual DeviceType GetType() const { return Type; }
993 static const DeviceType Type;
994
995 // SLM API
999 virtual int SetImage(unsigned char * pixels) = 0;
1000
1004 virtual int SetImage(unsigned int * pixels) = 0;
1005
1009 virtual int DisplayImage() = 0;
1010
1014 virtual int SetPixelsTo(unsigned char intensity) = 0;
1015
1019 virtual int SetPixelsTo(unsigned char red, unsigned char green, unsigned char blue) = 0;
1020
1024 virtual int SetExposure(double interval_ms) = 0;
1025
1029 virtual double GetExposure() = 0;
1030
1034 virtual unsigned GetWidth() = 0;
1035
1039 virtual unsigned GetHeight() = 0;
1040
1044 virtual unsigned GetNumberOfComponents() = 0;
1045
1049 virtual unsigned GetBytesPerPixel() = 0;
1050
1051 // SLM Sequence functions
1052 // Sequences can be used for fast acquisitions, synchronized by TTLs rather than
1053 // computer commands.
1054 // Sequences of images can be uploaded to the SLM. The SLM will cycle through
1055 // the uploaded list of images (perhaps triggered by an external trigger or by
1056 // an internal clock.
1057 // If the device is capable (and ready) to do so IsSLMSequenceable will return
1058 // be true. If your device can not execute sequences, IsSLMSequenceable returns false.
1059
1074 virtual int IsSLMSequenceable(bool& isSequenceable) const = 0;
1075
1082 virtual int GetSLMSequenceMaxLength(long& nrEvents) const = 0;
1083
1090 virtual int StartSLMSequence() = 0;
1091
1097 virtual int StopSLMSequence() = 0;
1098
1110 virtual int ClearSLMSequence() = 0;
1111
1121 virtual int AddToSLMSequence(const unsigned char * const pixels) = 0;
1122
1132 virtual int AddToSLMSequence(const unsigned int * const pixels) = 0;
1133
1142 virtual int SendSLMSequence() = 0;
1143
1144 };
1145
1160 class Galvo : public Device
1161 {
1162 public:
1164 virtual ~Galvo() {}
1165
1166 virtual DeviceType GetType() const { return Type; }
1167 static const DeviceType Type;
1168
1169 //Galvo API:
1170
1178 virtual int PointAndFire(double x, double y, double time_us) = 0;
1189 virtual int SetSpotInterval(double pulseInterval_us) = 0;
1196 virtual int SetPosition(double x, double y) = 0;
1204 virtual int GetPosition(double& x, double& y) = 0;
1213 virtual int SetIlluminationState(bool on) = 0;
1217 virtual double GetXRange() = 0;
1223 virtual double GetXMinimum() = 0;
1227 virtual double GetYRange() = 0;
1233 virtual double GetYMinimum() = 0;
1246 virtual int AddPolygonVertex(int polygonIndex, double x, double y) = 0;
1252 virtual int DeletePolygons() = 0;
1265 virtual int RunSequence() = 0;
1275 virtual int LoadPolygons() = 0;
1282 virtual int SetPolygonRepetitions(int repetitions) = 0;
1289 virtual int RunPolygons() = 0;
1296 virtual int StopSequence() = 0;
1304 virtual int GetChannel(char* channelName) = 0;
1305 };
1306
1313 class Hub : public Device
1314 {
1315 public:
1316 Hub() {}
1317 virtual ~Hub() {}
1318
1319 // MMDevice API
1320 virtual DeviceType GetType() const { return Type; }
1321 static const DeviceType Type;
1322
1335 virtual int DetectInstalledDevices() = 0;
1336
1345 virtual void ClearInstalledDevices() = 0;
1346
1353 virtual unsigned GetNumberOfInstalledDevices() = 0;
1354
1362 virtual Device* GetInstalledDevice(int devIdx) = 0;
1363 };
1364
1368 class PressurePump : public Device
1369 {
1370 public:
1372 virtual ~PressurePump() {}
1373
1374 // MMDevice API
1375 virtual DeviceType GetType() const { return Type; }
1376 static const DeviceType Type;
1377
1386 virtual int Stop() = 0;
1387
1396 virtual int Calibrate() = 0;
1397
1405 virtual bool RequiresCalibration() = 0;
1406
1415 virtual int SetPressureKPa(double pressureKPa) = 0;
1416
1425 virtual int GetPressureKPa(double& pressureKPa) = 0;
1426 };
1427
1431 class VolumetricPump : public Device
1432 {
1433 public:
1435 virtual ~VolumetricPump() {}
1436
1437 // MMDevice API
1438 virtual DeviceType GetType() const { return Type; }
1439 static const DeviceType Type;
1440
1448 virtual int Home() = 0;
1449
1458 virtual int Stop() = 0;
1459
1465 virtual bool RequiresHoming() = 0;
1466
1479 virtual int InvertDirection(bool inverted) = 0;
1480
1492 virtual int IsDirectionInverted(bool& inverted) = 0;
1493
1499 virtual int SetVolumeUl(double volUl) = 0;
1500
1506 virtual int GetVolumeUl(double& volUl) = 0;
1507
1513 virtual int SetMaxVolumeUl(double volUl) = 0;
1514
1520 virtual int GetMaxVolumeUl(double& volUl) = 0;
1521
1530 virtual int SetFlowrateUlPerSecond(double flowrate) = 0;
1531
1537 virtual int GetFlowrateUlPerSecond(double& flowrate) = 0;
1538
1545 virtual int Start() = 0;
1546
1556 virtual int DispenseDurationSeconds(double durSec) = 0;
1557
1573 virtual int DispenseVolumeUl(double volUl) = 0;
1574 };
1575
1576
1582 class Core
1583 {
1584 public:
1585 Core() {}
1586 virtual ~Core() {}
1587
1595 virtual int LogMessage(const Device* caller, const char* msg, bool debugOnly) const = 0;
1602 virtual Device* GetDevice(const Device* caller, const char* label) = 0;
1603 virtual int GetDeviceProperty(const char* deviceName, const char* propName, char* value) = 0;
1604 virtual int SetDeviceProperty(const char* deviceName, const char* propName, const char* value) = 0;
1605
1617 virtual void GetLoadedDeviceOfType(const Device* caller, MM::DeviceType devType, char* pDeviceName, const unsigned int deviceIterator) = 0;
1618
1619 virtual int SetSerialProperties(const char* portName,
1620 const char* answerTimeout,
1621 const char* baudRate,
1622 const char* delayBetweenCharsMs,
1623 const char* handshaking,
1624 const char* parity,
1625 const char* stopBits) = 0;
1626 virtual int SetSerialCommand(const Device* caller, const char* portName, const char* command, const char* term) = 0;
1627 virtual int GetSerialAnswer(const Device* caller, const char* portName, unsigned long ansLength, char* answer, const char* term) = 0;
1628 virtual int WriteToSerial(const Device* caller, const char* port, const unsigned char* buf, unsigned long length) = 0;
1629 virtual int ReadFromSerial(const Device* caller, const char* port, unsigned char* buf, unsigned long length, unsigned long& read) = 0;
1630 virtual int PurgeSerial(const Device* caller, const char* portName) = 0;
1631 virtual MM::PortType GetSerialPortType(const char* portName) const = 0;
1632
1633 virtual int OnPropertiesChanged(const Device* caller) = 0;
1640 virtual int OnPropertyChanged(const Device* caller, const char* propName, const char* propValue) = 0;
1646 virtual int OnStagePositionChanged(const Device* caller, double pos) = 0;
1652 virtual int OnXYStagePositionChanged(const Device* caller, double xPos, double yPos) = 0;
1656 virtual int OnExposureChanged(const Device* caller, double newExposure) = 0;
1660 virtual int OnSLMExposureChanged(const Device* caller, double newExposure) = 0;
1664 virtual int OnMagnifierChanged(const Device* caller) = 0;
1668 virtual int OnShutterOpenChanged(const Device* caller, bool open) = 0;
1669
1670 // Deprecated: Return value overflows in ~72 minutes on Windows.
1671 // Prefer std::chrono::steady_clock for time delta measurements.
1672 virtual unsigned long GetClockTicksUs(const Device* caller) = 0;
1673
1674 // Returns monotonic MMTime suitable for time delta measurements.
1675 // Time zero is not fixed and may change on every launch.
1676 // Prefer std::chrono::steady_clock::now() in new code.
1678
1679 // sequence acquisition
1680 virtual int AcqFinished(const Device* caller, int statusCode) = 0;
1681 virtual int PrepareForAcq(const Device* caller) = 0;
1682
1706 virtual int InsertImage(const Device* caller, const unsigned char* buf,
1707 unsigned width, unsigned height, unsigned bytePerPixel, unsigned nComponents,
1708 const char* serializedMetadata = nullptr) = 0;
1709
1716 virtual int InsertImage(const Device* caller, const unsigned char* buf,
1717 unsigned width, unsigned height, unsigned bytePerPixel,
1718 const char* serializedMetadata = nullptr) = 0;
1719
1726 virtual bool InitializeImageBuffer(unsigned channels, unsigned slices, unsigned int w, unsigned int h, unsigned int pixDepth) = 0;
1727
1728 // These functions violate the separation between device adapters and
1729 // will be removed as soon as we remove all uses. Never use in new code.
1730 MMDEVICE_DEPRECATED virtual int GetFocusPosition(double& pos) = 0;
1731 MMDEVICE_DEPRECATED virtual MM::SignalIO* GetSignalIODevice(const MM::Device* caller, const char* deviceName) = 0;
1732
1733 virtual MM::Hub* GetParentHub(const MM::Device* caller) const = 0;
1734 };
1735
1736} // namespace MM
#define MMDEVICE_DEPRECATED
Definition MMDeviceConstants.h:28
Auto-focus device API.
Definition MMDevice.h:823
virtual int SetOffset(double offset)=0
virtual int GetLastFocusScore(double &score)=0
AutoFocus()
Definition MMDevice.h:825
virtual ~AutoFocus()
Definition MMDevice.h:826
static const DeviceType Type
Definition MMDevice.h:830
virtual int GetOffset(double &offset)=0
virtual int FullFocus()=0
virtual int GetContinuousFocusing(bool &state)=0
virtual int AutoSetParameters()=0
virtual DeviceType GetType() const
Definition MMDevice.h:829
virtual int SetContinuousFocusing(bool state)=0
virtual int IncrementalFocus()=0
virtual bool IsContinuousFocusLocked()=0
virtual int GetCurrentFocusScore(double &score)=0
Camera API.
Definition MMDevice.h:300
virtual long GetImageBufferSize() const =0
Return the size in bytes of the image buffer.
virtual int ClearROI()=0
Reset the Region of Interest to full frame.
virtual int GetBinning() const =0
Return the current binning factor.
virtual int GetExposureSequenceMaxLength(long &nrEvents) const =0
virtual ~Camera()
Definition MMDevice.h:303
virtual void SetExposure(double exp_ms)=0
Set exposure in milliseconds.
virtual const unsigned char * GetImageBuffer()=0
Return pixel data.
virtual int SnapImage()=0
Perform exposure and grab a single image.
virtual int StopSequenceAcquisition()=0
Stop an ongoing sequence acquisition.
virtual void GetTags(char *serializedMetadata)=0
Get the metadata tags stored in this device.
virtual unsigned GetImageHeight() const =0
Return image buffer Y-size in pixels.
virtual bool IsCapturing()=0
Indicate whether sequence acquisition is currently running.
virtual int unsigned GetNumberOfChannels() const =0
Return the number of simultaneous channels that camera is capable of.
Camera()
Definition MMDevice.h:302
virtual unsigned GetBitDepth() const =0
Return the bit depth (dynamic range) of the pixel.
virtual int GetChannelName(unsigned channel, char *name)=0
Return the name for each Channel.
virtual int SetROI(unsigned x, unsigned y, unsigned xSize, unsigned ySize)=0
Set the camera Region Of Interest.
virtual int GetMultiROI(unsigned *xs, unsigned *ys, unsigned *widths, unsigned *heights, unsigned *length)=0
virtual int SetMultiROI(const unsigned *xs, const unsigned *ys, const unsigned *widths, const unsigned *heights, unsigned numROIs)=0
virtual const unsigned char * GetImageBuffer(unsigned channelNr)=0
Return pixel data for cameras with multiple channels.
virtual DeviceType GetType() const
Definition MMDevice.h:305
virtual double GetExposure() const =0
Return the current exposure setting in milliseconds.
virtual int IsExposureSequenceable(bool &isSequenceable) const =0
Return whether a camera's exposure time can be sequenced.
virtual int SendExposureSequence() const =0
virtual int GetMultiROICount(unsigned &count)=0
virtual int ClearExposureSequence()=0
virtual int AddToExposureSequence(double exposureTime_ms)=0
virtual bool IsMultiROISet()=0
virtual int StartSequenceAcquisition(long numImages, double interval_ms, bool stopOnOverflow)=0
Start continuous acquisition.
virtual bool SupportsMultiROI()=0
virtual int StartExposureSequence()=0
virtual void AddTag(const char *key, const char *deviceLabel, const char *value)=0
Add new tag or modify the value of an existing one.
virtual unsigned GetNumberOfComponents() const =0
Return the number of components in this image.
virtual int StartSequenceAcquisition(double interval_ms)=0
Start Sequence Acquisition with given interval.
virtual const unsigned int * GetImageBufferAsRGB32()=0
Return pixel data with interleaved RGB pixels in 32 bpp format.
static const DeviceType Type
Definition MMDevice.h:306
virtual void RemoveTag(const char *key)=0
Remove an existing tag from the metadata associated with this device.
virtual int GetROI(unsigned &x, unsigned &y, unsigned &xSize, unsigned &ySize)=0
Return the actual dimensions of the current ROI.
virtual unsigned GetImageWidth() const =0
Return image buffer X-size in pixels.
virtual int StopExposureSequence()=0
virtual int SetBinning(int binSize)=0
Set binning factor.
virtual unsigned GetImageBytesPerPixel() const =0
Return image buffer pixel depth in bytes.
Callback API to the core control module.
Definition MMDevice.h:1583
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 ~Core()
Definition MMDevice.h:1586
virtual int OnPropertiesChanged(const Device *caller)=0
virtual MM::MMTime GetCurrentMMTime()=0
virtual unsigned long GetClockTicksUs(const Device *caller)=0
virtual int GetSerialAnswer(const Device *caller, const char *portName, unsigned long ansLength, char *answer, const char *term)=0
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 int OnMagnifierChanged(const Device *caller)=0
Signal changes in magnification.
virtual int AcqFinished(const Device *caller, int statusCode)=0
virtual MM::PortType GetSerialPortType(const char *portName) const =0
virtual int SetSerialCommand(const Device *caller, const char *portName, const char *command, const char *term)=0
virtual int PurgeSerial(const Device *caller, const char *portName)=0
virtual int OnStagePositionChanged(const Device *caller, double pos)=0
Inform the UI when a stage has changed its position.
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 OnExposureChanged(const Device *caller, double newExposure)=0
Inform the UI when the exposure time has changed.
virtual int WriteToSerial(const Device *caller, const char *port, const unsigned char *buf, unsigned long length)=0
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 MM::Hub * GetParentHub(const MM::Device *caller) const =0
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 int OnXYStagePositionChanged(const Device *caller, double xPos, double yPos)=0
Inform the UI when an XY stage has changed its position.
virtual MM::SignalIO * GetSignalIODevice(const MM::Device *caller, const char *deviceName)=0
virtual int SetDeviceProperty(const char *deviceName, const char *propName, const char *value)=0
virtual int ReadFromSerial(const Device *caller, const char *port, unsigned char *buf, unsigned long length, unsigned long &read)=0
Core()
Definition MMDevice.h:1585
virtual Device * GetDevice(const Device *caller, const char *label)=0
Get a pointer to another device.
virtual int OnShutterOpenChanged(const Device *caller, bool open)=0
Signal that the shutter opened or closed.
virtual int OnPropertyChanged(const Device *caller, const char *propName, const char *propValue)=0
Inform the UI that a property changed.
virtual int OnSLMExposureChanged(const Device *caller, double newExposure)=0
Inform the UI when the SLM exposure time has changed.
virtual int GetFocusPosition(double &pos)=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 GetDeviceProperty(const char *deviceName, const char *propName, char *value)=0
virtual int PrepareForAcq(const Device *caller)=0
Generic device interface.
Definition MMDevice.h:192
virtual int GetProperty(const char *name, char *value) const =0
virtual bool UsesDelay()=0
virtual int GetPropertySequenceMaxLength(const char *propertyName, long &nrEvents) const =0
Return the largest sequence that can be stored in the device.
virtual int GetPropertyUpperLimit(const char *name, double &hiLimit) const =0
virtual int GetPropertyType(const char *name, MM::PropertyType &pt) const =0
virtual MM::DeviceDetectionStatus DetectDevice(void)=0
virtual void SetCallback(Core *callback)=0
virtual void GetDescription(char *description) const =0
virtual bool GetErrorText(int errorCode, char *errMessage) const =0
virtual int Initialize()=0
virtual bool Busy()=0
virtual int StopPropertySequence(const char *propertyName)=0
Stop execution of the sequence.
virtual void GetModuleName(char *moduleName) const =0
virtual void GetLabel(char *name) const =0
virtual int IsPropertySequenceable(const char *name, bool &isSequenceable) const =0
Check whether the given property can be used with sequences.
virtual void SetLabel(const char *label)=0
virtual bool GetPropertyName(unsigned idx, char *name) const =0
virtual bool HasProperty(const char *name) const =0
Device()
Definition MMDevice.h:194
virtual int GetPropertyInitStatus(const char *name, bool &preInit) const =0
virtual int StartPropertySequence(const char *propertyName)=0
Start execution of the sequence.
virtual int ClearPropertySequence(const char *propertyName)=0
Remove previously added sequence.
virtual double GetDelayMs() const =0
virtual void SetParentID(const char *parentId)=0
virtual unsigned GetNumberOfPropertyValues(const char *propertyName) const =0
virtual int AddToPropertySequence(const char *propertyName, const char *value)=0
Add one value to the sequence.
virtual bool GetPropertyValueAt(const char *propertyName, unsigned index, char *value) const =0
virtual int HasPropertyLimits(const char *name, bool &hasLimits) const =0
virtual ~Device()
Definition MMDevice.h:195
virtual int SendPropertySequence(const char *propertyName)=0
Signal that we are done sending sequence values so that the adapter can send the whole sequence to th...
virtual void SetDelayMs(double delay)=0
virtual void GetParentID(char *parentID) const =0
virtual DeviceType GetType() const =0
virtual void SetModuleName(const char *moduleName)=0
virtual bool SupportsDeviceDetection(void)=0
virtual void GetName(char *name) const =0
virtual unsigned GetNumberOfProperties() const =0
virtual int SetProperty(const char *name, const char *value)=0
virtual int GetPropertyReadOnly(const char *name, bool &readOnly) const =0
virtual int GetPropertyLowerLimit(const char *name, double &lowLimit) const =0
virtual void SetDescription(const char *description)=0
virtual int Shutdown()=0
Shut down (unload) the device.
Galvo API.
Definition MMDevice.h:1161
virtual ~Galvo()
Definition MMDevice.h:1164
virtual int RunSequence()=0
Run a TTL-triggered polygon sequence.
virtual int RunPolygons()=0
Display each pre-loaded polygon in sequence, each illuminated for pulseinterval_us micro-seconds.
virtual int LoadPolygons()=0
Transfer the polygons from the device adapter memory to the Galvo controller.
virtual int GetPosition(double &x, double &y)=0
Return the current position of the two axes (usually the last position that was set,...
virtual int StopSequence()=0
Stop the TTL triggered transitions of drawing polygons started in RunSequence().
virtual double GetXRange()=0
Return the X range of the device in native units.
static const DeviceType Type
Definition MMDevice.h:1167
virtual int SetSpotInterval(double pulseInterval_us)=0
Set the spot interval time.
virtual double GetYRange()=0
Return the Y range of the device in native units.
virtual double GetYMinimum()=0
Return the minimum Y value for the device in native units.
virtual int AddPolygonVertex(int polygonIndex, double x, double y)=0
Add a vertex point to a polygon.
virtual int GetChannel(char *channelName)=0
TODO-BRIEF.
virtual int PointAndFire(double x, double y, double time_us)=0
Move the galvo devices to the requested position, activate the light source, wait for the specified a...
virtual int DeletePolygons()=0
Delete all polygons previously stored in the device adapter.
virtual int SetPolygonRepetitions(int repetitions)=0
Set the number of times the polygons should be displayed in the RunPolygons function.
Galvo()
Definition MMDevice.h:1163
virtual int SetPosition(double x, double y)=0
Set the position of the two axes of the Galvo device in native unit (usually through a voltage that c...
virtual DeviceType GetType() const
Definition MMDevice.h:1166
virtual int SetIlluminationState(bool on)=0
Switch the light source under control of this device on or off.
virtual double GetXMinimum()=0
Return the minimum X value for the device in native units.
Generic Device.
Definition MMDevice.h:291
static const DeviceType Type
Definition MMDevice.h:294
virtual DeviceType GetType() const
Definition MMDevice.h:293
HUB device.
Definition MMDevice.h:1314
virtual ~Hub()
Definition MMDevice.h:1317
Hub()
Definition MMDevice.h:1316
static const DeviceType Type
Definition MMDevice.h:1321
virtual Device * GetInstalledDevice(int devIdx)=0
Return a pointer to the Device with index devIdx.
virtual unsigned GetNumberOfInstalledDevices()=0
Return the number of child Devices after DetectInstalledDevices was called.
virtual void ClearInstalledDevices()=0
Remove all Device instances that were created by DetectInstalledDevices(). Not used.
virtual DeviceType GetType() const
Definition MMDevice.h:1320
virtual int DetectInstalledDevices()=0
Instantiate all available child peripheral devices.
Image processor API.
Definition MMDevice.h:849
ImageProcessor()
Definition MMDevice.h:851
virtual DeviceType GetType() const
Definition MMDevice.h:855
virtual int Process(unsigned char *buffer, unsigned width, unsigned height, unsigned byteDepth)=0
virtual ~ImageProcessor()
Definition MMDevice.h:852
static const DeviceType Type
Definition MMDevice.h:856
Utility class used both MMCore and devices to maintain time intervals in the uniform,...
Definition MMDevice.h:58
static MMTime fromMs(double ms)
Definition MMDevice.h:84
MMTime()
Definition MMDevice.h:62
MMTime operator+(const MMTime &other) const
Definition MMDevice.h:94
bool operator!=(const MMTime &other) const
Definition MMDevice.h:129
double getMsec() const
Definition MMDevice.h:134
bool operator<=(const MMTime &other) const
Definition MMDevice.h:119
bool operator>=(const MMTime &other) const
Definition MMDevice.h:109
std::string toString() const
Definition MMDevice.h:144
MMTime(double uSecTotal)
Definition MMDevice.h:64
bool operator==(const MMTime &other) const
Definition MMDevice.h:124
static MMTime fromUs(long long us)
Definition MMDevice.h:72
MMTime operator-(const MMTime &other) const
Definition MMDevice.h:99
static MMTime fromSeconds(long secs)
Definition MMDevice.h:89
MMTime(long sec, long uSec)
Definition MMDevice.h:68
bool operator>(const MMTime &other) const
Definition MMDevice.h:104
bool operator<(const MMTime &other) const
Definition MMDevice.h:114
double getUsec() const
Definition MMDevice.h:139
Devices that can change magnification of the system.
Definition MMDevice.h:964
virtual ~Magnifier()
Definition MMDevice.h:967
static const DeviceType Type
Definition MMDevice.h:971
virtual double GetMagnification()=0
Magnifier()
Definition MMDevice.h:966
virtual DeviceType GetType() const
Definition MMDevice.h:970
Pressure Pump API.
Definition MMDevice.h:1369
virtual bool RequiresCalibration()=0
Return whether the pressure controller is functional before calibration, or it needs to undergo inter...
virtual DeviceType GetType() const
Definition MMDevice.h:1375
virtual int SetPressureKPa(double pressureKPa)=0
Set the pressure of the pressure controller.
virtual int Stop()=0
Stop the pump.
virtual int GetPressureKPa(double &pressureKPa)=0
Get the pressure of the pressure controller.
PressurePump()
Definition MMDevice.h:1371
virtual int Calibrate()=0
Calibrate the pressure controller.
virtual ~PressurePump()
Definition MMDevice.h:1372
static const DeviceType Type
Definition MMDevice.h:1376
Spatial Light Modulator (SLM) API.
Definition MMDevice.h:987
virtual int StartSLMSequence()=0
Start running a sequence (i.e., start switching between images sent previously, triggered by a TTL or...
virtual int SendSLMSequence()=0
Send the complete sequence to the device.
virtual int GetSLMSequenceMaxLength(long &nrEvents) const =0
Return the maximum length of a sequence that the hardware can store.
virtual int IsSLMSequenceable(bool &isSequenceable) const =0
Indicate whether or not this SLM device accepts sequences.
SLM()
Definition MMDevice.h:989
virtual double GetExposure()=0
Get the exposure interval of an SLM.
static const DeviceType Type
Definition MMDevice.h:993
virtual unsigned GetNumberOfComponents()=0
Get the SLM number of components (colors).
virtual int AddToSLMSequence(const unsigned char *const pixels)=0
Add a new 8-bit projection image to the sequence.
virtual int SetPixelsTo(unsigned char red, unsigned char green, unsigned char blue)=0
Command the SLM to display one 32-bit color.
virtual ~SLM()
Definition MMDevice.h:990
virtual int DisplayImage()=0
Command the SLM to display the loaded image.
virtual int StopSLMSequence()=0
Stop running the sequence.
virtual int SetExposure(double interval_ms)=0
Command the SLM to turn off after a specified interval.
virtual int SetPixelsTo(unsigned char intensity)=0
Command the SLM to display one 8-bit intensity.
virtual unsigned GetHeight()=0
Get the SLM height in pixels.
virtual int SetImage(unsigned int *pixels)=0
Load a 32-bit image into the SLM device adapter.
virtual unsigned GetBytesPerPixel()=0
Get the SLM number of bytes per pixel.
virtual int SetImage(unsigned char *pixels)=0
Load the image into the SLM device adapter.
virtual int AddToSLMSequence(const unsigned int *const pixels)=0
Add a new 32-bit (RGB) projection image to the sequence.
virtual int ClearSLMSequence()=0
Clear the SLM sequence from the device and the adapter.
virtual DeviceType GetType() const
Definition MMDevice.h:992
virtual unsigned GetWidth()=0
Get the SLM width in pixels.
Serial port API.
Definition MMDevice.h:801
virtual int Write(const unsigned char *buf, unsigned long bufLen)=0
virtual ~Serial()
Definition MMDevice.h:804
virtual int SetCommand(const char *command, const char *term)=0
virtual int Purge()=0
virtual int Read(unsigned char *buf, unsigned long bufLen, unsigned long &charsRead)=0
virtual PortType GetPortType() const =0
static const DeviceType Type
Definition MMDevice.h:808
Serial()
Definition MMDevice.h:803
virtual int GetAnswer(char *txt, unsigned maxChars, const char *term)=0
virtual DeviceType GetType() const
Definition MMDevice.h:807
Shutter API.
Definition MMDevice.h:541
virtual int Fire(double deltaT)=0
Open the shutter for the given duration, then close it again.
Shutter()
Definition MMDevice.h:543
virtual DeviceType GetType() const
Definition MMDevice.h:547
virtual int SetOpen(bool open=true)=0
virtual ~Shutter()
Definition MMDevice.h:544
static const DeviceType Type
Definition MMDevice.h:548
virtual int GetOpen(bool &open)=0
ADC and DAC interface.
Definition MMDevice.h:868
static const DeviceType Type
Definition MMDevice.h:875
virtual int StartDASequence()=0
Start running a sequence (i.e., start switching between voltages sent previously, triggered by a TTL)...
virtual int GetGateOpen(bool &open)=0
virtual int GetSignal(double &volts)=0
virtual int SendDASequence()=0
Send the complete sequence to the device.
virtual int StopDASequence()=0
Stop running the sequence.
virtual int ClearDASequence()=0
Clear the DA sequence from the device and the adapter.
virtual int IsDASequenceable(bool &isSequenceable) const =0
Indicate whether or not this DA device accepts sequences.
virtual int GetLimits(double &minVolts, double &maxVolts)=0
virtual DeviceType GetType() const
Definition MMDevice.h:874
SignalIO()
Definition MMDevice.h:870
virtual int GetDASequenceMaxLength(long &nrEvents) const =0
Return the maximum length of a sequence that the hardware can store.
virtual int SetSignal(double volts)=0
virtual ~SignalIO()
Definition MMDevice.h:871
virtual int SetGateOpen(bool open=true)=0
virtual int AddToDASequence(double voltage)=0
Add a new data point (voltage) to the sequence.
Single axis stage API.
Definition MMDevice.h:565
virtual int IsStageLinearSequenceable(bool &isSequenceable) const =0
Indicate whether the stage can perform linear TTL sequencing.
virtual int SendStageSequence()=0
Signal that we are done sending sequence values so that the adapter can send the whole sequence to th...
virtual int SetAdapterOriginUm(double d)=0
virtual int GetLimits(double &lower, double &upper)=0
virtual int GetStageSequenceMaxLength(long &nrEvents) const =0
virtual int SetStageLinearSequence(double dZ_um, long nSlices)=0
Set up to perform an equally-spaced triggered Z stack.
virtual ~Stage()
Definition MMDevice.h:568
virtual int StopStageSequence()=0
virtual int StartStageSequence()=0
virtual int ClearStageSequence()=0
Remove all values in the sequence.
virtual int GetPositionUm(double &pos)=0
static const DeviceType Type
Definition MMDevice.h:572
virtual int Stop()=0
virtual bool IsContinuousFocusDrive() const =0
virtual int GetFocusDirection(FocusDirection &direction)=0
Return the focus direction.
virtual int AddToStageSequence(double position)=0
Add one value to the sequence.
virtual int SetPositionSteps(long steps)=0
virtual int UsesOnStagePositionChanged(bool &result) const =0
Stages can use the OnStagePositionChanged callback to signal updates about their position....
virtual int IsStageSequenceable(bool &isSequenceable) const =0
Indicate whether the stage can be sequenced (synchronized by TTLs).
virtual int GetPositionSteps(long &steps)=0
virtual int SetOrigin()=0
virtual int SetRelativePositionUm(double d)=0
virtual int Move(double velocity)=0
virtual int SetPositionUm(double pos)=0
Stage()
Definition MMDevice.h:567
virtual DeviceType GetType() const
Definition MMDevice.h:571
virtual int Home()=0
State device API, e.g. filter wheel, objective turret, etc.
Definition MMDevice.h:775
virtual DeviceType GetType() const
Definition MMDevice.h:781
virtual int GetPositionLabel(long pos, char *label) const =0
virtual int SetPosition(const char *label)=0
static const DeviceType Type
Definition MMDevice.h:782
virtual int GetPosition(char *label) const =0
virtual int GetPosition(long &pos) const =0
virtual int GetLabelPosition(const char *label, long &pos) const =0
virtual ~State()
Definition MMDevice.h:778
virtual unsigned long GetNumberOfPositions() const =0
virtual int SetGateOpen(bool open=true)=0
State()
Definition MMDevice.h:777
virtual int SetPositionLabel(long pos, const char *label)=0
virtual int GetGateOpen(bool &open)=0
virtual int SetPosition(long pos)=0
Timeout utility class.
Definition MMDevice.h:163
TimeoutMs(const MMTime startTime, const MMTime interval)
Definition MMDevice.h:171
bool expired(const MMTime tnow)
Definition MMDevice.h:177
TimeoutMs(const MMTime startTime, const unsigned long intervalMs)
Definition MMDevice.h:166
Volumetric Pump API.
Definition MMDevice.h:1432
virtual int Home()=0
Home the pump.
virtual DeviceType GetType() const
Definition MMDevice.h:1438
virtual int GetMaxVolumeUl(double &volUl)=0
Get the maximum volume of the pump in microliters (uL).
virtual int GetVolumeUl(double &volUl)=0
Get the current volume of the pump in microliters (uL).
virtual ~VolumetricPump()
Definition MMDevice.h:1435
virtual int Start()=0
Start dispensing/withdrawing until the minimum or maximum volume has been reached,...
VolumetricPump()
Definition MMDevice.h:1434
static const DeviceType Type
Definition MMDevice.h:1439
virtual bool RequiresHoming()=0
Check whether the pump requires homing before being operational.
virtual int DispenseDurationSeconds(double durSec)=0
Dispense/withdraw for the provided time.
virtual int SetMaxVolumeUl(double volUl)=0
Set the maximum volume of the pump in microliters (uL).
virtual int Stop()=0
Stop the pump.
virtual int IsDirectionInverted(bool &inverted)=0
Check whether the direction of the pump is inverted.
virtual int SetVolumeUl(double volUl)=0
Set the current volume of the pump in microliters (uL).
virtual int GetFlowrateUlPerSecond(double &flowrate)=0
Get the flowrate in microliter (uL) per second.
virtual int DispenseVolumeUl(double volUl)=0
Dispense/withdraw the provided volume.
virtual int SetFlowrateUlPerSecond(double flowrate)=0
Set the flowrate in microliter (uL) per second.
virtual int InvertDirection(bool inverted)=0
Set the direction of the pump.
Dual axis stage API.
Definition MMDevice.h:675
virtual int GetLimitsUm(double &xMin, double &xMax, double &yMin, double &yMax)=0
virtual double GetStepSizeXUm()=0
virtual int ClearXYStageSequence()=0
Remove all values in the sequence.
static const DeviceType Type
Definition MMDevice.h:682
virtual int GetStepLimits(long &xMin, long &xMax, long &yMin, long &yMax)=0
virtual int GetPositionUm(double &x, double &y)=0
virtual DeviceType GetType() const
Definition MMDevice.h:681
virtual int SetYOrigin()=0
Define the current position as Y = 0 (in hardware if possible).
virtual int SetRelativePositionSteps(long x, long y)=0
virtual int SetXOrigin()=0
Define the current position as X = 0 (in hardware if possible).
virtual int Stop()=0
virtual int GetXYStageSequenceMaxLength(long &nrEvents) const =0
virtual int StopXYStageSequence()=0
virtual int IsXYStageSequenceable(bool &isSequenceable) const =0
Return whether a stage can be sequenced (synchronized by TTLs).
virtual int GetPositionSteps(long &x, long &y)=0
virtual int UsesOnXYStagePositionChanged(bool &result) const =0
XY stages can use the OnXYStagePositionChanged callback to signal updates about their position....
virtual int SetOrigin()=0
Define the current position as the (hardware) origin (0, 0).
virtual int Home()=0
virtual int StartXYStageSequence()=0
virtual int SendXYStageSequence()=0
Signal that we are done sending sequence values so that the adapter can send the whole sequence to th...
virtual int SetAdapterOriginUm(double x, double y)=0
virtual int SetPositionUm(double x, double y)=0
virtual double GetStepSizeYUm()=0
virtual int SetPositionSteps(long x, long y)=0
virtual ~XYStage()
Definition MMDevice.h:678
virtual int SetRelativePositionUm(double dx, double dy)=0
XYStage()
Definition MMDevice.h:677
virtual int AddToXYStageSequence(double positionX, double positionY)=0
Add one value to the sequence.
virtual int Move(double vx, double vy)=0
Definition CameraImageMetadata.h:25
FocusDirection
Definition MMDeviceConstants.h:282
PortType
Definition MMDeviceConstants.h:275
PropertyType
Definition MMDeviceConstants.h:258
DeviceType
Definition MMDeviceConstants.h:236
DeviceDetectionStatus
Definition MMDeviceConstants.h:296