Skip to content
Merged
Show file tree
Hide file tree
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 @@ -236,11 +236,14 @@ private void createEventHandlers() {
// confirm first: one stray click discards a run in progress
if (DialogUtils.showYesNoDialog(this, "Stop Acquisition",
"Stop the current acquisition?")) {
model_.acquisitions().requestStop();
// the run can end while the dialog is open
if (model_.acquisitions().isRunning()) {
model_.acquisitions().requestStop();
}
} else {
// the press already flipped the toggle, so put it back or the button
// reads "Start Acquisition" while the run is still going
btnRunAcquisition_.setState(true);
btnRunAcquisition_.setState(model_.acquisitions().isRunning());
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,18 @@ protected boolean isStopRequested() {
return stopRequested_;
}

/**
* Returns true from the moment a run is requested until its cleanup has finished. Unlike
* {@link #isAcquisitionRunning()}, this includes setup, the wait between separate time points
* and the cleanup. {@link #requestStop()} acts only while this is true. A speed test does not
* count.
*
* @return true while a run is in progress
*/
public boolean isRunning() {
return acquisitionRequested_;
}

/**
* Records whether a series is waiting between time points, for the stop and abort log lines.
*
Expand Down
Loading