Skip to content

Commit

Permalink
FF: handle case of missing/incorrect setting in builder_ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
isolver committed Mar 17, 2021
1 parent 6624ffc commit 0b67e56
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ eyetracker.hw.gazepoint.gp3.EyeTracker:
# BinocularEyeSampleEvent event type.
monitor_event_types: [ BinocularEyeSampleEvent, FixationStartEvent, FixationEndEvent]

runtime_settings:
sampling_rate: 60
track_eyes: [BINOCULAR,]

# device_timer: The GP3 EyeTracker class uses the polling method to
# check for new events received from the EyeTracker device.
# device_timer.interval specifies the sec.msec time between device polls.
Expand All @@ -49,7 +53,7 @@ eyetracker.hw.gazepoint.gp3.EyeTracker:
target_delay: 0.5

# The model name of the device.
model_name:
model_name: GP3

# manufacturer_name is used to store the name of the maker of the eye tracking
# device. This is for informational purposes only.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ eyetracker.hw.gazepoint.gp3.EyeTracker:
max_length: 32
first_char_alpha: True
enable: IOHUB_BOOL
model_name: GP3
model_name: ['GP3', 'GP3 HD']
serial_number:
IOHUB_STRING:
min_length: 0
Expand All @@ -28,7 +28,7 @@ eyetracker.hw.gazepoint.gp3.EyeTracker:
min_length: 0
max_length: 3
runtime_settings:
sampling_rate: 60
sampling_rate: [60, 150]
track_eyes: [BINOCULAR,]
calibration:
use_builtin: IOHUB_BOOL
Expand Down
11 changes: 9 additions & 2 deletions psychopy/iohub/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,21 @@ def getDeviceDefaultConfig(device_name="", builder_hides=True):
for param in to_hide:
if param.find('.') >= 0:
# it is a nested param
param_tokens = param.strip().split('.')
param_tokens = param.split('.')
cdict = dconf_dict
for pt in param_tokens[:-1]:
cdict = cdict.get(pt)
del cdict[param_tokens[-1]]
try:
del cdict[param_tokens[-1]]
except TypeError:
# key does not exist
pass
else:
del dconf_dict[param]
device_configs.append({dname: dconf_dict})
if len(device_configs) == 1:
# simplify return value when only one device was requested
return list(device_configs[0].values())[0]
return device_configs

def getDeviceNames(device_name=""):
Expand Down

0 comments on commit 0b67e56

Please sign in to comment.