Skip to content

Commit

Permalink
move PositionList validation to setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon committed Apr 25, 2024
1 parent 5953d15 commit e360e89
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit e360e89

Please sign in to comment.