Skip to content

Commit

Permalink
FF: Include deviceClass and deviceName in getAvailable
Browse files Browse the repository at this point in the history
  • Loading branch information
TEParsons committed Nov 3, 2023
1 parent dd5982b commit 845f2ee
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions psychopy_bbtk/tpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ def __init__(self, pad, channels):
def getAvailableDevices():
devices = []
# iterate through profiles of all serial port devices
for dev in TPad.getAvailableDevices():
for profile in TPad.getAvailableDevices():
devices.append({
'pad': dev['port'],
'deviceName': profile['Instance ID'] + "_photodiodes",
'pad': profile['port'],
'channels': 2,
})

Expand Down Expand Up @@ -177,9 +178,10 @@ def parseMessage(self, message):
def getAvailableDevices():
devices = []
# iterate through profiles of all serial port devices
for dev in TPad.getAvailableDevices():
for profile in TPad.getAvailableDevices():
devices.append({
'pad': dev['port'],
'deviceName': profile['Instance ID'] + "_buttons",
'pad': profile['port'],
'channels': 10,
})

Expand Down Expand Up @@ -227,6 +229,7 @@ def getAvailableDevices():
# iterate through profiles of all serial port devices
for profile in st.systemProfilerWindowsOS(
classid="{4d36e978-e325-11ce-bfc1-08002be10318}",
connected=True
):
# skip non-bbtk profiles
if "BBTKTPAD" not in profile['Instance ID']:
Expand All @@ -242,6 +245,7 @@ def getAvailableDevices():
num = desc[start:end]

devices.append({
'deviceName': profile['Instance ID'],
'port': f"COM{num}",
})

Expand Down

0 comments on commit 845f2ee

Please sign in to comment.