If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10): Win10
PsychoPy version : 2021.1
Standard Standalone? (y/n) yes
What are you trying to achieve?:
I’m trying to create a experiment where the Eye-Tracker is calibrated two times. Once at the beginning and once after a break in which the participants can leave the experiment room.
What did you try to make it work?:
I created a new Experiment with solely two Calibration Routines (with the same name and different names) and the second calibration was not initiated.
What specifically went wrong when you tried that?:
The second calibration routine is skipped and the Experiment continues.
At the end the following error code appears in the runner:
“Unable to use new EyeLinkCustomDisplay when a previous EyeLinkCustomDisplay is active. Call closeGraphics() before calling openGraphicsEx()”
Hi @M1A3N0U4,
Thanks for your post.
Could you please try inserting a code component at the beginning of the break routine with the code suggested in the error message:
closeGraphics()
Then see if your second calibration routine will work?
Thanks,
Kim
Dear Kim,
Thanks for your response!
Adding closeGraphics()
in a custom code component before attempting to calibrate again did not work. PsychoPy still raises RuntimeError(“Unable to use new EyeLinkCustomDisplay when a previous EyeLinkCustomDisplay is active. Call closeGraphics() before calling openGraphicsEx()”).
Apparently, PsychoPy is attempting to open a new Eyelink Window ( openGraphicsEx(eyeCustomDisplay)
for calibration) when calling calibration.run()
, yet the Window from the former calibration is never closed, so calibration.run()
is skipped and openGraphicsEx(eyeCustomDisplay)
raises the Error.
Adding closeGraphics()
in the eyelink.py module in Pylink (Program Files\PsychoPy\Lib\site-packages\pylink) worked:
def openGraphicsEx(eyeCustomDisplay):
global customGraphics
if pylinkcg:
raise RuntimeError("Unable to use EyeLinkCustomDisplay when Core Graphics is active. Call closeGraphics() before calling openGraphicsEx()")
if customGraphics:
#raise RuntimeError("Unable to use new EyeLinkCustomDisplay when a previous EyeLinkCustomDisplay is active. Call closeGraphics() before calling openGraphicsEx()")
closeGraphics()
if(isinstance(eyeCustomDisplay,EyeLinkCustomDisplay)):
rv = openCustomGraphicsInternal(eyeCustomDisplay)
customGraphics=eyeCustomDisplay
return rv
else:
raise RuntimeError("Expecting object of type EyeLinkCustomDisplay got "+ eyeCustomDisplay.__class__.__name__)
2 Likes