Skip to content

Commit

Permalink
Change property_name variable name (to specify the camera)
Browse files Browse the repository at this point in the history
  • Loading branch information
erinpougheon committed Jun 6, 2024
1 parent ba99873 commit 5cca964
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions catkit2/services/allied_vision_camera/allied_vision_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
from catkit2.testbed.service import Service


def _create_property(property_name, read_only=False, stopped_acquisition=True):
def _create_property(av_property_name, read_only=False, stopped_acquisition=True):
def getter(self):
with self.mutex:
return getattr(self.cam, property_name).get()
return getattr(self.cam, av_property_name).get()

if read_only:
setter = None
Expand All @@ -41,7 +41,7 @@ def setter(self, value):
time.sleep(0.001)

with self.mutex:
getattr(self.cam, property_name).set(value)
getattr(self.cam, av_property_name).set(value)

if was_running and stopped_acquisition:
self.start_acquisition()
Expand Down
14 changes: 7 additions & 7 deletions catkit2/services/hamamatsu_camera/hamamatsu_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
raise


def _create_property(property_name, read_only=False, stopped_acquisition=True):
def _create_property(hamamatsu_property_name, read_only=False, stopped_acquisition=True):
def getter(self):
with self.mutex:
if property_name != 'EXPOSURETIME':
return self.cam.prop_getvalue(getattr(dcam.DCAM_IDPROP, property_name))
if hamamatsu_property_name != 'EXPOSURETIME':
return self.cam.prop_getvalue(getattr(dcam.DCAM_IDPROP, hamamatsu_property_name))
else:
return self.cam.prop_getvalue(getattr(dcam.DCAM_IDPROP, property_name)) * 1e6
return self.cam.prop_getvalue(getattr(dcam.DCAM_IDPROP, hamamatsu_property_name)) * 1e6

if read_only:
setter = None
Expand All @@ -43,10 +43,10 @@ def setter(self, value):
time.sleep(0.001)

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

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

0 comments on commit 5cca964

Please sign in to comment.