diff --git a/psychopy_eyetracker_sr_research/sr_research/eyelink/calibration.py b/psychopy_eyetracker_sr_research/sr_research/eyelink/calibration.py index a62f5c2..6281e76 100644 --- a/psychopy_eyetracker_sr_research/sr_research/eyelink/calibration.py +++ b/psychopy_eyetracker_sr_research/sr_research/eyelink/calibration.py @@ -12,16 +12,20 @@ from psychopy.iohub.constants import EventConstants from psychopy.iohub.errors import print2err, printExceptionDetailsToStdErr from psychopy.iohub.util import convertCamelToSnake, win32MessagePump, updateSettings, createCustomCalibrationStim +from psychopy.iohub.devices.keyboard import KeyboardInputEvent import pylink + class FixationTarget(): def __init__(self, psychopy_eyelink_graphics): win = psychopy_eyelink_graphics.window color_type = psychopy_eyelink_graphics.getCalibSetting(['color_type']) unit_type = psychopy_eyelink_graphics.getCalibSetting(['unit_type']) - outer_fill_color = outer_line_color = psychopy_eyelink_graphics.getCalibSetting(['target_attributes', 'outer_color']) - inner_fill_color = inner_line_color = psychopy_eyelink_graphics.getCalibSetting(['target_attributes', 'inner_color']) + outer_fill_color = outer_line_color = psychopy_eyelink_graphics.getCalibSetting( + ['target_attributes', 'outer_color']) + inner_fill_color = inner_line_color = psychopy_eyelink_graphics.getCalibSetting( + ['target_attributes', 'inner_color']) if outer_fill_color is None: outer_fill_color = psychopy_eyelink_graphics.getCalibSetting(['target_attributes', 'outer_fill_color']) @@ -58,6 +62,7 @@ def draw(self, pos=None): self.calibrationPointInner.pos = pos self.calibrationPoint.draw() + # Intro Screen class BlankScreen(): @@ -467,7 +472,6 @@ def _unregisterEventMonitors(self): def _handleEvent(self, event): event_type_index = DeviceEvent.EVENT_TYPE_ID_INDEX if event[event_type_index] == EventConstants.KEYBOARD_RELEASE: - from .....keyboard import KeyboardInputEvent key_index = KeyboardInputEvent.CLASS_ATTRIBUTE_NAMES.index('key') char = event[key_index] if isinstance(char, bytes): @@ -632,7 +636,7 @@ def draw_image_line(self, width, line, totlines, buff): for i in range(width): try: self.rgb_index_array[line - 1, i] = buff[i] - except Exception as e: + except Exception: printExceptionDetailsToStdErr() print2err( 'FAILED TO DRAW PIXEL TO IMAGE LINE: %d %d' % diff --git a/psychopy_eyetracker_sr_research/sr_research/eyelink/eyetracker.py b/psychopy_eyetracker_sr_research/sr_research/eyelink/eyetracker.py index d93e8db..3afa242 100644 --- a/psychopy_eyetracker_sr_research/sr_research/eyelink/eyetracker.py +++ b/psychopy_eyetracker_sr_research/sr_research/eyelink/eyetracker.py @@ -17,9 +17,20 @@ from psychopy.iohub import EXP_SCRIPT_DIRECTORY from psychopy.iohub.errors import print2err, printExceptionDetailsToStdErr from psychopy.iohub.devices import Computer, Device -from psychopy.iohub.devices.eyetracker.eye_events import ( +from psychopy.iohub.devices.eyetracker.eye_events import ( # noqa: F401 EventConstants, - EyeTrackerDevice + EyeTrackerDevice, + EyeTrackerEvent, + EyeSampleEvent, + MonocularEyeSampleEvent, + BinocularEyeSampleEvent, + GazepointSampleEvent, + FixationStartEvent, + FixationEndEvent, + SaccadeStartEvent, + SaccadeEndEvent, + BlinkStartEvent, + BlinkEndEvent ) try: @@ -1574,6 +1585,7 @@ def _close(self): self.setConnectionState(False) EyeTrackerDevice._close(self) + # ================= Command Functions ========================================== _EYELINK_HOST_MODES = {