From b0e0a9211bc3b56178ad927be325006ac946c262 Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 3 May 2024 15:36:07 -0700 Subject: [PATCH] setExposure in acq engine scape --- .../acquisitions/AcquisitionEngineSCAPE.java | 5 +++++ .../model/devices/cameras/CameraBase.java | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java index 701dca8..d75f544 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java @@ -882,6 +882,11 @@ private boolean doHardwareCalculations(PLogicSCAPE plc) { } } + // set imaging camera exposure + final CameraBase cam = model_.devices() + .getDevice("ImagingCamera"); + cam.setExposure(exposureTime); + double extraChannelOffset = 0.0; plc.prepareControllerForAcquisition(acqSettings_, extraChannelOffset); return true; diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/CameraBase.java b/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/CameraBase.java index c384fd0..5be8c5e 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/CameraBase.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/CameraBase.java @@ -21,6 +21,24 @@ public CameraBase(final Studio studio, final String deviceName) { mode_ = CameraMode.EDGE; } + public void setExposure(final double milliseconds) { + try { + core_.setExposure(deviceName_, milliseconds); + } catch (Exception e) { + studio_.logs().logError("could not set camera exposure"); + } + } + + public double getExposure() { + double exposure = 0.0; + try { + exposure = core_.getExposure(); + } catch (Exception e) { + studio_.logs().logError("could not get camera exposure"); + } + return exposure; + } + // TODO: take binning into account public Rectangle getROI() { Rectangle roi = new Rectangle();