diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/acquisition/SavePanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/acquisition/SavePanel.java index 5237fcab..c74cae54 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/acquisition/SavePanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/acquisition/SavePanel.java @@ -304,7 +304,7 @@ private void openDirectory(final String path) { try { desktop.open(directory); } catch (IOException e) { - model_.studio().logs().showError( + model_.studio().logs().showError(e, "Could not open the save directory:\n\n" + path); } } else { diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/NavigationPanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/NavigationPanel.java index 194a32e2..f02cc673 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/NavigationPanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/NavigationPanel.java @@ -120,7 +120,7 @@ private void createUserInterface() { model_, propertyName, deviceName, deviceType, ControlPanel.Axis.X, ControlPanel.Units.DEGREES); ControlPanel controlPanelY = new ControlPanel( model_, propertyName, deviceName, deviceType, ControlPanel.Axis.Y, ControlPanel.Units.DEGREES); - // TODO: check for ASI hardware when settings units + // TODO: check for ASI hardware when setting units illumProperties.get(pathNum - 1).add(controlPanelX); illumProperties.get(pathNum - 1).add(controlPanelY); } diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java b/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java index 813ab0ff..d5a66074 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java @@ -413,7 +413,8 @@ public String getDeviceLibrary(final String deviceName) { try { result = core_.getDeviceLibrary(deviceName); } catch (Exception e) { - studio_.logs().logError(e.getMessage()); + studio_.logs().logError("could not get the device library of " + deviceName + ": " + + e.getMessage()); } return result; } @@ -431,7 +432,7 @@ public String[] getLoadedDevices() { try { loadedDevices = core_.getLoadedDevices(); } catch (Exception e) { - studio_.logs().logError(e.getMessage()); + studio_.logs().logError("could not get the loaded devices: " + e.getMessage()); } return loadedDevices.toArray(); } @@ -461,7 +462,7 @@ public boolean hasDeviceAdapter() { } } catch (Exception e) { studio_.logs().logError("could not get the device " + - "library for the device \"" + device + "\"."); + "library for the device \"" + device + "\": " + e.getMessage()); } } // no device adapters found diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/PLogicScape.java b/src/main/java/org/micromanager/lightsheetmanager/model/PLogicScape.java index f80edca3..7bcc97e6 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/PLogicScape.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/PLogicScape.java @@ -157,7 +157,8 @@ public boolean prepareControllerForAcquisition( try { core_.setShutterDevice(plcLaser_.getDeviceName()); } catch (Exception e) { - model_.logging().reportError("could not set shutter to " + plcLaser_.getDeviceName()); + model_.logging().reportError("could not set shutter to " + plcLaser_.getDeviceName() + + ": " + e.getMessage()); } if (!acqSettings_.stageScan().enabled()) { diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java index 02a2d2c9..3c2315c4 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/acquisitions/AcquisitionEngineScape.java @@ -205,7 +205,8 @@ boolean setup() { try { core_.setCameraDevice(cameraName); } catch (Exception e) { - model_.logging().reportError("Could not set \"Core-Camera\" to the first logical camera device."); + model_.logging().reportError("Could not set \"Core-Camera\" to the first logical camera device " + + cameraName + ": " + e.getMessage()); return false; } @@ -848,7 +849,6 @@ private void submitEvents(final ScapeAcquisitionSettings settings, final String[ // TODO: execute any start-acquisition runnables - // Loop 1: XY positions PositionList pl = positionList_; // never in separate mode: without a controller the hardware flag is not recomputed, so @@ -1355,7 +1355,8 @@ void finish() { try { core_.setCameraDevice(originalCoreCamera_); } catch (Exception e) { - studio_.logs().logError("Could not restore Core-Camera to " + originalCoreCamera_); + studio_.logs().logError("Could not restore Core-Camera to " + originalCoreCamera_ + + ": " + e.getMessage()); } finally { originalCoreCamera_ = null; } @@ -1835,9 +1836,9 @@ public DefaultTimingSettings.Builder getTimingFromPeriodAndLightExposure() { // 3. camera reset time // 4. start scan 0.25ms before camera global exposure and shifted up in time to account for delay introduced by Bessel filter // 5. turn on laser as soon as camera global exposure, leave laser on for desired light exposure time - // 7. end camera exposure in final 0.25ms, post-filter scan waveform also ends now + // 6. end camera exposure in final 0.25ms, post-filter scan waveform also ends now - CameraBase camera = model_.devices().firstImagingCamera(); //.getDevice("ImagingCamera"); + CameraBase camera = model_.devices().firstImagingCamera(); if (camera == null) { // just a dummy to test demo mode return DefaultTimingSettings.builder(); @@ -1901,7 +1902,7 @@ public DefaultTimingSettings.Builder getTimingFromPeriodAndLightExposure() { // figure out desired time for camera to be exposing (including reset time) // because both camera trigger and laser on occur on 0.25ms intervals (i.e. we may not - // trigger the laser until 0.24ms after global exposure) use cameraReset_max + // trigger the laser until 0.24ms after global exposure) use cameraResetMax // special adjustment for Photometrics cameras that possibly has extra clear time which is counted in reset time // but not in the camera exposure time // TODO: skipped PVCAM case, this should already be handled by camera.getResetTime(camMode); but there may be differences diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java b/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java index 2c3b6887..5a804598 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java @@ -114,7 +114,8 @@ public double getPropertyUpperLimit(final String propertyName) { return core_.getPropertyUpperLimit(deviceName_, propertyName); } } catch (Exception e) { - studio_.logs().logDebugMessage("Property " + propertyName + " has no upper limit or is non-numeric."); + studio_.logs().logDebugMessage("Could not get the upper limit of the \"" + propertyName + + "\" property of " + deviceName_ + ": " + e.getMessage()); } return Double.MAX_VALUE; } @@ -125,7 +126,8 @@ public double getPropertyLowerLimit(final String propertyName) { return core_.getPropertyLowerLimit(deviceName_, propertyName); } } catch (Exception e) { - studio_.logs().logDebugMessage("Property " + propertyName + " has no lower limit or is non-numeric."); + studio_.logs().logDebugMessage("Could not get the lower limit of the \"" + propertyName + + "\" property of " + deviceName_ + ": " + e.getMessage()); } return -Double.MAX_VALUE; // Double.MIN_VALUE is a value close to 0 so use -Double.MAX_VALUE } diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/PcoCamera.java b/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/PcoCamera.java index 02b7f490..dfb9143e 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/PcoCamera.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/PcoCamera.java @@ -74,8 +74,8 @@ public double getRowReadoutTime() { return Double.parseDouble(getProperty(Properties.LINE_TIME))/1000.0; } else { if (isPanda()) { - // documentation not clear but suggests line time < 13ms - // empirically observed 12.5us + 0.0056us*ROI height (centered), e.g. 24ms at full frame in one set of measurements + // documentation not clear but suggests line time < 13us + // empirically observed 12.5us + 0.0056us*ROI height (centered), e.g. 24us at full frame in one set of measurements // another set of measurements it seemed approximately linear in log(height) // for now just use pessimistic but safe 24us // TODO get more accurate value diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/utils/GeometryUtils.java b/src/main/java/org/micromanager/lightsheetmanager/model/utils/GeometryUtils.java index f45ac55f..394b978c 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/utils/GeometryUtils.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/utils/GeometryUtils.java @@ -20,7 +20,7 @@ public static double getStageGeometricShiftFactor(double angle, final boolean pa if (!pathA) { angle = 90.0 - angle; } - return Math.tan(angle/180.0*Math.PI); + return Math.tan(Math.toRadians(angle)); } /*** @@ -34,7 +34,7 @@ public static double getStageTopViewCompressFactor(double angle, final boolean p if (!pathA) { angle = 90.0 - angle; } - return Math.cos(angle/180.0*Math.PI); + return Math.cos(Math.toRadians(angle)); } /***