diff --git a/src/main/java/org/micromanager/lightsheetmanager/LightSheetManager.java b/src/main/java/org/micromanager/lightsheetmanager/LightSheetManager.java index 53bff39c..620ae399 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/LightSheetManager.java +++ b/src/main/java/org/micromanager/lightsheetmanager/LightSheetManager.java @@ -63,10 +63,8 @@ public boolean setup() { // first we check to see if the device adapter is present if (!deviceManager_.hasDeviceAdapter()) { - final String message = "Could not find the Light Sheet Manager " + - "device adapter in the hardware configuration."; - studio_.logs().logError(message); - errorText_ = message; + // hasDeviceAdapter() sets the error text: no adapter, or more than one + studio_.logs().logError(errorText_); return false; } 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 8bef5c43..c5e0b809 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/DeviceBase.java @@ -50,7 +50,8 @@ public String getProperty(final String propertyName) { try { result = core_.getProperty(deviceName_, propertyName); } catch (Exception e) { - studio_.logs().logError("Could not get the \"" + propertyName + "\" property."); + studio_.logs().logError("Could not get the \"" + propertyName + "\" property of " + + deviceName_ + ": " + e.getMessage()); } return result; } @@ -59,7 +60,8 @@ public void setProperty(final String propertyName, final String propertyValue) { try { core_.setProperty(deviceName_, propertyName, propertyValue); } catch (Exception e) { - studio_.logs().logError("Could not set the \"" + propertyName + "\" property to " + propertyValue + "."); + studio_.logs().logError("Could not set the \"" + propertyName + "\" property of " + + deviceName_ + " to " + propertyValue + ": " + e.getMessage()); } } @@ -68,7 +70,8 @@ public int getPropertyInt(final String propertyName) { try { result = Integer.parseInt(core_.getProperty(deviceName_, propertyName)); } catch (Exception e) { - studio_.logs().logError("Could not get the \"" + propertyName + "\" property as an integer."); + studio_.logs().logError("Could not get the \"" + propertyName + "\" property of " + + deviceName_ + " as an integer: " + e.getMessage()); } return result; } @@ -77,7 +80,8 @@ public void setPropertyInt(final String propertyName, final int propertyValue) { try { core_.setProperty(deviceName_, propertyName, propertyValue); } catch (Exception e) { - studio_.logs().logError("Could not set the \"" + propertyName + "\" property to " + propertyValue + "."); + studio_.logs().logError("Could not set the \"" + propertyName + "\" property of " + + deviceName_ + " to " + propertyValue + ": " + e.getMessage()); } } @@ -88,7 +92,8 @@ public double getPropertyFloat(final String propertyName) { try { result = Double.parseDouble(core_.getProperty(deviceName_, propertyName)); } catch (Exception e) { - studio_.logs().logError("could not get the \"" + propertyName + "\" property as a double."); + studio_.logs().logError("Could not get the \"" + propertyName + "\" property of " + + deviceName_ + " as a double: " + e.getMessage()); } return result; } @@ -97,7 +102,8 @@ public void setPropertyFloat(final String propertyName, final double propertyVal try { core_.setProperty(deviceName_, propertyName, propertyValue); } catch (Exception e) { - studio_.logs().logError("could not set the \"" + propertyName + "\" property to " + propertyValue + "."); + studio_.logs().logError("Could not set the \"" + propertyName + "\" property of " + + deviceName_ + " to " + propertyValue + ": " + e.getMessage()); } } @@ -173,7 +179,8 @@ public String[] getAllowedPropertyValues(final String propertyName) { try { return core_.getAllowedPropertyValues(deviceName_, propertyName).toArray(); } catch (Exception e) { - studio_.logs().logError("Could not get the allowed values of the \"" + propertyName + "\" property."); + studio_.logs().logError("Could not get the allowed values of the \"" + propertyName + + "\" property of " + deviceName_ + ": " + e.getMessage()); return new String[0]; } } @@ -197,7 +204,8 @@ public void waitForDevice() { try { core_.waitForDevice(deviceName_); } catch (Exception e) { - studio_.logs().logError("Error waiting for device: " + deviceName_); + studio_.logs().logError("Error waiting for device " + deviceName_ + ": " + + e.getMessage()); } } diff --git a/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/CameraBase.java b/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/CameraBase.java index bb29a8bd..4724b6e1 100644 --- a/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/CameraBase.java +++ b/src/main/java/org/micromanager/lightsheetmanager/model/devices/cameras/CameraBase.java @@ -44,7 +44,8 @@ public void setExposure(final double milliseconds) { try { core_.setExposure(deviceName_, milliseconds); } catch (Exception e) { - studio_.logs().logError("could not set camera exposure"); + studio_.logs().logError("could not set the exposure of camera " + deviceName_ + " to " + + milliseconds + " ms: " + e.getMessage()); } } @@ -56,7 +57,8 @@ public double getExposure() { try { exposure = core_.getExposure(deviceName_); } catch (Exception e) { - studio_.logs().logError("could not get camera exposure"); + studio_.logs().logError("could not get the exposure of camera " + deviceName_ + ": " + + e.getMessage()); } return exposure; } @@ -73,7 +75,8 @@ public Rectangle getROI() { try { roi = core_.getROI(deviceName_); } catch (Exception e) { - studio_.logs().showError("could not get camera roi"); + studio_.logs().showError("could not get the ROI of camera " + deviceName_ + ": " + + e.getMessage()); } return roi; }