OS (e.g. Win10): win 10
PsychoPy version (e.g. 1.84.x): 2021.2.3
Standard Standalone? (y/n) If not then what?: y
i made an eyetracking task in builder, it ran, hdf5 file saved in ./data
, EXPFILE.edf
saved on host computer, but i don’t find EXPFILE.edf
on display/local/experiment computer in .
i think that’s expected behavior, if i understand correctly that
return EyeTrackerConstants.EYETRACKER_OK
elif enable is False and self._eyelink.isConnected():
self._eyelink.setOfflineMode()
if self._active_edf_file:
self._eyelink.closeDataFile()
# receive(scr,dest)
self._eyelink.receiveDataFile(
self._host_edf_name + '.EDF',
os.path.join(
self._local_edf_dir,
self._active_edf_file))
self._eyelink.close()
EyeTracker._active_edf_file = None
return EyeTrackerConstants.EYETRACKER_OK
else:
print2err('INVALID_METHOD_ARGUMENT_VALUE')
except Exception as e:
printExceptionDetailsToStdErr()
def isConnected(self):
copy edf file from host to display
and
io.quit()
"""
# >>> Constants:
EYELINK = 1
EYELINK_II = 2
EYELINK_1000 = 3
# >>> Custom class attributes
_eyelink = None
_local_edf_dir = '.'
_full_edf_name = 'temp'
_host_edf_name = None
_active_edf_file = None
_file_transfer_progress_dialog = None
# <<<
# >>> Overwritten class attributes
DEVICE_TIMEBASE_TO_SEC = 0.001
EVENT_CLASS_NAMES = [
'MonocularEyeSampleEvent',
self._eyelink.sendCommand('aux_mouse_simulation = NO')
# set that the EyeLink connected button box, button 5
# (the big button on most of supported gamepads), will initiate
# an accept fixation command.
self._eyelink.sendCommand(
"button_function 5 'accept_target_fixation'")
# Sets up the file names / paths to be used for the native EyeLink
# EDF file.
EyeTracker._local_edf_dir = EXP_SCRIPT_DIRECTORY
# Sets the 'runtime' configuration section of the eyetracker
# settings, including eye to track, sample filtering level, etc.
self._setRuntimeSettings(self._runtime_settings)
# calibration related settings
eyelink = self._eyelink
calibration_config = tracker_config.get('calibration', None)
if calibration_config:
for cal_key, cal_val in calibration_config.items():
i never saw this message
'WARNING: unhandled eye tracker config setting:', pkey, v)
def _fileTransferProgressUpdate(self, size, received):
if ProgressBarDialog is None:
#print2err("eyelink._fileTransferProgressUpdate() not asupported: wx package not found")
return
if EyeTracker._file_transfer_progress_dialog is None:
EyeTracker._file_transfer_progress_dialog = ProgressBarDialog(
'ioHub EyeLink(C) Interface',
'Transferring ' + self._full_edf_name + '.EDF to ' + self._local_edf_dir,
100, display_index=self._display_device.getIndex())
elif received >= size and EyeTracker._file_transfer_progress_dialog:
EyeTracker._file_transfer_progress_dialog.close()
EyeTracker._file_transfer_progress_dialog = None
else:
perc = int((float(received) / float(size)) * 100.0) + 1
if perc > 100:
perc = 100
if perc != self._file_transfer_progress_dialog.getCurrentStatus():
self._file_transfer_progress_dialog.updateStatus(perc)
in runner
that was called by
i was looking at the “wrong” file on github, was linking versions/eyetracker.py at master · psychopy/versions · GitHub
not psychopy/eyetracker.py at release · psychopy/psychopy · GitHub
^ says edf file will saved on host in ‘./data’
eyelink = self._eyelink
self.sendCalibrationSettingsCommands(eyelink, tracker_config.get('calibration'))
# native data recording file
default_native_data_file_name = tracker_config.get('default_native_data_file_name', None)
if isinstance(default_native_data_file_name, str):
if default_native_data_file_name == "EXPFILE":
# If edf file name has been set to EXPFILE, use the datastore file name as the local
# edf file name, getting around the 8 char host name limit.
EyeTracker._local_edf_dir = os.path.join(EyeTracker._local_edf_dir, "data")
if self._iohub_server.dsfile:
local_file_name = self._iohub_server.dsfile.fileName[:-5]
EyeTracker._full_edf_name = local_file_name
EyeTracker._host_edf_name = default_native_data_file_name
else:
r = default_native_data_file_name.rfind('.')
if r > 0:
if default_native_data_file_name[r:] == 'edf'.lower():
default_native_data_file_name = default_native_data_file_name[:r]
but yeah i don’t get edf file on host anywhere
sol
January 21, 2022, 2:25pm
4
Thank you for reporting the issue. .edf file transfer to the display PC seems to be broken for Builder experiments. Testing a Coder demo, like demos/coder/iohub/eyetracking/simple.py
with the tracker set to 'eyelink'
does seem to work.
Will report more when I’ve figured out what is going wrong when using Builder…
sol
January 21, 2022, 4:14pm
5
The issue seems to be that the Builder generated script is not explicitly closing the connection at the end of the experiment so in the case of eyelink, the .edf file is not transfered.
As a short term fix, add a line of custom code to the end of your experiment to close the eyelink connection and transfer tthe file:
eyetracker.setConnectionState(False)
The .edf file should be saved to your experiment data directory with the same name as your other data files, but with the .edf
ending.
Thanks again
1 Like