Exemplo n.º 1
0
#Load stimulis
seq = np.loadtxt(stimuli + os.path.sep + infos['seqFilename'])

#Log
logging.addLevel(logging.EXP + 1, 'StartExp')
logging.addLevel(logging.EXP + 2, 'StartPerformance')
logging.addLevel(logging.EXP + 4, 'StartRest')
logging.addLevel(logging.EXP + 5, 'Key')
logDat = logging.LogFile(
    createOutputFile('arrow', task, infos['subject']),
    filemode='w',  # if you set this to 'a' it will append instead of overwriting
    level=logging.EXP +
    1)  # errors, data and warnings will be sent to this logfile

#Create Window @TODO Check multiple monitor and flip
currWindow = createWindow(infos['fullScreen'])

#Create Mouse object but keep it invisible
m = event.Mouse(visible=False, win=currWindow)

#Create a template pentagon to get vertices
# Param:
#   - sizePenta in cm
penta = visual.Polygon(currWindow, edges=5, radius=arrow_sizePenta, units='cm')

#Create an arrow using penta vertices
# Param:
#   - fillColor = 'white' - should be a variable
arrow = visual.ShapeStim(currWindow,
                         vertices=getArrowVertices(penta.vertices),
                         fillColor='white',
Exemplo n.º 2
0
#Menu
infos = getParamMenu()

#Log
logging.addLevel(logging.EXP + 1, 'StartExp')
logging.addLevel(logging.EXP + 2, 'StartPerformance')
logging.addLevel(logging.EXP + 4, 'StartRest')
logDat = logging.LogFile(
    createOutputFile(),
    filemode='w',  # if you set this to 'a' it will append instead of overwriting
    level=logging.DEBUG
)  # errors, data and warnings will be sent to this logfile

#Create Window @TODO Check multiple monitor and flip
currWindow = createWindow()

# Create Sound
tone = sound.Sound('F', octave=5, sampleRate=44100, secs=0.050)

# Create Cross before starting the experiment
cross = visual.ShapeStim(currWindow,
                         units='cm',
                         vertices=((0, -2), (0, 2), (0, 0), (-2, 0), (2, 0)),
                         lineWidth=900,
                         closeShape=False,
                         lineColor='red')

waitStim = visual.TextStim(currWindow,
                           text=readyMessage[infos['language']],
                           color='gold',
Exemplo n.º 3
0
# -*- coding: utf-8 -*-
#
# ld_rest: show a white cross

from psychopy import event, visual
from ld_utils import createWindow

currWindow = createWindow(True)

cross = visual.ShapeStim(currWindow,
                         units='cm',
                         vertices=((0, -2), (0, 2), (0, 0), (-2, 0), (2, 0)),
                         lineWidth=900,
                         closeShape=False,
                         lineColor='white')

cross.draw()
currWindow.flip()

k = ['']
while k[0] not in ['escape', 'esc', 'q']:
    k = event.waitKeys()

currWindow.close()
print 'End Rest'