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
28// Header version
29// If any of the class definitions changes, the interface version
30// must be incremented
31#define DEVICE_INTERFACE_VERSION 75
33
34// N.B.
35//
36// Never add parameters or return values that are not POD
37// (http://stackoverflow.com/a/146454) to any method of class Device and its
38// derived classes defined in this file. For example, a std::string parameter
39// is not acceptable (use const char*). This is to prevent inter-DLL
40// incompatibilities.
41
42#include "MMDeviceConstants.h"
43#include "DeviceUtils.h"
44#include "DeviceThreads.h"
45
46#include <climits>
47#include <cstdlib>
48#include <cstring>
49#include <iomanip>
50#include <sstream>
51#include <string>
52#include <vector>
53
54
55namespace MM {
56
57 // forward declaration for the MMCore callback class
58 class Core;
59
64 class MMTime
65 {
66 long long microseconds_;
67
68 public:
69 MMTime() : microseconds_(0LL) {}
70
71 explicit MMTime(double uSecTotal) :
72 microseconds_(static_cast<long long>(uSecTotal))
73 {}
74
75 explicit MMTime(long sec, long uSec) :
76 microseconds_(sec * 1'000'000LL + uSec)
77 {}
78
79 static MMTime fromUs(long long us)
80 {
81 // Work around our lack of a constructor that directly sets the
82 // internal representation.
83 // (Note that we cannot add a constructor from 'long long' because
84 // many existing uses would then get an error (ambiguous with the
85 // 'double' overload).)
86 MMTime ret;
87 ret.microseconds_ = us;
88 return ret;
89 }
90
91 static MMTime fromMs(double ms)
92 {
93 return MMTime(ms * 1000.0);
94 }
95
96 static MMTime fromSeconds(long secs)
97 {
98 return MMTime(secs, 0);
99 }
100
101 MMTime operator+(const MMTime &other) const
102 {
103 return fromUs(microseconds_ + other.microseconds_);
104 }
105
106 MMTime operator-(const MMTime &other) const
107 {
108 return fromUs(microseconds_ - other.microseconds_);
109 }
110
111 bool operator>(const MMTime &other) const
112 {
113 return microseconds_ > other.microseconds_;
114 }
115
116 bool operator>=(const MMTime &other) const
117 {
118 return microseconds_ >= other.microseconds_;
119 }
120
121 bool operator<(const MMTime &other) const
122 {
123 return microseconds_ < other.microseconds_;
124 }
125
126 bool operator<=(const MMTime &other) const
127 {
128 return microseconds_ <= other.microseconds_;
129 }
130
131 bool operator==(const MMTime &other) const
132 {
133 return microseconds_ == other.microseconds_;
134 }
135
136 bool operator!=(const MMTime &other) const
137 {
138 return !(*this == other);
139 }
140
141 double getMsec() const
142 {
143 return microseconds_ / 1000.0;
144 }
145
146 double getUsec() const
147 {
148 return static_cast<double>(microseconds_);
149 }
150
151 std::string toString() const {
152 long long absUs = std::abs(microseconds_);
153 long long seconds = absUs / 1'000'000LL;
154 long long fracUs = absUs - seconds * 1'000'000LL;
155 const char *sign = microseconds_ < 0 ? "-" : "";
156
157 using namespace std;
158 ostringstream s;
159 s << sign << seconds << '.' <<
160 setfill('0') << right << setw(6) << fracUs;
161 return s.str();
162 }
163 };
164
165
170 {
171 public:
172 // arguments: MMTime start time, millisecond interval time
173 explicit TimeoutMs(const MMTime startTime, const unsigned long intervalMs) :
174 startTime_(startTime),
175 interval_(0, 1000*intervalMs)
176 {
177 }
178 explicit TimeoutMs(const MMTime startTime, const MMTime interval) :
179 startTime_(startTime),
180 interval_(interval)
181 {
182 }
183
184 bool expired(const MMTime tnow)
185 {
186 MMTime elapsed = tnow - startTime_;
187 return ( interval_ < elapsed );
188 }
189
190 private:
191 MMTime startTime_; // start time
192 MMTime interval_; // interval in milliseconds
193 };
194
195
199 class Device {
200 public:
202 virtual ~Device() {}
203
204 virtual unsigned GetNumberOfProperties() const = 0;
205 virtual int GetProperty(const char* name, char* value) const = 0;
206 virtual int SetProperty(const char* name, const char* value) = 0;
207 virtual bool HasProperty(const char* name) const = 0;
208 virtual bool GetPropertyName(unsigned idx, char* name) const = 0;
209 virtual int GetPropertyReadOnly(const char* name, bool& readOnly) const = 0;
210 virtual int GetPropertyInitStatus(const char* name, bool& preInit) const = 0;
211 virtual int HasPropertyLimits(const char* name, bool& hasLimits) const = 0;
212 virtual int GetPropertyLowerLimit(const char* name, double& lowLimit) const = 0;
213 virtual int GetPropertyUpperLimit(const char* name, double& hiLimit) const = 0;
214 virtual int GetPropertyType(const char* name, MM::PropertyType& pt) const = 0;
215 virtual unsigned GetNumberOfPropertyValues(const char* propertyName) const = 0;
216 virtual bool GetPropertyValueAt(const char* propertyName, unsigned index, char* value) const = 0;
227 virtual int IsPropertySequenceable(const char* name, bool& isSequenceable) const = 0;
231 virtual int GetPropertySequenceMaxLength(const char* propertyName, long& nrEvents) const = 0;
235 virtual int StartPropertySequence(const char* propertyName) = 0;
239 virtual int StopPropertySequence(const char* propertyName) = 0;
243 virtual int ClearPropertySequence(const char* propertyName) = 0;
247 virtual int AddToPropertySequence(const char* propertyName, const char* value) = 0;
252 virtual int SendPropertySequence(const char* propertyName) = 0;
253
254 virtual bool GetErrorText(int errorCode, char* errMessage) const = 0;
255 virtual bool Busy() = 0;
256 virtual double GetDelayMs() const = 0;
257 virtual void SetDelayMs(double delay) = 0;
258 virtual bool UsesDelay() = 0;
259
260 virtual void SetLabel(const char* label) = 0;
261 virtual void GetLabel(char* name) const = 0;
262 virtual void SetModuleName(const char* moduleName) = 0;
263 virtual void GetModuleName(char* moduleName) const = 0;
264 virtual void SetDescription(const char* description) = 0;
265 virtual void GetDescription(char* description) const = 0;
266
267 virtual int Initialize() = 0;
277 virtual int Shutdown() = 0;
278
279 virtual DeviceType GetType() const = 0;
280 virtual void GetName(char* name) const = 0;
281 virtual void SetCallback(Core* callback) = 0;
282
283 //device discovery API
284 virtual bool SupportsDeviceDetection(void) = 0;
286
287 // hub-peripheral relationship
288 virtual void SetParentID(const char* parentId) = 0;
289 virtual void GetParentID(char* parentID) const = 0;
290 // virtual void SetID(const char* id) = 0;
291 // virtual void GetID(char* id) const = 0;
292 };
293
297 class Generic : public Device
298 {
299 public:
300 virtual DeviceType GetType() const { return Type; }
301 static const DeviceType Type;
302 };
303
307 class Camera : public Device {
308 public:
310 virtual ~Camera() {}
311
312 virtual DeviceType GetType() const { return Type; }
313 static const DeviceType Type;
314
315 // Camera API
325 virtual int SnapImage() = 0;
350 virtual const unsigned char* GetImageBuffer() = 0;
364 virtual const unsigned char* GetImageBuffer(unsigned channelNr) = 0;
368 virtual const unsigned int* GetImageBufferAsRGB32() = 0;
374 virtual unsigned GetNumberOfComponents() const = 0;
375
382 virtual int unsigned GetNumberOfChannels() const = 0;
388 virtual int GetChannelName(unsigned channel, char* name) = 0;
395 virtual long GetImageBufferSize() const = 0;
401 virtual unsigned GetImageWidth() const = 0;
407 virtual unsigned GetImageHeight() const = 0;
413 virtual unsigned GetImageBytesPerPixel() const = 0;
421 virtual unsigned GetBitDepth() const = 0;
425 virtual int GetBinning() const = 0;
429 virtual int SetBinning(int binSize) = 0;
433 virtual void SetExposure(double exp_ms) = 0;
437 virtual double GetExposure() const = 0;
453 virtual int SetROI(unsigned x, unsigned y, unsigned xSize, unsigned ySize) = 0;
457 virtual int GetROI(unsigned& x, unsigned& y, unsigned& xSize, unsigned& ySize) = 0;
461 virtual int ClearROI() = 0;
462 virtual bool SupportsMultiROI() = 0;
463 virtual bool IsMultiROISet() = 0;
464 virtual int GetMultiROICount(unsigned& count) = 0;
465 virtual int SetMultiROI(const unsigned* xs, const unsigned* ys,
466 const unsigned* widths, const unsigned* heights,
467 unsigned numROIs) = 0;
468 virtual int GetMultiROI(unsigned* xs, unsigned* ys, unsigned* widths,
469 unsigned* heights, unsigned* length) = 0;
473 virtual int StartSequenceAcquisition(long numImages, double interval_ms, bool stopOnOverflow) = 0;
479 virtual int StartSequenceAcquisition(double interval_ms) = 0;
483 virtual int StopSequenceAcquisition() = 0;
489 virtual bool IsCapturing() = 0;
490
497 virtual void GetTags(char* serializedMetadata) = 0;
498
507 virtual void AddTag(const char* key, const char* deviceLabel, const char* value) = 0;
508
515 virtual void RemoveTag(const char* key) = 0;
516
523 virtual int IsExposureSequenceable(bool& isSequenceable) const = 0;
524
525 // Sequence functions
526 // Sequences can be used for fast acquisitions, synchronized by TTLs rather than
527 // computer commands.
528 // Sequences of exposures can be uploaded to the camera. The camera will cycle through
529 // the uploaded list of exposures (triggered by either an internal or
530 // external trigger). If the device is capable (and ready) to do so isSequenceable will
531 // be true. If your device can not execute this (true for most cameras)
532 // simply set IsExposureSequenceable to false
533 virtual int GetExposureSequenceMaxLength(long& nrEvents) const = 0;
534 virtual int StartExposureSequence() = 0;
535 virtual int StopExposureSequence() = 0;
536 // Remove all values in the sequence
537 virtual int ClearExposureSequence() = 0;
538 // Add one value to the sequence
539 virtual int AddToExposureSequence(double exposureTime_ms) = 0;
540 // Signal that we are done sending sequence values so that the adapter can send the whole sequence to the device
541 virtual int SendExposureSequence() const = 0;
542 };
543
547 class Shutter : public Device
548 {
549 public:
551 virtual ~Shutter() {}
552
553 // Device API
554 virtual DeviceType GetType() const { return Type; }
555 static const DeviceType Type;
556
557 // Shutter API
558 virtual int SetOpen(bool open = true) = 0;
559 virtual int GetOpen(bool& open) = 0;
565 virtual int Fire(double deltaT) = 0;
566 };
567
571 class Stage : public Device
572 {
573 public:
574 Stage() {}
575 virtual ~Stage() {}
576
577 // Device API
578 virtual DeviceType GetType() const { return Type; }
579 static const DeviceType Type;
580
581 // Stage API
582 virtual int SetPositionUm(double pos) = 0;
583 virtual int SetRelativePositionUm(double d) = 0;
584 virtual int Move(double velocity) = 0;
585 virtual int Stop() = 0;
586 virtual int Home() = 0;
587 virtual int SetAdapterOriginUm(double d) = 0;
588 virtual int GetPositionUm(double& pos) = 0;
589 virtual int SetPositionSteps(long steps) = 0;
590 virtual int GetPositionSteps(long& steps) = 0;
591 virtual int SetOrigin() = 0;
592 virtual int GetLimits(double& lower, double& upper) = 0;
593
603 virtual int UsesOnStagePositionChanged(bool& result) const = 0;
604
618 virtual int GetFocusDirection(FocusDirection& direction) = 0;
619
628 virtual int IsStageSequenceable(bool& isSequenceable) const = 0;
629
637 virtual int IsStageLinearSequenceable(bool& isSequenceable) const = 0;
638
639 // Check if a stage has continuous focusing capability (positions can be set while continuous focus runs).
640 virtual bool IsContinuousFocusDrive() const = 0;
641
642 // Sequence functions
643 // Sequences can be used for fast acquisitions, synchronized by TTLs rather than
644 // computer commands.
645 // Sequences of positions can be uploaded to the stage. The device will cycle through
646 // the uploaded list of states (triggered by an external trigger - most often coming
647 // from the camera). If the device is capable (and ready) to do so isSequenceable will
648 // be true. If your device can not execute this (true for most stages)
649 // simply set isSequenceable to false
650 virtual int GetStageSequenceMaxLength(long& nrEvents) const = 0;
651 virtual int StartStageSequence() = 0;
652 virtual int StopStageSequence() = 0;
656 virtual int ClearStageSequence() = 0;
660 virtual int AddToStageSequence(double position) = 0;
665 virtual int SendStageSequence() = 0;
666
675 virtual int SetStageLinearSequence(double dZ_um, long nSlices) = 0;
676 };
677
681 class XYStage : public Device
682 {
683 public:
685 virtual ~XYStage() {}
686
687 // Device API
688 virtual DeviceType GetType() const { return Type; }
689 static const DeviceType Type;
690
691 // XYStage API
692 // it is recommended that device adapters implement the "Steps" methods
693 // taking long integers but leave the default implementations (in
694 // DeviceBase.h) for the "Um" methods taking doubles. The latter utilize
695 // directionality and origin settings set by user and operate via the
696 // "Steps" methods. The step size is the inherent minimum distance/step
697 // and should be defined by the adapter.
698 virtual int SetPositionUm(double x, double y) = 0;
699 virtual int SetRelativePositionUm(double dx, double dy) = 0;
700 virtual int SetAdapterOriginUm(double x, double y) = 0;
701 virtual int GetPositionUm(double& x, double& y) = 0;
702 virtual int GetLimitsUm(double& xMin, double& xMax, double& yMin, double& yMax) = 0;
703 virtual int Move(double vx, double vy) = 0;
704
705 virtual int SetPositionSteps(long x, long y) = 0;
706 virtual int GetPositionSteps(long& x, long& y) = 0;
707 virtual int SetRelativePositionSteps(long x, long y) = 0;
708 virtual int Home() = 0;
709 virtual int Stop() = 0;
710
720 virtual int UsesOnXYStagePositionChanged(bool &result) const = 0;
721
725 virtual int SetOrigin() = 0;
726
732 virtual int SetXOrigin() = 0;
733
739 virtual int SetYOrigin() = 0;
740
741 virtual int GetStepLimits(long& xMin, long& xMax, long& yMin, long& yMax) = 0;
742 virtual double GetStepSizeXUm() = 0;
743 virtual double GetStepSizeYUm() = 0;
750 virtual int IsXYStageSequenceable(bool& isSequenceable) const = 0;
751 // Sequence functions
752 // Sequences can be used for fast acquisitions, synchronized by TTLs rather than
753 // computer commands.
754 // Sequences of positions can be uploaded to the XY stage. The device will cycle through
755 // the uploaded list of states (triggered by an external trigger - most often coming
756 // from the camera). If the device is capable (and ready) to do so isSequenceable will
757 // be true. If your device can not execute this (true for most XY stages
758 // simply set isSequenceable to false
759 virtual int GetXYStageSequenceMaxLength(long& nrEvents) const = 0;
760 virtual int StartXYStageSequence() = 0;
761 virtual int StopXYStageSequence() = 0;
765 virtual int ClearXYStageSequence() = 0;
769 virtual int AddToXYStageSequence(double positionX, double positionY) = 0;
774 virtual int SendXYStageSequence() = 0;
775
776 };
777
781 class State : public Device
782 {
783 public:
784 State() {}
785 virtual ~State() {}
786
787 // MMDevice API
788 virtual DeviceType GetType() const { return Type; }
789 static const DeviceType Type;
790
791 // MMStateDevice API
792 virtual int SetPosition(long pos) = 0;
793 virtual int SetPosition(const char* label) = 0;
794 virtual int GetPosition(long& pos) const = 0;
795 virtual int GetPosition(char* label) const = 0;
796 virtual int GetPositionLabel(long pos, char* label) const = 0;
797 virtual int GetLabelPosition(const char* label, long& pos) const = 0;
798 virtual int SetPositionLabel(long pos, const char* label) = 0;
799 virtual unsigned long GetNumberOfPositions() const = 0;
800 virtual int SetGateOpen(bool open = true) = 0;
801 virtual int GetGateOpen(bool& open) = 0;
802 };
803
807 class Serial : public Device
808 {
809 public:
811 virtual ~Serial() {}
812
813 // MMDevice API
814 virtual DeviceType GetType() const { return Type; }
815 static const DeviceType Type;
816
817 // Serial API
818 virtual PortType GetPortType() const = 0;
819 virtual int SetCommand(const char* command, const char* term) = 0;
820 virtual int GetAnswer(char* txt, unsigned maxChars, const char* term) = 0;
821 virtual int Write(const unsigned char* buf, unsigned long bufLen) = 0;
822 virtual int Read(unsigned char* buf, unsigned long bufLen, unsigned long& charsRead) = 0;
823 virtual int Purge() = 0;
824 };
825
829 class AutoFocus : public Device
830 {
831 public:
833 virtual ~AutoFocus() {}
834
835 // MMDevice API
836 virtual DeviceType GetType() const { return Type; }
837 static const DeviceType Type;
838
839 // AutoFocus API
840 virtual int SetContinuousFocusing(bool state) = 0;
841 virtual int GetContinuousFocusing(bool& state) = 0;
842 virtual bool IsContinuousFocusLocked() = 0;
843 virtual int FullFocus() = 0;
844 virtual int IncrementalFocus() = 0;
845 virtual int GetLastFocusScore(double& score) = 0;
846 virtual int GetCurrentFocusScore(double& score) = 0;
847 virtual int AutoSetParameters() = 0;
848 virtual int GetOffset(double &offset) = 0;
849 virtual int SetOffset(double offset) = 0;
850 };
851
855 class ImageProcessor : public Device
856 {
857 public:
859 virtual ~ImageProcessor() {}
860
861 // MMDevice API
862 virtual DeviceType GetType() const { return Type; }
863 static const DeviceType Type;
864
865 // image processor API
866 virtual int Process(unsigned char* buffer, unsigned width, unsigned height, unsigned byteDepth) = 0;
867
868
869 };
870
874 class SignalIO : public Device
875 {
876 public:
878 virtual ~SignalIO() {}
879
880 // MMDevice API
881 virtual DeviceType GetType() const { return Type; }
882 static const DeviceType Type;
883
884 // signal io API
885 virtual int SetGateOpen(bool open = true) = 0;
886 virtual int GetGateOpen(bool& open) = 0;
887 virtual int SetSignal(double volts) = 0;
888 virtual int GetSignal(double& volts) = 0;
889 virtual int GetLimits(double& minVolts, double& maxVolts) = 0;
890
905 virtual int IsDASequenceable(bool& isSequenceable) const = 0;
906
907 // Sequence functions
908 // Sequences can be used for fast acquisitions, synchronized by TTLs rather than
909 // computer commands.
910 // Sequences of voltages can be uploaded to the DA. The device will cycle through
911 // the uploaded list of voltages (triggered by an external trigger - most often coming
912 // from the camera). If the device is capable (and ready) to do so isSequenceable will
913 // be true. If your device can not execute this simply set isSequenceable to false
920 virtual int GetDASequenceMaxLength(long& nrEvents) const = 0;
927 virtual int StartDASequence() = 0;
933 virtual int StopDASequence() = 0;
944 virtual int ClearDASequence() = 0;
945
954 virtual int AddToDASequence(double voltage) = 0;
963 virtual int SendDASequence() = 0;
964
965 };
966
970 class Magnifier : public Device
971 {
972 public:
974 virtual ~Magnifier() {}
975
976 // MMDevice API
977 virtual DeviceType GetType() const { return Type; }
978 static const DeviceType Type;
979
980 virtual double GetMagnification() = 0;
981 };
982
983
993 class SLM : public Device
994 {
995 public:
996 SLM() {}
997 virtual ~SLM() {}
998
999 virtual DeviceType GetType() const { return Type; }
1000 static const DeviceType Type;
1001
1002 // SLM API
1006 virtual int SetImage(unsigned char * pixels) = 0;
1007
1011 virtual int SetImage(unsigned int * pixels) = 0;
1012
1016 virtual int DisplayImage() = 0;
1017
1021 virtual int SetPixelsTo(unsigned char intensity) = 0;
1022
1026 virtual int SetPixelsTo(unsigned char red, unsigned char green, unsigned char blue) = 0;
1027
1031 virtual int SetExposure(double interval_ms) = 0;
1032
1036 virtual double GetExposure() = 0;
1037
1041 virtual unsigned GetWidth() = 0;
1042
1046 virtual unsigned GetHeight() = 0;
1047
1051 virtual unsigned GetNumberOfComponents() = 0;
1052
1056 virtual unsigned GetBytesPerPixel() = 0;
1057
1058 // SLM Sequence functions
1059 // Sequences can be used for fast acquisitions, synchronized by TTLs rather than
1060 // computer commands.
1061 // Sequences of images can be uploaded to the SLM. The SLM will cycle through
1062 // the uploaded list of images (perhaps triggered by an external trigger or by
1063 // an internal clock.
1064 // If the device is capable (and ready) to do so IsSLMSequenceable will return
1065 // be true. If your device can not execute sequences, IsSLMSequenceable returns false.
1066
1081 virtual int IsSLMSequenceable(bool& isSequenceable) const = 0;
1082
1089 virtual int GetSLMSequenceMaxLength(long& nrEvents) const = 0;
1090
1097 virtual int StartSLMSequence() = 0;
1098
1104 virtual int StopSLMSequence() = 0;
1105
1117 virtual int ClearSLMSequence() = 0;
1118
1128 virtual int AddToSLMSequence(const unsigned char * const pixels) = 0;
1129
1139 virtual int AddToSLMSequence(const unsigned int * const pixels) = 0;
1140
1149 virtual int SendSLMSequence() = 0;
1150
1151 };
1152
1167 class Galvo : public Device
1168 {
1169 public:
1171 virtual ~Galvo() {}
1172
1173 virtual DeviceType GetType() const { return Type; }
1174 static const DeviceType Type;
1175
1176 //Galvo API:
1177
1185 virtual int PointAndFire(double x, double y, double time_us) = 0;
1196 virtual int SetSpotInterval(double pulseInterval_us) = 0;
1203 virtual int SetPosition(double x, double y) = 0;
1211 virtual int GetPosition(double& x, double& y) = 0;
1220 virtual int SetIlluminationState(bool on) = 0;
1224 virtual double GetXRange() = 0;
1230 virtual double GetXMinimum() = 0;
1234 virtual double GetYRange() = 0;
1240 virtual double GetYMinimum() = 0;
1253 virtual int AddPolygonVertex(int polygonIndex, double x, double y) = 0;
1259 virtual int DeletePolygons() = 0;
1272 virtual int RunSequence() = 0;
1282 virtual int LoadPolygons() = 0;
1289 virtual int SetPolygonRepetitions(int repetitions) = 0;
1296 virtual int RunPolygons() = 0;
1303 virtual int StopSequence() = 0;
1311 virtual int GetChannel(char* channelName) = 0;
1312 };
1313
1320 class Hub : public Device
1321 {
1322 public:
1323 Hub() {}
1324 virtual ~Hub() {}
1325
1326 // MMDevice API
1327 virtual DeviceType GetType() const { return Type; }
1328 static const DeviceType Type;
1329
1342 virtual int DetectInstalledDevices() = 0;
1343
1352 virtual void ClearInstalledDevices() = 0;
1353
1360 virtual unsigned GetNumberOfInstalledDevices() = 0;
1361
1369 virtual Device* GetInstalledDevice(int devIdx) = 0;
1370 };
1371
1375 class PressurePump : public Device
1376 {
1377 public:
1379 virtual ~PressurePump() {}
1380
1381 // MMDevice API
1382 virtual DeviceType GetType() const { return Type; }
1383 static const DeviceType Type;
1384
1393 virtual int Stop() = 0;
1394
1403 virtual int Calibrate() = 0;
1404
1412 virtual bool RequiresCalibration() = 0;
1413
1422 virtual int SetPressureKPa(double pressureKPa) = 0;
1423
1432 virtual int GetPressureKPa(double& pressureKPa) = 0;
1433 };
1434
1438 class VolumetricPump : public Device
1439 {
1440 public:
1442 virtual ~VolumetricPump() {}
1443
1444 // MMDevice API
1445 virtual DeviceType GetType() const { return Type; }
1446 static const DeviceType Type;
1447
1455 virtual int Home() = 0;
1456
1465 virtual int Stop() = 0;
1466
1472 virtual bool RequiresHoming() = 0;
1473
1486 virtual int InvertDirection(bool inverted) = 0;
1487
1499 virtual int IsDirectionInverted(bool& inverted) = 0;
1500
1506 virtual int SetVolumeUl(double volUl) = 0;
1507
1513 virtual int GetVolumeUl(double& volUl) = 0;
1514
1520 virtual int SetMaxVolumeUl(double volUl) = 0;
1521
1527 virtual int GetMaxVolumeUl(double& volUl) = 0;
1528
1537 virtual int SetFlowrateUlPerSecond(double flowrate) = 0;
1538
1544 virtual int GetFlowrateUlPerSecond(double& flowrate) = 0;
1545
1552 virtual int Start() = 0;
1553
1563 virtual int DispenseDurationSeconds(double durSec) = 0;
1564
1580 virtual int DispenseVolumeUl(double volUl) = 0;
1581 };
1582
1583
1589 class Core
1590 {
1591 public:
1592 Core() {}
1593 virtual ~Core() {}
1594
1602 virtual int LogMessage(const Device* caller, const char* msg, bool debugOnly) const = 0;
1609 virtual Device* GetDevice(const Device* caller, const char* label) = 0;
1610 virtual int GetDeviceProperty(const char* deviceName, const char* propName, char* value) = 0;
1611 virtual int SetDeviceProperty(const char* deviceName, const char* propName, const char* value) = 0;
1612
1624 virtual void GetLoadedDeviceOfType(const Device* caller, MM::DeviceType devType, char* pDeviceName, const unsigned int deviceIterator) = 0;
1625
1626 virtual int SetSerialProperties(const char* portName,
1627 const char* answerTimeout,
1628 const char* baudRate,
1629 const char* delayBetweenCharsMs,
1630 const char* handshaking,
1631 const char* parity,
1632 const char* stopBits) = 0;
1633 virtual int SetSerialCommand(const Device* caller, const char* portName, const char* command, const char* term) = 0;
1634 virtual int GetSerialAnswer(const Device* caller, const char* portName, unsigned long ansLength, char* answer, const char* term) = 0;
1635 virtual int WriteToSerial(const Device* caller, const char* port, const unsigned char* buf, unsigned long length) = 0;
1636 virtual int ReadFromSerial(const Device* caller, const char* port, unsigned char* buf, unsigned long length, unsigned long& read) = 0;
1637 virtual int PurgeSerial(const Device* caller, const char* portName) = 0;
1638 virtual MM::PortType GetSerialPortType(const char* portName) const = 0;
1639
1640 virtual int OnPropertiesChanged(const Device* caller) = 0;
1647 virtual int OnPropertyChanged(const Device* caller, const char* propName, const char* propValue) = 0;
1653 virtual int OnStagePositionChanged(const Device* caller, double pos) = 0;
1659 virtual int OnXYStagePositionChanged(const Device* caller, double xPos, double yPos) = 0;
1663 virtual int OnExposureChanged(const Device* caller, double newExposure) = 0;
1667 virtual int OnSLMExposureChanged(const Device* caller, double newExposure) = 0;
1671 virtual int OnMagnifierChanged(const Device* caller) = 0;
1675 virtual int OnShutterOpenChanged(const Device* caller, bool open) = 0;
1676
1677 // Deprecated: Return value overflows in ~72 minutes on Windows.
1678 // Prefer std::chrono::steady_clock for time delta measurements.
1679 virtual unsigned long GetClockTicksUs(const Device* caller) = 0;
1680
1681 // Returns monotonic MMTime suitable for time delta measurements.
1682 // Time zero is not fixed and may change on every launch.
1683 // Prefer std::chrono::steady_clock::now() in new code.
1685
1686 // sequence acquisition
1687 virtual int AcqFinished(const Device* caller, int statusCode) = 0;
1688 virtual int PrepareForAcq(const Device* caller) = 0;
1689
1713 virtual int InsertImage(const Device* caller, const unsigned char* buf,
1714 unsigned width, unsigned height, unsigned bytePerPixel, unsigned nComponents,
1715 const char* serializedMetadata = nullptr) = 0;
1716
1723 virtual int InsertImage(const Device* caller, const unsigned char* buf,
1724 unsigned width, unsigned height, unsigned bytePerPixel,
1725 const char* serializedMetadata = nullptr) = 0;
1726
1733 virtual bool InitializeImageBuffer(unsigned channels, unsigned slices, unsigned int w, unsigned int h, unsigned int pixDepth) = 0;
1734
1735 // These functions violate the separation between device adapters and
1736 // will be removed as soon as we remove all uses. Never use in new code.
1737 MMDEVICE_DEPRECATED virtual int GetFocusPosition(double& pos) = 0;
1738 MMDEVICE_DEPRECATED virtual MM::SignalIO* GetSignalIODevice(const MM::Device* caller, const char* deviceName) = 0;
1739
1740 virtual MM::Hub* GetParentHub(const MM::Device* caller) const = 0;
1741 };
1742
1743} // namespace MM
#define MMDEVICE_DEPRECATED
Definition MMDeviceConstants.h:28
Auto-focus device API.
Definition MMDevice.h:830
virtual int SetOffset(double offset)=0
virtual int GetLastFocusScore(double &score)=0
AutoFocus()
Definition MMDevice.h:832
virtual ~AutoFocus()
Definition MMDevice.h:833
static const DeviceType Type
Definition MMDevice.h:837
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:836
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:307
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:310
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:309
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:312
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:313
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:1590
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:1593
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:1592
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:199
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:201
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:202
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:1168
virtual ~Galvo()
Definition MMDevice.h:1171
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:1174
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:1170
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:1173
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:298
static const DeviceType Type
Definition MMDevice.h:301
virtual DeviceType GetType() const
Definition MMDevice.h:300
HUB device.
Definition MMDevice.h:1321
virtual ~Hub()
Definition MMDevice.h:1324
Hub()
Definition MMDevice.h:1323
static const DeviceType Type
Definition MMDevice.h:1328
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:1327
virtual int DetectInstalledDevices()=0
Instantiate all available child peripheral devices.
Image processor API.
Definition MMDevice.h:856
ImageProcessor()
Definition MMDevice.h:858
virtual DeviceType GetType() const
Definition MMDevice.h:862
virtual int Process(unsigned char *buffer, unsigned width, unsigned height, unsigned byteDepth)=0
virtual ~ImageProcessor()
Definition MMDevice.h:859
static const DeviceType Type
Definition MMDevice.h:863
Utility class used both MMCore and devices to maintain time intervals in the uniform,...
Definition MMDevice.h:65
static MMTime fromMs(double ms)
Definition MMDevice.h:91
MMTime()
Definition MMDevice.h:69
MMTime operator+(const MMTime &other) const
Definition MMDevice.h:101
bool operator!=(const MMTime &other) const
Definition MMDevice.h:136
double getMsec() const
Definition MMDevice.h:141
bool operator<=(const MMTime &other) const
Definition MMDevice.h:126
bool operator>=(const MMTime &other) const
Definition MMDevice.h:116
std::string toString() const
Definition MMDevice.h:151
MMTime(double uSecTotal)
Definition MMDevice.h:71
bool operator==(const MMTime &other) const
Definition MMDevice.h:131
static MMTime fromUs(long long us)
Definition MMDevice.h:79
MMTime operator-(const MMTime &other) const
Definition MMDevice.h:106
static MMTime fromSeconds(long secs)
Definition MMDevice.h:96
MMTime(long sec, long uSec)
Definition MMDevice.h:75
bool operator>(const MMTime &other) const
Definition MMDevice.h:111
bool operator<(const MMTime &other) const
Definition MMDevice.h:121
double getUsec() const
Definition MMDevice.h:146
Devices that can change magnification of the system.
Definition MMDevice.h:971
virtual ~Magnifier()
Definition MMDevice.h:974
static const DeviceType Type
Definition MMDevice.h:978
virtual double GetMagnification()=0
Magnifier()
Definition MMDevice.h:973
virtual DeviceType GetType() const
Definition MMDevice.h:977
Pressure Pump API.
Definition MMDevice.h:1376
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:1382
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:1378
virtual int Calibrate()=0
Calibrate the pressure controller.
virtual ~PressurePump()
Definition MMDevice.h:1379
static const DeviceType Type
Definition MMDevice.h:1383
Spatial Light Modulator (SLM) API.
Definition MMDevice.h:994
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:996
virtual double GetExposure()=0
Get the exposure interval of an SLM.
static const DeviceType Type
Definition MMDevice.h:1000
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:997
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:999
virtual unsigned GetWidth()=0
Get the SLM width in pixels.
Serial port API.
Definition MMDevice.h:808
virtual int Write(const unsigned char *buf, unsigned long bufLen)=0
virtual ~Serial()
Definition MMDevice.h:811
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:815
Serial()
Definition MMDevice.h:810
virtual int GetAnswer(char *txt, unsigned maxChars, const char *term)=0
virtual DeviceType GetType() const
Definition MMDevice.h:814
Shutter API.
Definition MMDevice.h:548
virtual int Fire(double deltaT)=0
Open the shutter for the given duration, then close it again.
Shutter()
Definition MMDevice.h:550
virtual DeviceType GetType() const
Definition MMDevice.h:554
virtual int SetOpen(bool open=true)=0
virtual ~Shutter()
Definition MMDevice.h:551
static const DeviceType Type
Definition MMDevice.h:555
virtual int GetOpen(bool &open)=0
ADC and DAC interface.
Definition MMDevice.h:875
static const DeviceType Type
Definition MMDevice.h:882
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:881
SignalIO()
Definition MMDevice.h:877
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:878
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:572
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:575
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:579
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:574
virtual DeviceType GetType() const
Definition MMDevice.h:578
virtual int Home()=0
State device API, e.g. filter wheel, objective turret, etc.
Definition MMDevice.h:782
virtual DeviceType GetType() const
Definition MMDevice.h:788
virtual int GetPositionLabel(long pos, char *label) const =0
virtual int SetPosition(const char *label)=0
static const DeviceType Type
Definition MMDevice.h:789
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:785
virtual unsigned long GetNumberOfPositions() const =0
virtual int SetGateOpen(bool open=true)=0
State()
Definition MMDevice.h:784
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:170
TimeoutMs(const MMTime startTime, const MMTime interval)
Definition MMDevice.h:178
bool expired(const MMTime tnow)
Definition MMDevice.h:184
TimeoutMs(const MMTime startTime, const unsigned long intervalMs)
Definition MMDevice.h:173
Volumetric Pump API.
Definition MMDevice.h:1439
virtual int Home()=0
Home the pump.
virtual DeviceType GetType() const
Definition MMDevice.h:1445
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:1442
virtual int Start()=0
Start dispensing/withdrawing until the minimum or maximum volume has been reached,...
VolumetricPump()
Definition MMDevice.h:1441
static const DeviceType Type
Definition MMDevice.h:1446
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:682
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:689
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:688
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:685
virtual int SetRelativePositionUm(double dx, double dy)=0
XYStage()
Definition MMDevice.h:684
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