Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move PositionList validation to setup #273

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading