Skip to content

Commit

Permalink
Add method to DeviceManager to configure photodiode
Browse files Browse the repository at this point in the history
  • Loading branch information
TEParsons committed Oct 26, 2023
1 parent fa106da commit 534a8e2
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions psychopy_bbtk/tpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,29 +182,33 @@ def configurePhotodiode(self, name, number, threshold=None, pos=None, size=None,
Parameters
----------
name : _type_
_description_
number : _type_
_description_
threshold : _type_, optional
_description_, by default None
pos : _type_, optional
_description_, by default None
size : _type_, optional
_description_, by default None
units : _type_, optional
_description_, by default None
Returns
-------
_type_
_description_
Raises
------
ConnectionError
_description_
name : str
Name of the TPad whose photodiode to configure
number : int
Number of the photodiode to configure
threshold : int, optional
Light threshold to set the photodiode to, or leave as None for no change.
pos : list, tuple, np.ndarray, layout.Position, optional
Position of the photodiode on the current window, or leave as None for no change.
size : list, tuple, np.ndarray, layout.Size, optional
Size of the rectangle picked up by the photodiode, or leave as None for no change.
units : str, optional
Units in which to interpret pos and size, or leave as None for no change.
"""
# get diode
diode = self.getTPadPhotodiode(name=name, number=number)
# set threshold
if threshold is not None:
diode.setThreshold(threshold)
# set units
if units is not None:
diode.units = units
# set pos
if pos is not None:
diode.pos = pos
# set size
if size is not None:
diode.size = size


class TPadPhotodiode(photodiode.BasePhotodiode):
Expand Down

0 comments on commit 534a8e2

Please sign in to comment.