From 2b11e814597de910e1e58f67a100bc7baba1c309 Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 30 Oct 2026 15:06:16 -0700 Subject: [PATCH 1/2] leave the controller alone after a run refused before it set one up --- .../model/acquisitions/AcquisitionEngineScape.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 fd66d10a..b0ee80c4 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java @@ -116,6 +116,7 @@ boolean setup() { updateSettings(); // set before any validation below can return early: finish() runs on every exit from setup() + controller_ = null; stageScanState_ = null; originalCoreCamera_ = null; originalChannelPreset_ = null; @@ -1306,10 +1307,8 @@ void finish() { // TODO: figure out if we really want to return piezos to 0 position (maybe center position, // maybe not at all since we move when we switch to setup tab, something else??) if (model_.devices().isUsingPLogic() && controller_ != null) { - // SCAPE: leave the imaging piezo where it is instead of driving it to 0. diSPIM 1.4 - // passes centerPiezos=false for SCOPE (AcquisitionPanel line 4979). Parking at 0 - // defocuses the live view and re-introduces the first-frame jump on the next run - // (issues #404 symptom 3 / #407). + // SCAPE: leave the imaging piezo where it is instead of driving it to 0. Parking at 0 + // defocuses the live view and re-introduces the first-frame jump on the next run. controller_.cleanUpControllerAfterAcquisition(acqSettings_, false); controller_.stopSPIMStateMachines(); } From e7f25dcc158620ab24e48eb8dbe22e34812e0676 Mon Sep 17 00:00:00 2001 From: Brandon Date: Fri, 30 Oct 2026 16:25:19 -0700 Subject: [PATCH 2/2] let the image window close once the acquisition has finished writing --- .../model/acquisitions/AcquisitionEngine.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngine.java b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngine.java index 40559e52..df873e94 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngine.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngine.java @@ -743,6 +743,11 @@ public boolean abortRequest() { if (acq == null) { return true; // nothing is running, so there is nothing to protect } + // the data is written and finish() is only restoring the hardware, so it is safe to + // close the window + if (cleaningUp_ && acq.getDataSink().isFinished()) { + return true; + } // always refuse while a run is live: closing the live window would close the datastore // the run is still writing. answering yes only aborts, so the close succeeds on the next // attempt.