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

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

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

/***
Expand Down
Loading