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 @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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());
}
}

Expand All @@ -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;
}
Expand All @@ -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());
}
}

Expand All @@ -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;
}
Expand All @@ -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());
}
}

Expand Down Expand Up @@ -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];
}
}
Expand All @@ -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());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down
Loading