myTracker.tracker.isOpen())

# Set up window and experimental stimuli
win = myTracker.win  # get the window already declared in the LibSmi initialization
myText = visual.TextStim(win,
                         pos=[0, +.5],
                         wrapWidth=1.5,
                         color=params['textColor'],
                         colorSpace='rgb255',
                         alignHoriz='center',
                         name='myText',
                         text='This is the stimulus',
                         units='norm')

# run calibration and validation
myTracker.run_calibration()

# start recording via serial port
myTracker.start_recording(stream=False)

# Display stimulus (a quick example to show logging)
myText.draw()
win.callOnFlip(myTracker.log,
               'DisplayStimulus')  # log the event in the SMI file
win.flip()
core.wait(2)
win.callOnFlip(myTracker.log, 'DisplayBlank')  # log the event in the SMI file
win.flip()
core.wait(2)

# Stop recording, save and close serial port
Пример #2
0
getEYELINK().doTrackerSetup()

# START RECORDING
error = getEYELINK().startRecording(1, 1, 1, 1)
if error:
    print("===WARNING: eyelink startRecording returned %s"%error)
"""
# set up eye movie if requested
if params['recordEyeMovie']:
    eye_movie_filename = filename + '-calib'
else:
    eye_movie_filename = None
# run calibration and validation
myTracker.run_calibration(nr_of_pts=params['calNPoints'],
                          auto_accept=params['calAutoAccept'],
                          go_fast=params['calGoFast'],
                          calib_level=params['calCheckLevel'],
                          eye_movie_filename=eye_movie_filename,
                          eye_movie_format='XMP4')

# display prompts
if not params['skipPrompts']:
    PromptTools.RunPrompts(topPrompts,
                           bottomPrompts,
                           win,
                           message1,
                           message2,
                           fwdKeys=params['respKeys'])

# wait for scanner
message1.setText("Waiting for scanner to start...")
message2.setText("(Press '%c' to override.)" % params['triggerKey'].upper())
# =========================== #
# ======= RUN PROMPTS ======= #
# =========================== #

"""
#Do the tracker setup at the beginning of the experiment.
getEYELINK().doTrackerSetup()

# START RECORDING
error = getEYELINK().startRecording(1, 1, 1, 1)
if error:
    print("===WARNING: eyelink startRecording returned %s"%error)
"""
# run calibration and validation
myTracker.run_calibration(nr_of_pts=params['calNPoints'], auto_accept=params['calAutoAccept'], go_fast=params['calGoFast'], calib_level=params['calCheckLevel'])

# display prompts
if not params['skipPrompts']:
    PromptTools.RunPrompts(topPrompts,bottomPrompts,win,message1,message2)

# wait for scanner
message1.setText("Waiting for scanner to start...")
message2.setText("(Press '%c' to override.)"%params['triggerKey'].upper())
message1.draw()
message2.draw()
win.logOnFlip(level=logging.EXP, msg='Display WaitingForScanner')
win.callOnFlip(SendMessage,'DisplayWaitingForScanner')
win.flip()
event.waitKeys(keyList=params['triggerKey'])
tStartSession = globalClock.getTime()
# print results
print "screenRes = [%d,%d]"%(screenRes[0],screenRes[1])


# Set up serial port by declaring LibSmi object
myTracker = LibSmi_PsychoPy(experiment='PujasExperiment',port=params['portName'], baudrate=params['portBaud'], useSound=True, w=screenRes[0], h=screenRes[1], 
    bgcolor=params['screenColor'],fgcolor=params['textColor'],fullScreen=params['fullScreen'],screenToShow=params['screenToShow'])
print "Port %s isOpen = %d"%(myTracker.tracker.name,myTracker.tracker.isOpen())

# Set up window and experimental stimuli
win = myTracker.win # get the window already declared in the LibSmi initialization
myText = visual.TextStim(win, pos=[0,+.5], wrapWidth=1.5, color=params['textColor'], colorSpace='rgb255', alignHoriz='center', 
    name='myText', text='This is the stimulus',units='norm')

# run calibration and validation
myTracker.run_calibration()

# start recording via serial port
myTracker.start_recording(stream=False)

# Display stimulus (a quick example to show logging)
myText.draw()
win.callOnFlip(myTracker.log,'DisplayStimulus') # log the event in the SMI file
win.flip()
core.wait(2)
win.callOnFlip(myTracker.log,'DisplayBlank') # log the event in the SMI file
win.flip()
core.wait(2)

# Stop recording, save and close serial port
myTracker.stop_recording() # stop recording via serial port