From bf70a2df9dd919c2edc60f9c98232e66c81a4cf3 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 26 Oct 2026 01:07:02 -0700 Subject: [PATCH 01/10] remove the unused moves from the navigation control panel --- .../gui/tabs/navigation/ControlPanel.java | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/ControlPanel.java b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/ControlPanel.java index e34f071a..005921f6 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/ControlPanel.java +++ b/src/main/java/org/micromanager/lightsheetmanager/gui/tabs/navigation/ControlPanel.java @@ -242,22 +242,6 @@ private boolean isStageDevice() { return deviceType_ == DeviceType.XYStageDevice || deviceType_ == DeviceType.StageDevice; } - private void setRelativeXYPosition(final double dx, final double dy) { - try { - core_.setRelativeXYPosition(deviceName_, dx, dy); - } catch (Exception e) { - model_.studio().logs().showError("failed!"); - } - } - - private void setXYPosition(final double dx, final double dy) { - try { - core_.setXYPosition(deviceName_, dx, dy); - } catch (Exception e) { - model_.studio().logs().showError("failed!"); - } - } - ///////////////////////// private void setRelativeXPosition(final double dx) { @@ -314,7 +298,6 @@ private void setPosition(final double d) { private void setOriginY() { try { - //System.out.println("deviceName_: " + deviceName_); core_.setOriginY(deviceName_); } catch (Exception e) { model_.studio().logs().showError("failed to set y origin!"); @@ -323,7 +306,6 @@ private void setOriginY() { private void setOriginX() { try { - //System.out.println("deviceName_: " + deviceName_); core_.setOriginX(deviceName_); } catch (Exception e) { model_.studio().logs().showError("failed to set x origin!"); @@ -359,14 +341,6 @@ private void setOrigin() { //// Galvo - private void setGalvoPosition(final double dx, final double dy) { - try { - core_.setGalvoPosition(deviceName_, dx, dy); - } catch (Exception e) { - model_.studio().logs().showError(propertyName_ + " " + deviceName_ + " failed!"); - } - } - // the galvo position is read inside the try, so a failed read skips the move instead of // moving with 0 in place of the unread position private void setRelativeGalvoPositionX(final double dx) { From 4fbe9c5d4d94faa2a7f183cb4b7003338cb49b29 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 26 Oct 2026 01:08:58 -0700 Subject: [PATCH 02/10] remove commented out code from the base acquisition settings --- .../api/internal/BaseAcquisitionSettings.java | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/api/internal/BaseAcquisitionSettings.java b/src/main/java/org/micromanager/lightsheetmanager/api/internal/BaseAcquisitionSettings.java index 34dcb81f..f4df44a7 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/api/internal/BaseAcquisitionSettings.java +++ b/src/main/java/org/micromanager/lightsheetmanager/api/internal/BaseAcquisitionSettings.java @@ -291,16 +291,6 @@ public ChannelSettings.Builder channelBuilder() { public VolumeSettings.Builder volumeBuilder() { return volumeBuilder_; } - - /** - * Creates an immutable instance of DefaultAcquisitionSettings - * - * @return Immutable version of DefaultAcquisitionSettings - */ - //@Override - //public abstract AcquisitionSettings build(); - - //public abstract T self(); } /** @@ -334,12 +324,6 @@ public VolumeSettings.Builder volumeBuilder() { private final ChannelSettings channels; private final VolumeSettings volume; -// public DefaultAcquisitionSettings() { -// saveNamePrefix_ = ""; -// saveDirectory_ = ""; -// demoMode_ = false; -// } - protected BaseAcquisitionSettings(Builder builder) { saveDirectory = builder.saveDirectory; saveNamePrefix = builder.saveNamePrefix; @@ -592,8 +576,4 @@ public static T fromJson(final String json, fina return gson.fromJson(json, cls); } -// public static DefaultAcquisitionSettingsDISPIM fromJson(final String json) { -// return new Gson().fromJson(json, DefaultAcquisitionSettingsDISPIM.class); -// } - } From d8ccb3f98d5d240e43cfbe9f1f2c90afcf9c45b6 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 26 Oct 2026 01:10:30 -0700 Subject: [PATCH 03/10] name the device and the cause in property check and halt errors --- .../lightsheetmanager/model/devices/DeviceBase.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 c5e0b809..e9ff5976 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java @@ -40,7 +40,8 @@ public boolean hasProperty(final String propertyName) { try { result = core_.hasProperty(deviceName_, propertyName); } catch (Exception e) { - studio_.logs().showError("Error: could not determine if " + propertyName + " exists."); + studio_.logs().showError("Error: could not determine if " + propertyName + " of " + + deviceName_ + " exists: " + e.getMessage()); } return result; } @@ -196,7 +197,7 @@ public void halt() { try { core_.stop(deviceName_); } catch (Exception e) { - studio_.logs().logError("Error halting device: " + deviceName_); + studio_.logs().logError("Error halting device " + deviceName_ + ": " + e.getMessage()); } } From 7e462dd61cd8a186eeeaede3d37de63732a0820d Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 26 Oct 2026 01:13:20 -0700 Subject: [PATCH 04/10] name the target and the cause when a z stage move or read fails --- .../lightsheetmanager/model/devices/Stage.java | 6 ++++-- .../model/devices/vendor/ASIZStage.java | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/devices/Stage.java b/src/main/java/org/micromanager/lightsheetmanager/model/devices/Stage.java index a5c219ba..81f11f1d 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/Stage.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/Stage.java @@ -12,7 +12,8 @@ public void setPosition(final double position) { try { core_.setPosition(deviceName_, position); } catch (Exception e) { - studio_.logs().showError("could not set position for " + deviceName_); + studio_.logs().showError("could not move " + deviceName_ + " to " + position + + ": " + e.getMessage()); } } @@ -20,7 +21,8 @@ public double getPosition() { try { return core_.getPosition(deviceName_); } catch (Exception e) { - studio_.logs().showError("could not get position for " + deviceName_); + studio_.logs().showError("could not get position for " + deviceName_ + ": " + + e.getMessage()); return 0.0; } } diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/devices/vendor/ASIZStage.java b/src/main/java/org/micromanager/lightsheetmanager/model/devices/vendor/ASIZStage.java index e877c8fd..e2c0f0f3 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/vendor/ASIZStage.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/vendor/ASIZStage.java @@ -19,7 +19,8 @@ public void setPosition(final double position) { try { core_.setPosition(deviceName_, position); } catch (Exception e) { - studio_.logs().showError("could not set position for " + deviceName_); + studio_.logs().showError("could not move " + deviceName_ + " to " + position + + ": " + e.getMessage()); } } @@ -27,7 +28,8 @@ public void setRelativePosition(final double position) { try { core_.setRelativePosition(deviceName_, position); } catch (Exception e) { - studio_.logs().showError("could not set relative position for " + deviceName_); + studio_.logs().showError("could not move " + deviceName_ + " by " + position + + ": " + e.getMessage()); } } @@ -35,7 +37,8 @@ public double getPosition() { try { return core_.getPosition(deviceName_); } catch (Exception e) { - studio_.logs().showError("could not get position for " + deviceName_); + studio_.logs().showError("could not get position for " + deviceName_ + ": " + + e.getMessage()); return 0.0; } } From eef6ce7dccce9a0f9a5eb0b212549374c83f3e07 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 26 Oct 2026 01:19:09 -0700 Subject: [PATCH 05/10] name the cause when an xy stage position cannot be read --- .../lightsheetmanager/model/devices/XYStage.java | 9 ++++++--- .../model/devices/vendor/ASIXYStage.java | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/devices/XYStage.java b/src/main/java/org/micromanager/lightsheetmanager/model/devices/XYStage.java index fb5d9548..dfb673a4 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/XYStage.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/XYStage.java @@ -38,7 +38,8 @@ public Point2D.Double getXYPosition() { try { return core_.getXYStagePosition(deviceName_); } catch (Exception e) { - studio_.logs().showError("could not get the xy position for " + deviceName_); + studio_.logs().showError("could not get the xy position for " + deviceName_ + ": " + + e.getMessage()); return new Point2D.Double(0.0, 0.0); } } @@ -47,7 +48,8 @@ public double getXPosition() { try { return core_.getXYStagePosition(deviceName_).x; } catch (Exception e) { - studio_.logs().showError("could not get the x position for " + deviceName_); + studio_.logs().showError("could not get the x position for " + deviceName_ + ": " + + e.getMessage()); return 0.0; } } @@ -56,7 +58,8 @@ public double getYPosition() { try { return core_.getXYStagePosition(deviceName_).y; } catch (Exception e) { - studio_.logs().showError("could not get the y position for " + deviceName_); + studio_.logs().showError("could not get the y position for " + deviceName_ + ": " + + e.getMessage()); return 0.0; } } diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/devices/vendor/ASIXYStage.java b/src/main/java/org/micromanager/lightsheetmanager/model/devices/vendor/ASIXYStage.java index c65f9767..088f6a61 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/vendor/ASIXYStage.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/vendor/ASIXYStage.java @@ -42,7 +42,8 @@ public Point2D.Double getXYPosition() { try { return core_.getXYStagePosition(deviceName_); } catch (Exception e) { - studio_.logs().showError("could not get the position for " + deviceName_); + studio_.logs().showError("could not get the position for " + deviceName_ + ": " + + e.getMessage()); return new Point2D.Double(0.0, 0.0); } } From 1b5e0d680f7674b17da4ed033d174bf8af4119e6 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 26 Oct 2026 09:29:52 -0700 Subject: [PATCH 06/10] name the device and the cause in the tiger card property error --- .../model/devices/vendor/ASITigerBase.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/devices/vendor/ASITigerBase.java b/src/main/java/org/micromanager/lightsheetmanager/model/devices/vendor/ASITigerBase.java index e7def5bd..c111488b 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/vendor/ASITigerBase.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/vendor/ASITigerBase.java @@ -35,7 +35,8 @@ public String getName() { try { result = core_.getProperty(deviceName_, Properties.NAME); } catch (Exception e) { - studio_.logs().logError("could not get the name property"); + studio_.logs().logError("could not get the name property of " + + deviceName_ + ": " + e.getMessage()); } return result; } @@ -45,7 +46,8 @@ public String getDescription() { try { result = core_.getProperty(deviceName_, Properties.DESCRIPTION); } catch (Exception e) { - studio_.logs().logError("could not get the description property"); + studio_.logs().logError("could not get the description property of " + + deviceName_ + ": " + e.getMessage()); } return result; } @@ -54,7 +56,8 @@ public String getFirmwareBuild() { try { return core_.getProperty(deviceName_, Properties.FIRMWARE_BUILD); } catch (Exception e) { - studio_.logs().logError("could not get the firmware build property"); + studio_.logs().logError("could not get the firmware build property of " + + deviceName_ + ": " + e.getMessage()); } return ""; } @@ -63,7 +66,8 @@ public String getFirmwareDate() { try { return core_.getProperty(deviceName_, Properties.FIRMWARE_DATE); } catch (Exception e) { - studio_.logs().logError("could not get the firmware date property"); + studio_.logs().logError("could not get the firmware date property of " + + deviceName_ + ": " + e.getMessage()); } return ""; } @@ -72,7 +76,8 @@ public double getFirmwareVersion() { try { return Double.parseDouble(core_.getProperty(deviceName_, Properties.FIRMWARE_VERSION)); } catch (Exception e) { - studio_.logs().logError("could not get the firmware version property"); + studio_.logs().logError("could not get the firmware version property of " + + deviceName_ + ": " + e.getMessage()); } return 0.0; } @@ -81,7 +86,8 @@ public String getCardAddress() { try { return core_.getProperty(deviceName_, Properties.TIGER_HEX_ADDRESS); } catch (Exception e) { - studio_.logs().logError("could not get the Tiger hex address property"); + studio_.logs().logError("could not get the Tiger hex address property of " + + deviceName_ + ": " + e.getMessage()); } return ""; } @@ -90,7 +96,8 @@ public void setRefreshPropertyValues(final boolean state) { try { core_.setProperty(deviceName_, Properties.REFRESH_PROPERTY_VALUES, state ? Values.YES : Values.NO); } catch (Exception e) { - studio_.logs().logError("setRefreshPropertyValues failed."); + studio_.logs().logError("setRefreshPropertyValues failed for " + + deviceName_ + ": " + e.getMessage()); } } @@ -98,7 +105,8 @@ public boolean isRefreshPropertyValuesOn() { try { return core_.getProperty(deviceName_, Properties.REFRESH_PROPERTY_VALUES).equals(Values.YES); } catch (Exception e) { - studio_.logs().logError("getRefreshPropertyValues failed."); + studio_.logs().logError("isRefreshPropertyValuesOn failed for " + + deviceName_ + ": " + e.getMessage()); } return false; } From ff4ad8e10aa7bf81bb871ec0e2a423a47ab0d0e4 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 26 Oct 2026 09:31:06 -0700 Subject: [PATCH 07/10] name the property and the device in the property query errors --- .../lightsheetmanager/model/devices/DeviceBase.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 e9ff5976..2c3b6887 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java @@ -135,7 +135,8 @@ public boolean isPropertyPreInit(final String propertyName) { try { result = core_.isPropertyPreInit(deviceName_, propertyName); } catch (Exception e) { - studio_.logs().logError(e.getMessage()); + studio_.logs().logError("Could not tell whether the \"" + propertyName + + "\" property of " + deviceName_ + " is pre-init: " + e.getMessage()); } return result; } @@ -145,7 +146,8 @@ public boolean isPropertyReadOnly(final String propertyName) { try { result = core_.isPropertyReadOnly(deviceName_, propertyName); } catch (Exception e) { - studio_.logs().logError(e.getMessage()); + studio_.logs().logError("Could not tell whether the \"" + propertyName + + "\" property of " + deviceName_ + " is read-only: " + e.getMessage()); } return result; } @@ -171,7 +173,8 @@ public String[] getDevicePropertyNames() { try { devices = core_.getDevicePropertyNames(deviceName_); } catch (Exception e) { - studio_.logs().logError(e.getMessage()); + studio_.logs().logError("Could not get the property names of " + deviceName_ + ": " + + e.getMessage()); } return devices.toArray(); } From 90110b1d00040b7a90a2e189dde8622810f0b583 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 26 Oct 2026 09:32:04 -0700 Subject: [PATCH 08/10] name the cause in the configuration group errors --- .../lightsheetmanager/model/DeviceManager.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java b/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java index 25b8d44d..813ab0ff 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/DeviceManager.java @@ -530,7 +530,8 @@ public void createConfigGroup() { try { core_.defineConfigGroup(groupName); } catch (Exception e) { - studio_.logs().logError("could not create the \"" + groupName + "\" configuration group."); + studio_.logs().logError("could not create the \"" + groupName + "\" configuration group: " + + e.getMessage()); return; // early exit } } @@ -540,7 +541,8 @@ public void createConfigGroup() { try { core_.defineConfig(groupName, configName); } catch (Exception e) { - studio_.logs().logError("could not create the \"" + configName + "\" configuration preset."); + studio_.logs().logError("could not create the \"" + configName + "\" configuration preset: " + + e.getMessage()); return; // early exit } } @@ -577,7 +579,8 @@ private ArrayList updateConfig(final String groupName, final String conf try { config = core_.getConfigData(groupName, configName); } catch (Exception e) { - studio_.logs().showError("could not get configuration data!"); + studio_.logs().showError("could not get the configuration data of " + groupName + "::" + + configName + ": " + e.getMessage()); return newProperties; // early exit => could not get config data to compare } @@ -589,7 +592,8 @@ private ArrayList updateConfig(final String groupName, final String conf newProperties.add(propertyName); } catch (Exception e) { studio_.logs().logError("Could not create the \"" + propertyName - + "\" property for the \"" + groupName + "\" configuration group."); + + "\" property for the \"" + groupName + "\" configuration group: " + + e.getMessage()); } } } From a94c14135b330d37c644d721b5da4f1bc77499d6 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 26 Oct 2026 09:32:55 -0700 Subject: [PATCH 09/10] name the cause when the saved settings cannot be read --- .../micromanager/lightsheetmanager/model/UserSettings.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/UserSettings.java b/src/main/java/org/micromanager/lightsheetmanager/model/UserSettings.java index 25feb61f..bd0cd8d3 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/UserSettings.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/UserSettings.java @@ -191,7 +191,7 @@ private Optional validateUserSettings(final String loadedSettings) { loadedJson = new JSONObject(loadedSettings); defaultJson = new JSONObject(defaultSettings); } catch (JSONException e) { - model_.studio().logs().showError("could not validate the JSON data."); + model_.studio().logs().showError("could not validate the JSON data: " + e.getMessage()); return Optional.empty(); } // add every default setting the loaded settings lack, including any whose key was renamed @@ -199,7 +199,8 @@ private Optional validateUserSettings(final String loadedSettings) { JsonUtils.addMissingKeys(defaultJson, loadedJson, MAX_RECURSION_DEPTH_JSON, message -> model_.studio().logs().logMessage("UserSettings: " + message)); } catch (JSONException e) { - model_.studio().logs().showError("could not merge new default settings into loaded settings."); + model_.studio().logs().showError("could not merge new default settings into loaded settings: " + + e.getMessage()); return Optional.empty(); } return Optional.of(loadedJson); From 2e34f35faabfc214058c802e1b87d466576eaf22 Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 26 Oct 2026 09:40:08 -0700 Subject: [PATCH 10/10] log the slice and piezo centers when arming the controller --- .../org/micromanager/lightsheetmanager/model/PLogicScape.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/PLogicScape.java b/src/main/java/org/micromanager/lightsheetmanager/model/PLogicScape.java index d5b46d50..c5eed468 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/PLogicScape.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/PLogicScape.java @@ -508,6 +508,8 @@ public boolean prepareControllerForAcquisitionSide( // round to nearest 0.0001 degrees, which is approximately the DAC resolution sliceAmplitude = NumberUtils.roundToPlace(sliceAmplitude, 4); sliceCenter = NumberUtils.roundToPlace(sliceCenter, 4); + studio_.logs().logMessage("Preparing the slices with slope " + sliceRate + ", offset " + + sliceOffset + ", piezo center " + piezoCenter + " and slice center " + sliceCenter); // Refuse a sweep that would drive the galvo past its travel limits. This has to run here, // after the rounding and before either branch below writes to the card. The piezo check