From 0f4c6492c7a8867a2323a75f9c8d32062affaff2 Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 3 May 2024 16:17:00 -0700 Subject: [PATCH] save and restore exposure --- .../model/acquisitions/AcquisitionEngineSCAPE.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 d75f544..db85270 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java @@ -99,6 +99,12 @@ boolean run() { } } + // save current exposure to restore later + CameraBase cam = model_.devices() + .getDevice("ImagingCamera"); + final double origExposure = cam.getExposure(); + + // used to detect if the plugin is using ASI hardware final boolean isUsingPLC = model_.devices().isUsingPLogic(); // initialize stage scanning so we can restore state @@ -674,6 +680,7 @@ public void close() { // set the camera trigger mode back to internal for live mode CameraBase camera = model_.devices().getDevice("ImagingCamera"); camera.setTriggerMode(CameraMode.INTERNAL); + camera.setExposure(origExposure); currentAcquisition_ = null; @@ -886,7 +893,7 @@ private boolean doHardwareCalculations(PLogicSCAPE plc) { final CameraBase cam = model_.devices() .getDevice("ImagingCamera"); cam.setExposure(exposureTime); - + double extraChannelOffset = 0.0; plc.prepareControllerForAcquisition(acqSettings_, extraChannelOffset); return true;