From e360e8965772b220f851554b2bd20e648b86330c Mon Sep 17 00:00:00 2001 From: Brandon Date: Thu, 25 Apr 2024 13:29:56 -0700 Subject: [PATCH] move PositionList validation to setup --- .../acquisitions/AcquisitionEngineSCAPE.java | 15 +++++++++++---- 1 file changed, 11 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 d48f74e..81a7a1d 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineSCAPE.java @@ -53,6 +53,16 @@ public AcquisitionEngineSCAPE(final LightSheetManagerModel model) { @Override boolean setup() { + + // make sure that there are positions in the PositionList + if (acqSettings_.isUsingMultiplePositions()) { + final int numPositions = studio_.positions().getPositionList().getNumberOfPositions(); + if (numPositions == 0) { + studio_.logs().showError(("XY positions expected but the position list is empty")); + return false; + } + } + return true; } @@ -394,7 +404,7 @@ public AcquisitionEvent run(AcquisitionEvent event) { // TODO: Cameras are now ready to receive triggers, so we can send (software) trigger // to the tiger to tell it to start outputting TTLs - if (isUsingPLC && controllerInstance != null) { // if not in demo mode + if (isUsingPLC) { // if not in demo mode // TODO: is this the best place to set state to idle? ASIScanner scanner = model_.devices().getDevice("IllumSlice"); // need to set to IDLE to re-arm for each z-stack @@ -454,9 +464,6 @@ public void close() { // Loop 1: XY positions PositionList pl = MMStudio.getInstance().positions().getPositionList(); - if (acqSettings_.isUsingMultiplePositions() && (pl.getNumberOfPositions() == 0)) { - throw new RuntimeException("XY positions expected but position list is empty"); - } String[] cameraNames; if (demoMode) {