Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some PVCAM properties are actually floats in the device adapter #224

Merged
merged 1 commit into from
Oct 27, 2023
Merged
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 @@ -90,7 +90,7 @@ public Rectangle getResolution() {
public double getRowReadoutTime() {
Rectangle roi = getROI();
if (hasProperty(Properties.READOUT_TIME)) {
final float readoutTimeMs = (float) getPropertyInt(Properties.READOUT_TIME) / 1e6f;
final float readoutTimeMs = getPropertyFloat(Properties.READOUT_TIME) / 1e6f;
return (readoutTimeMs / roi.height);
} else {
return 0.01; // TODO get more accurate value
Expand All @@ -106,8 +106,8 @@ public float getReadoutTime(CameraMode cameraMode) {
break;
case PSEUDO_OVERLAP:
if (isKinetix() || isPrime95B()) {
final int preTime = getPropertyInt(Properties.PRE_TRIGGER_TIME);
readoutTimeMs = (float) preTime / 1e6f;
final float preTime = getPropertyFloat(Properties.PRE_TRIGGER_TIME);
readoutTimeMs = preTime / 1e6f;
// for safety we make sure to wait at least a quarter millisecond to trigger
// (may have hidden assumptions in other code about at least one tic wait)
if (readoutTimeMs < 0.249f) {
Expand All @@ -118,12 +118,12 @@ public float getReadoutTime(CameraMode cameraMode) {
}
break;
case VIRTUAL_SLIT:
readoutTimeMs = (float) getPropertyInt(Properties.READOUT_TIME) / 1e6f;
readoutTimeMs = getPropertyFloat(Properties.READOUT_TIME) / 1e6f;
break;
case EDGE: // fall through to next case
case LEVEL:
final int readoutTime = getPropertyInt(Properties.READOUT_TIME);
final int endGlobalToTrig = getPropertyInt(Properties.PRE_TRIGGER_TIME) + 2 * readoutTime;
final float readoutTime = getPropertyFloat(Properties.READOUT_TIME);
final float endGlobalToTrig = getPropertyFloat(Properties.PRE_TRIGGER_TIME) + 2 * readoutTime;
// this factor of 2 is empirical 08-Jan-2021; I'm not sure why it's needed but that is the missing piece it seems
readoutTimeMs = (float) endGlobalToTrig / 1e6f;
break;
Expand All @@ -143,11 +143,11 @@ public float getResetTime(CameraMode cameraMode) {

// Photometrics Prime 95B is very different from other cameras so handle it as special case
if (isKinetix() || isPrime95B()) {
final int trigToGlobal = getPropertyInt(Properties.POST_TRIGGER_TIME)
+ getPropertyInt(Properties.READOUT_TIME);
final float trigToGlobal = getPropertyFloat(Properties.POST_TRIGGER_TIME)
+ getPropertyFloat(Properties.READOUT_TIME);
// it appears as of end-May 2017 that the clearing time is actually rolled into the post-trigger
// time despite Photometrics documentation to the contrary
resetTimeMs = (float) trigToGlobal / 1e6f;
resetTimeMs = trigToGlobal / 1e6f;
} else {
resetTimeMs = 14.25f; // strange number just to make it easy to find later; I think the original Prime needs to be added
}
Expand Down