-
Notifications
You must be signed in to change notification settings - Fork 0
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
Reset properties while acquisition in Hamamatsu camera service #211
base: develop
Are you sure you want to change the base?
Conversation
With inspiration from the FLIR camera (and Alied Vision Camera), I changed the way properties are created, so they can all be changed without having to stop mannualy the acquisition. A software review can be done, knowing this will require to be tested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! I think I know what tripped you over with the getters and setters, so here comes a solution.
def getter(self): | ||
with self.mutex: | ||
if property_name != 'EXPOSURETIME': | ||
return getattr(self.cam, property_name).prop_getvalue(dcam.DCAM_IDPROP.property_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since property_name
is a string, we cannot call it - this is exactly why we use gettattr()
. And property_name
is a property of dcam.DCAM_IDPROP
, so that is what we have to call getattr()
on.
The correct way to write this is, for a getter:
return self.cam.prop_getvalue(getattr(dcam.DCAM_IDPROP, property_name))
and for a setter:
self.cam.prop_setvalue(getattr(dcam.DCAM_IDPROP, property_name), value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, I changed that and I understand better now !
@@ -21,6 +22,38 @@ | |||
raise | |||
|
|||
|
|||
def _create_property(property_name, read_only=False, stopped_acquisition=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't point this out in the AV PR, but since this function _create_property()
is specific to Hamamtsu cameras because of the getters and setters, lets call property_name
-> hamamatsu_property_name
instead. It's a bit long, but helps for understanding.
Also, could I maybe ask you to do a code-sneak and also replace that variable in the AV service with av_property_name
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done for both services ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me now! We will just put this PR on standby until we can test it on hardware.
0147adc
to
5cca964
Compare
5cca964
to
632c0fc
Compare
632c0fc
to
a11e08b
Compare
a11e08b
to
8323087
Compare
@erinpougheon since the camera delivery will be delayed, could you maybe post a brief bullet-point list here what needs to be done in terms of tests once we have the new camera to wrap up this PR? |
Once the camera arrives: • Determine which properties can be changed on the fly (go and test in an |
As an update, we received the new camera and will be integrating it in the following weeks, which means we will be able to address this PR. |
We got our new camera and @johanmazoyer is working on it now. |
Fixes #194.
Changing the Hamamatsu Camera service so we will be able to change certain properties without having to stop the acquisition.