Skip to content

Commit

Permalink
ASIRingTIRF: update calibration routine shutdown tasks
Browse files Browse the repository at this point in the history
The plugin will now turn off fast circles mode as well as disable the scanner beam at the end of the calibration routine.
  • Loading branch information
bls337 authored and nicost committed Jan 31, 2024
1 parent d63b0ce commit d455146
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,16 @@ public void setupPLC() {
public void calibrateFastCircles(final int nImages, final float startSize,
final float radiusIncrement) {
final SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {

final float originalRadius = scanner.getFastCirclesRadius();

@Override
protected Void doInBackground() throws Exception {
studio.logs().logMessage("Calibration Started");

Image image;
final double exposure = camera.getExposure();
final double fastCirclesHz = (1.0 / exposure) * 1000.0;

scanner.setFastCirclesRate((float) fastCirclesHz);

SwingUtilities.invokeLater(() -> {
Expand Down Expand Up @@ -249,15 +249,22 @@ protected Void doInBackground() throws Exception {

scanner.setFastCirclesState(Scanner.Values.FastCirclesState.OFF);
}

scanner.setFastCirclesStateRestart();

return null;
}

@Override
protected void done() {
studio.logs().logMessage("Calibration Finished");
// turn off fast circles and the scanner beam
scanner.setFastCirclesState(Scanner.Values.FastCirclesState.OFF);
scanner.setBeamEnabled(false);

if (camera.isSupported()) {
camera.setTriggerModeInternal();
}

scanner.setFastCirclesRadius(originalRadius); // restore radius
studio.logs().logMessage("Calibration Finished");
}

};
Expand Down Expand Up @@ -362,7 +369,7 @@ protected Void doInBackground() throws Exception {

@Override
protected void done() {
// turn on fast circles and the scanner beam
// turn off fast circles and the scanner beam
scanner.setFastCirclesState(Scanner.Values.FastCirclesState.OFF);
scanner.setBeamEnabled(false);

Expand Down

0 comments on commit d455146

Please sign in to comment.