Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions DeviceAdapters/DemoCamera/DemoCamera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ CDemoCamera::CDemoCamera() :
fractionOfPixelsToDropOrSaturate_(0.002),
shouldRotateImages_(false),
shouldDisplayImageNumber_(false),
busy_(false),
imageCounter_(0),
stopOnOverFlow_(true),
stripeWidth_(1.0),
supportsMultiROI_(false),
multiROIFillValue_(0),
Expand Down Expand Up @@ -3061,9 +3064,10 @@ int CDemoStateDevice::OnNumberOfStates(MM::PropertyBase* pProp, MM::ActionType e
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CDemoLightPath::CDemoLightPath() :
numPos_(3),
busy_(false),
initialized_(false)
position_(0),
numPos_(3),
busy_(false),
initialized_(false)
{
InitializeDefaultErrorMessages();
// parent ID display
Expand Down Expand Up @@ -3180,10 +3184,12 @@ int CDemoLightPath::OnState(MM::PropertyBase* pProp, MM::ActionType eAct)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

CDemoObjectiveTurret::CDemoObjectiveTurret() :
position_(0),
numPos_(6),
busy_(false),
initialized_(false),
sequenceRunning_(false),
sequenceIndex_(0),
sequenceMaxSize_(10)
{
SetErrorText(ERR_IN_SEQUENCE, "Error occurred while executing sequence");
Expand Down Expand Up @@ -3594,6 +3600,11 @@ posX_um_(0.0),
posY_um_(0.0),
timeOutTimer_(0),
velocity_(10.0), // in mm per second (= um/ms)
moveDuration_ms_(100),
startPosX_um_(0.0),
startPosY_um_(0.),
targetPosX_um_(0.0),
targetPosY_um_(0.),
initialized_(false),
lowerLimit_(0.0),
upperLimit_(20000.0)
Expand Down Expand Up @@ -3903,6 +3914,7 @@ int DemoShutter::OnState(MM::PropertyBase* pProp, MM::ActionType eAct)

// apply the value
state_ = pos == 0 ? false : true;
GetCoreCallback()->OnShutterOpenChanged(this, state_);
}

return DEVICE_OK;
Expand Down
1 change: 1 addition & 0 deletions DeviceAdapters/DemoCamera/DemoCamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ class DemoShutter : public CShutterBase<DemoShutter>
{
state_ = open;
changedTime_ = GetCurrentMMTime();
GetCoreCallback()->OnShutterOpenChanged(this, open);
return DEVICE_OK;
}
int GetOpen(bool& open)
Expand Down
7 changes: 5 additions & 2 deletions DeviceAdapters/Utilities/DAShutter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,12 @@ bool DAShutter::Busy()
int DAShutter::SetOpen(bool open)
{
MM::SignalIO* da = (MM::SignalIO*)GetDevice(DADeviceName_.c_str());
int ret = DEVICE_OK;
if (da != 0)
return da->SetGateOpen(open);
return DEVICE_OK;
ret = da->SetGateOpen(open);
if (ret == DEVICE_OK)
GetCoreCallback()->OnShutterOpenChanged(this, open);
return ret;
}

int DAShutter::GetOpen(bool& open)
Expand Down
1 change: 1 addition & 0 deletions DeviceAdapters/Utilities/MultiShutter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ int MultiShutter::SetOpen(bool open)
}
}
open_ = open;
GetCoreCallback()->OnShutterOpenChanged(this, open);
return DEVICE_OK;
}

Expand Down
13 changes: 13 additions & 0 deletions MMCore/CoreCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,19 @@ int CoreCallback::OnMagnifierChanged(const MM::Device* /* device */)
return DEVICE_OK;
}

/**
* Handler for Shutter State changes.
*
*/
int CoreCallback::OnShutterOpenChanged(const MM::Device* device, bool state)
{
if (core_->externalCallback_) {
char label[MM::MaxStrLength];
device->GetLabel(label);
core_->externalCallback_->onShutterOpenChanged(label, state);
}
return DEVICE_OK;
}


int CoreCallback::SetSerialProperties(const char* portName,
Expand Down
1 change: 1 addition & 0 deletions MMCore/CoreCallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class CoreCallback : public MM::Core
int OnExposureChanged(const MM::Device* device, double newExposure);
int OnSLMExposureChanged(const MM::Device* device, double newExposure);
int OnMagnifierChanged(const MM::Device* device);
int OnShutterOpenChanged(const MM::Device* device, bool open);


void NextPostedError(int& errorCode, char* pMessage, int maxlen, int& messageLength);
Expand Down
2 changes: 1 addition & 1 deletion MMCore/MMCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
* (Keep the 3 numbers on one line to make it easier to look at diffs when
* merging/rebasing.)
*/
const int MMCore_versionMajor = 11, MMCore_versionMinor = 9, MMCore_versionPatch = 0;
const int MMCore_versionMajor = 11, MMCore_versionMinor = 10, MMCore_versionPatch = 0;


///////////////////////////////////////////////////////////////////////////////
Expand Down
5 changes: 5 additions & 0 deletions MMCore/MMEventCallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ class MMEventCallback
std::cout << "onExposureChanged()" << name << " " << newExposure << '\n';
}

virtual void onShutterOpenChanged(const char* name, bool open)
{
std::cout << "onShutterOpenChanged()" << name << " " << open << '\n';
}

virtual void onSLMExposureChanged(const char* name, double newExposure)
{
std::cout << "onSLMExposureChanged()" << name << " " << newExposure << '\n';
Expand Down
6 changes: 5 additions & 1 deletion MMDevice/MMDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// Header version
// If any of the class definitions changes, the interface version
// must be incremented
#define DEVICE_INTERFACE_VERSION 73
#define DEVICE_INTERFACE_VERSION 74
///////////////////////////////////////////////////////////////////////////////

// N.B.
Expand Down Expand Up @@ -1571,6 +1571,10 @@ namespace MM {
* Magnifiers can use this to signal changes in magnification
*/
virtual int OnMagnifierChanged(const Device* caller) = 0;
/**
* Signals that the shutter opened or closed
*/
virtual int OnShutterOpenChanged(const Device* caller, bool open) = 0;

// Deprecated: Return value overflows in ~72 minutes on Windows.
// Prefer std::chrono::steady_clock for time delta measurements.
Expand Down