WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-07-2010, 11:37 AM
jaclyn.bill jaclyn.bill is offline
Member
 
Join Date: Oct 2007
Posts: 42
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
Reply With Quote
  #2  
Old 07-08-2010, 05:12 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Try using sub tasks instead for each of the functions you want to yield for. Sub tasks are explained in the Vizard docs.
Reply With Quote
  #3  
Old 07-10-2010, 03:22 AM
jaclyn.bill jaclyn.bill is offline
Member
 
Join Date: Oct 2007
Posts: 42
Thanks for this advice Jeff. Working well now.

J
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:34 PM.


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