Skip to content

Commit

Permalink
Merge pull request #265 from bls337/main
Browse files Browse the repository at this point in the history
break out of loop in stopSPIMStateMachines
  • Loading branch information
bls337 authored Apr 18, 2024
2 parents ecbac20 + e154805 commit 9de1bc7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1125,12 +1125,16 @@ public void stopSPIMStateMachines() {
// once all images come in there is still a time when stage is moving back to its start/center position
final int timeoutStageScanCleanupMs = 5000;
final long deadline = System.currentTimeMillis() + timeoutStageScanCleanupMs;
while (xyStage_.getScanState() == ASIXYStage.ScanState.IDLE) {
if (System.currentTimeMillis() > deadline) {
boolean done = false;
while (!done) {
done = xyStage_.getScanState() == ASIXYStage.ScanState.IDLE;
if (!done && System.currentTimeMillis() > deadline) {
xyStage_.setScanState(ASIXYStage.ScanState.IDLE); // force-set to idle
studio_.logs().logError("Force-set XY stage scan to IDLE state with stage speed "
+ xyStage_.getSpeedX() + ".");
} else {
done = true;
}
if (!done) {
try {
Thread.sleep(25); // still waiting...
} catch (InterruptedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ boolean run() {
} catch (Exception e) {
studio_.logs().logError(e);
}
// boolean demoMode = acqSettings_.demoMode();

if (!demoMode) {

Expand Down

0 comments on commit 9de1bc7

Please sign in to comment.