def __init__(self, display, filename="TEST.EDF"):
        EyeLink.__init__(self)
        self._disp = display
        self._filename = filename
        self.openDataFile(filename)

        self._surfs = [0,0,1920,1080]#self._disp.get_rect()
        pylink.flushGetkeyQueue()
        
        col = 128
        print "1"
        pylink.setCalibrationColors((0, 0, 0), (col, col, col)) #Sets the calibration target and background color
        print int(self._surfs[3]/300)
#        pylink.setTargetSize(int(self._surfs[2]/70), int(self._surfs[3]/300)) #select best size for calibration target
        print "12"
        pylink.setCalibrationSounds("off", "off", "off")
        pylink.setDriftCorrectSounds("off", "off", "off")

        self.sendCommand("screen_pixel_coords =  0 0 %d %d" % (self._surfs[2], self._surfs[3]))
        self.sendMessage("DISPLAY_COORDS  0 0 %d %d" % (self._surfs[2], self._surfs[3]))
        
        #self.sendMessage("heuristic_filter" % (self._surfs[2], self._surfs[3]))
        #assert self.getTrackerVersion() == 2
        self.sendCommand("select_parser_configuration 0")
        self.setFileEventFilter("LEFT,RIGHT,FIXATION,SACCADE,BLINK,MESSAGE,BUTTON")
        self.setFileSampleFilter("LEFT,RIGHT,GAZE,AREA,GAZERES,STATUS")
        self.setLinkEventFilter("LEFT,RIGHT,FIXATION,SACCADE,BLINK,BUTTON")
        self.setLinkSampleFilter("LEFT,RIGHT,GAZE,GAZERES,AREA,STATUS")
        print "2"
        self.sendCommand("button_function 5 'accept_target_fixation'")
Exemple #2
0
 def __init__(self, win, filename="TEST.EDF"):
     self.win = win
     EyeLink.__init__(self)
     self._filename = filename
     self.openDataFile(filename)
     #EyeLinkCustomDisplay.__init__(self)
     self._surfs = pygame.display.get_surface()
     pylink.flushGetkeyQueue()
     col = 128
     pylink.setCalibrationColors(
         (0, 0, 0),
         (col, col, col))  #Sets the calibration target and background color
     self.sendCommand("screen_pixel_coords =  0 0 %d %d" %
                      (self._surfs.get_width(), self._surfs.get_height()))
     self.sendMessage("DISPLAY_COORDS  0 0 %d %d" %
                      (self._surfs.get_width(), self._surfs.get_height()))
     self.sendCommand("select_parser_configuration 0")
     self.setFileEventFilter(
         "LEFT,RIGHT,FIXATION,SACCADE,BLINK,MESSAGE,BUTTON")
     self.setFileSampleFilter("LEFT,RIGHT,GAZE,AREA,GAZERES,STATUS")
     self.setLinkEventFilter("LEFT,RIGHT,FIXATION,SACCADE,BLINK,BUTTON")
     self.setLinkSampleFilter("LEFT,RIGHT,GAZE,GAZERES,AREA,STATUS")
     self.sendCommand("button_function 5 'accept_target_fixation'")
     self.inner = visual.PatchStim(win,
                                   tex=None,
                                   mask='circle',
                                   units='pix',
                                   size=5,
                                   color=win.color)
     self.outer = visual.PatchStim(win,
                                   tex=None,
                                   mask='circle',
                                   units='pix',
                                   size=20,
                                   color=[128, 128, 128])
 def sendMessage(self, arg):
     EyeLink.sendMessage(self, arg)