@@ -3488,7 +3488,7 @@ void CMMCore::loadPropertySequence(const char* label, const char* propName, std:
34883488 if (ret != DEVICE_OK)
34893489 throw CMMError (getDeviceErrorText (ret, pDevice));
34903490
3491- std::vector<std::string>::iterator it;
3491+ std::vector<std::string>::iterator it;
34923492 for (std::vector<std::string>::const_iterator it = eventSequence.begin (),
34933493 end = eventSequence.end ();
34943494 it < end; ++it)
@@ -5011,9 +5011,7 @@ void CMMCore::setSLMImage(const char* deviceLabel, unsigned char* pixels) throw
50115011 MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
50125012 if (!pixels)
50135013 throw CMMError (" Null image" );
5014-
50155014 MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
5016-
50175015 int ret = pSLM->SetImage (pixels);
50185016 if (ret != DEVICE_OK)
50195017 {
@@ -5030,9 +5028,7 @@ void CMMCore::setSLMImage(const char* deviceLabel, imgRGB32 pixels) throw (CMMEr
50305028 MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
50315029 if (!pixels)
50325030 throw CMMError (" Null image" );
5033-
50345031 MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
5035-
50365032 int ret = pSLM->SetImage ((unsigned int *) pixels);
50375033 if (ret != DEVICE_OK)
50385034 {
@@ -5047,9 +5043,7 @@ void CMMCore::setSLMImage(const char* deviceLabel, imgRGB32 pixels) throw (CMMEr
50475043void CMMCore::setSLMPixelsTo (const char * deviceLabel, unsigned char intensity) throw (CMMError)
50485044{
50495045 MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5050-
50515046 MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
5052-
50535047 int ret = pSLM->SetPixelsTo (intensity);
50545048 if (ret != DEVICE_OK)
50555049 {
@@ -5064,9 +5058,7 @@ void CMMCore::setSLMPixelsTo(const char* deviceLabel, unsigned char intensity) t
50645058void CMMCore::setSLMPixelsTo (const char * deviceLabel, unsigned char red, unsigned char green, unsigned char blue) throw (CMMError)
50655059{
50665060 MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5067-
50685061 MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
5069-
50705062 int ret = pSLM->SetPixelsTo (red, green, blue);
50715063 if (ret != DEVICE_OK)
50725064 {
@@ -5081,9 +5073,7 @@ void CMMCore::setSLMPixelsTo(const char* deviceLabel, unsigned char red, unsigne
50815073void CMMCore::displaySLMImage (const char * deviceLabel) throw (CMMError)
50825074{
50835075 MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5084-
50855076 MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
5086-
50875077 int ret = pSLM->DisplayImage ();
50885078 if (ret != DEVICE_OK)
50895079 {
@@ -5095,9 +5085,7 @@ void CMMCore::displaySLMImage(const char* deviceLabel) throw (CMMError)
50955085void CMMCore::setSLMExposure (const char * deviceLabel, double exposure_ms) throw (CMMError)
50965086{
50975087 MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5098-
50995088 MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
5100-
51015089 int ret = pSLM->SetExposure (exposure_ms);
51025090 if (ret != DEVICE_OK)
51035091 {
@@ -5109,47 +5097,93 @@ void CMMCore::setSLMExposure(const char* deviceLabel, double exposure_ms) throw
51095097double CMMCore::getSLMExposure (const char * deviceLabel) throw (CMMError)
51105098{
51115099 MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5112-
51135100 MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
5114-
51155101 return pSLM->GetExposure ();
51165102}
51175103
51185104
51195105unsigned CMMCore::getSLMWidth (const char * deviceLabel)
51205106{
51215107 MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5122-
51235108 MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
51245109 return pSLM->GetWidth ();
51255110}
51265111
51275112unsigned CMMCore::getSLMHeight (const char * deviceLabel)
51285113{
51295114 MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5130-
51315115 MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
51325116 return pSLM->GetHeight ();
51335117}
51345118
51355119unsigned CMMCore::getSLMNumberOfComponents (const char * deviceLabel)
51365120{
51375121 MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5138-
51395122 MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
51405123 return pSLM->GetNumberOfComponents ();
51415124}
51425125
51435126unsigned CMMCore::getSLMBytesPerPixel (const char * deviceLabel)
51445127{
51455128 MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5146-
51475129 MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
51485130 return pSLM->GetBytesPerPixel ();
51495131}
51505132
5151- /* GALVO CODE */
5133+ long CMMCore::getSLMSequenceMaxLength (const char * deviceLabel)
5134+ {
5135+ MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5136+ MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
5137+ long numEvents;
5138+ int ret = pSLM->GetSLMSequenceMaxLength (numEvents);
5139+ if (ret != DEVICE_OK)
5140+ throw CMMError (getDeviceErrorText (ret, pSLM));
5141+ return numEvents;
5142+ }
5143+
5144+ void CMMCore::startSLMSequence (const char * deviceLabel) throw (CMMError)
5145+ {
5146+ MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5147+ MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
5148+ int ret = pSLM->StartSLMSequence ();
5149+ if (ret != DEVICE_OK)
5150+ throw CMMError (getDeviceErrorText (ret, pSLM));
5151+ }
51525152
5153+ void CMMCore::stopSLMSequence (const char * deviceLabel) throw (CMMError)
5154+ {
5155+ MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5156+ MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
5157+ int ret = pSLM->StopSLMSequence ();
5158+ if (ret != DEVICE_OK)
5159+ throw CMMError (getDeviceErrorText (ret, pSLM));
5160+ }
5161+
5162+ void CMMCore::loadSLMSequence (const char * deviceLabel, std::vector<unsigned char *> imageSequence) throw (CMMError)
5163+ {
5164+ MM::SLM* pSLM = GetDeviceWithCheckedLabelAndType<MM::SLM>(deviceLabel);
5165+
5166+ MMThreadGuard guard (pluginManager_.getModuleLock (pSLM));
5167+ int ret = pSLM->ClearSLMSequence ();
5168+ if (ret != DEVICE_OK)
5169+ throw CMMError (getDeviceErrorText (ret, pSLM));
5170+
5171+ std::vector<unsigned char *>::iterator it;
5172+ for (std::vector<unsigned char *>::const_iterator it = imageSequence.begin (),
5173+ end = imageSequence.end ();
5174+ it < end; ++it)
5175+ {
5176+ ret = pSLM->AddToSLMSequence (*it);
5177+ if (ret != DEVICE_OK)
5178+ throw CMMError (getDeviceErrorText (ret, pSLM));
5179+ }
5180+
5181+ ret = pSLM->SendSLMSequence ();
5182+ if (ret != DEVICE_OK)
5183+ throw CMMError (getDeviceErrorText (ret, pSLM));
5184+ }
5185+
5186+ /* GALVO CODE */
51535187
51545188/* *
51555189 * Set the Galvo to an x,y position and fire the laser for a predetermined duration.
0 commit comments