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. 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(); }