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

BF: fix relative imports #6

Merged
merged 6 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
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
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
Loading