Skip to content

Commit

Permalink
Fix getattr use
Browse files Browse the repository at this point in the history
  • Loading branch information
erinpougheon committed Jul 9, 2024
1 parent 7e3e65c commit 2d4b934
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions catkit2/services/hamamatsu_camera/hamamatsu_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def _create_property(property_name, read_only=False, stopped_acquisition=True):
def getter(self):
with self.mutex:
if property_name != 'EXPOSURETIME':
return getattr(self.cam, property_name).prop_getvalue(dcam.DCAM_IDPROP.property_name)
return self.cam.prop_getvalue(getattr(dcam.DCAM_IDPROP, property_name))
else:
return getattr(self.cam, property_name).prop_getvalue(dcam.DCAM_IDPROP.property_name) * 1e6
return self.cam.prop_getvalue(getattr(dcam.DCAM_IDPROP, property_name)) * 1e6

if read_only:
setter = None
Expand All @@ -44,9 +44,9 @@ def setter(self, value):

with self.mutex:
if property_name != 'EXPOSURETIME':
getattr(self.cam, property_name).prop_setvalue(dcam.DCAM_IDPROP.property_name, value)
self.cam.prop_setvalue(getattr(dcam.DCAM_IDPROP, property_name), value)
else:
getattr(self.cam, property_name).prop_setvalue(dcam.DCAM_IDPROP.property_name, value / 1e6)
self.cam.prop_setvalue(getattr(dcam.DCAM_IDPROP, property_name), value / 1e6)

if was_running and stopped_acquisition:
self.start_acquisition()
Expand Down

0 comments on commit 2d4b934

Please sign in to comment.