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

fix error on startup with undefined camera #269

Merged
merged 1 commit into from
Apr 19, 2024
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 @@ -14,7 +14,7 @@ public class LightSheetManagerPlugin implements MenuPlugin, SciJavaPlugin {
public static final String copyright = "Applied Scientific Instrumentation (ASI), 2022-2024";
public static final String description = "A plugin to control various types of light sheet microscopes.";
public static final String menuName = "Light Sheet Manager";
public static final String version = "0.4.1";
public static final String version = "0.4.2";

private Studio studio_;
private LightSheetManagerFrame frame_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.micromanager.lightsheetmanager.gui.components.ListeningPanel;
import org.micromanager.lightsheetmanager.gui.components.Panel;
import org.micromanager.lightsheetmanager.model.LightSheetManagerModel;
import org.micromanager.lightsheetmanager.model.devices.cameras.CameraBase;

import java.awt.Font;
import java.util.Objects;
Expand Down Expand Up @@ -53,13 +54,19 @@ private void createUserInterface() {
btnGetCurrentROI_ = new Button("Get Current ROI", 120, 30);

// get the imaging camera library based on number of imaging paths
CameraLibrary camLib;
CameraLibrary camLib = CameraLibrary.UNKNOWN;
if (model_.devices().getDeviceAdapter().getNumImagingPaths() >= 2) {
camLib = CameraLibrary.fromString(
model_.devices().getDevice("Imaging1Camera").getDeviceLibrary());
final CameraBase camera = model_.devices()
.getDevice("Imaging1Camera");
if (camera != null) {
camLib = CameraLibrary.fromString(camera.getDeviceLibrary());
}
} else {
camLib = CameraLibrary.fromString(
model_.devices().getDevice("ImagingCamera").getDeviceLibrary());
final CameraBase camera = model_.devices()
.getDevice("ImagingCamera");
if (camera != null) {
camLib = CameraLibrary.fromString(camera.getDeviceLibrary());
}
}

cmbCameraTriggerMode_ = new ComboBox(CameraMode.getAvailableModes(camLib),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ public void close() {
}
}, Acquisition.AFTER_CAMERA_HOOK);


///////////// Turn off autoshutter /////////////////
final boolean isShutterOpen;
try {
Expand Down
Loading