Skip to content
Draft
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
23 changes: 22 additions & 1 deletion MMCore/CoreCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "CircularBuffer.h"
#include "CoreCallback.h"
#include "DeviceManager.h"
#include "DeviceConformance/SeqAcqTestMonitor.h"
#include "Notification.h"
#include "SynchronizedConfiguration.h"

Expand Down Expand Up @@ -227,6 +228,11 @@ int CoreCallback::InsertImage(const MM::Device* caller, const unsigned char* buf
unsigned width, unsigned height, unsigned bytesPerPixel, unsigned nComponents,
const char* serializedMetadata)
{
if (auto* monitor = core_->seqAcqTestMonitor_.load(std::memory_order_acquire)) {
if (monitor->IsMonitoring(caller))
return monitor->OnInsertImage();
}

Metadata origMd;
if (serializedMetadata)
{
Expand Down Expand Up @@ -267,8 +273,10 @@ bool CoreCallback::InitializeImageBuffer(unsigned channels, unsigned slices,
return core_->cbuf_->Initialize(w, h, pixDepth);
}

int CoreCallback::AcqFinished(const MM::Device* caller, int /*statusCode*/)
int CoreCallback::AcqFinished(const MM::Device* caller, int statusCode)
{
(void)statusCode;

std::shared_ptr<DeviceInstance> camera;
try
{
Expand All @@ -281,6 +289,13 @@ int CoreCallback::AcqFinished(const MM::Device* caller, int /*statusCode*/)
return DEVICE_ERR;
}

if (auto* monitor = core_->seqAcqTestMonitor_.load(std::memory_order_acquire)) {
if (monitor->IsMonitoring(caller)) {
monitor->OnAcqFinished();
return DEVICE_OK;
}
}

std::shared_ptr<DeviceInstance> currentCamera =
core_->currentCameraDevice_.lock();

Expand Down Expand Up @@ -340,6 +355,12 @@ int CoreCallback::AcqFinished(const MM::Device* caller, int /*statusCode*/)

int CoreCallback::PrepareForAcq(const MM::Device* caller)
{
if (auto* monitor = core_->seqAcqTestMonitor_.load(std::memory_order_acquire)) {
if (monitor->IsMonitoring(caller)) {
return monitor->OnPrepareForAcq();
}
}

if (core_->autoShutter_)
{
std::shared_ptr<ShutterInstance> shutter =
Expand Down
Loading
Loading