WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   waitDirector (https://forum.worldviz.com/showthread.php?t=2821)

jaclyn.bill 07-07-2010 11:37 AM

waitDirector
 
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

Code:

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


All times are GMT -7. The time now is 01:14 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC