Skip to content

Commit

Permalink
Merge pull request #6 from mh105/main
Browse files Browse the repository at this point in the history
BF: fix relative imports
  • Loading branch information
TEParsons authored Jun 12, 2024
2 parents be603b2 + 6335866 commit 3e4da04
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down Expand Up @@ -58,6 +62,7 @@ def draw(self, pos=None):
self.calibrationPointInner.pos = pos
self.calibrationPoint.draw()


# Intro Screen
class BlankScreen():

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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' %
Expand Down
16 changes: 14 additions & 2 deletions psychopy_eyetracker_sr_research/sr_research/eyelink/eyetracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -1574,6 +1585,7 @@ def _close(self):
self.setConnectionState(False)
EyeTrackerDevice._close(self)


# ================= Command Functions ==========================================

_EYELINK_HOST_MODES = {
Expand Down

0 comments on commit 3e4da04

Please sign in to comment.