PDA

View Full Version : waitDirector


jaclyn.bill
07-07-2010, 11:37 AM
Dear users,

I'm running a series of experiment in which I have to run several functions in succession as trials. I'm trying to use the waitdirector command to do this at the moment


def runtrials():
global currentTime
yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)
yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)
yield viztask.waitMouseDown(viz.MOUSEBUTTON_LEFT)
currentTime=viz.tick()
wedgemake()
movewedge1(); print '1'
yield viztask.waitDirector(movewedge1)
movewedge2(); print '2'

viztask.schedule(runtrials())


So in the above example I want it to run wedgemake, and movewedge1 in quick succession and then run movewedge2 once movewedge1 has finished. At the moment movewedge1 and movewedge2 keep running at the same time.

I've previously got round the issue by using waittime commands within a loop which selects trials (as I know how long the trials will be). However, I would like to avoid doing this in this experiment.

Can anyone off advice on the waitDirector command?

Many thanks

Jeff
07-08-2010, 05:12 AM
Try using sub tasks instead for each of the functions you want to yield for. Sub tasks are explained in the Vizard docs.

jaclyn.bill
07-10-2010, 03:22 AM
Thanks for this advice Jeff. Working well now.

J