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 @@ -53,13 +53,14 @@ public void onPluginSelected() {
frame_ = new LightSheetManagerFrame(model_, isLoaded);
frame_.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);

if (isLoaded) {
model_.acquisitions().setFrame(frame_);
}

WindowUtils.registerWindowClosingEvent(frame_, event -> {
model_.positions().stopPolling();
model_.userSettings().save();
// no need to clean up for the error ui
if (isLoaded) {
if (model_.positions().isPolling()) {
model_.positions().stopPolling();
}
model_.userSettings().save();
}
});

WindowUtils.registerWindowClosedEvent(frame_, event -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.micromanager.lightsheetmanager.LightSheetManagerPlugin;
import org.micromanager.lightsheetmanager.api.AcquisitionManager;
import org.micromanager.lightsheetmanager.api.internal.ScapeAcquisitionSettings;
import org.micromanager.lightsheetmanager.LightSheetManagerFrame;
import org.micromanager.lightsheetmanager.gui.tabs.acquisition.DurationPanel;
import org.micromanager.lightsheetmanager.model.autofocus.AutofocusAdapter;
import org.micromanager.lightsheetmanager.model.DataStorage;
Expand Down Expand Up @@ -52,9 +51,6 @@ public abstract class AcquisitionEngine implements AcquisitionManager, MMAcquist

protected DurationPanel pnlDuration_;

// TODO: remove later, hacky method to stop position updater for now
protected LightSheetManagerFrame frame_;

protected final LightSheetManager model_;

public AcquisitionEngine(final LightSheetManager model) {
Expand Down Expand Up @@ -88,10 +84,6 @@ public void setDurationPanel(final DurationPanel panel) {
pnlDuration_ = Objects.requireNonNull(panel);;
}

public void setFrame(final LightSheetManagerFrame frame) {
frame_ = Objects.requireNonNull(frame);
}

/**
* Sets the acquisition settings and update the acquisition settings builder with current values.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ boolean run() {

// if X speed is less than 0.2 mm/s then it probably wasn't restored to correct speed some other time
if (origSpeedX_ < 0.2) {
final boolean result = DialogUtils.showYesNoDialog(frame_, "Change Speed",
final boolean result = DialogUtils.showYesNoDialog(null, "Change Speed",
"Max speed of X axis is small, perhaps it was not correctly restored after " +
"stage scanning previously. Do you want to set it to 1 mm/s now?");
if (result) {
Expand Down
Loading