Skip to content
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

FF: Include deviceClass and deviceName in getAvailable #8

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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