WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-20-2008, 02:23 PM
vizmaster vizmaster is offline
Member
 
Join Date: Aug 2006
Posts: 27
Control of timers

I am using viz.play and viz.pause to control timers. However, I am looking at stopping and starting individual timers. Can I use Timer IDs to control timers?
__________________
VizMaster
Reply With Quote
  #2  
Old 08-21-2008, 11:57 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
If you want to control individual timers, then I recommend using the vizact library, specifically, the vizact.ontimer function. Here is some sample code that creates a simple timer and uses the keyboard to toggle it on/off:
Code:
import viz
viz.go()

def DoSomething():
	print viz.getFrameNumber()

#Create timer that calls 'DoSomething' every 1 second
mytimer = vizact.ontimer(1,DoSomething)


def ToggleTimer():
	mytimer.setEnabled(viz.TOGGLE)
	
#Toggle timer on/off when spacebar pressed
vizact.onkeydown(' ',ToggleTimer)
Reply With Quote
  #3  
Old 08-21-2008, 03:23 PM
vizmaster vizmaster is offline
Member
 
Join Date: Aug 2006
Posts: 27
Scenario is:
Several test subjects have X amount of time to do something. During that time I need to pause one upto all test subjects. Then resume with whatever time they have left.
Do class timers work independent of each other. Can I play and pause within a class?
__________________
VizMaster
Reply With Quote
  #4  
Old 08-21-2008, 03:30 PM
vizmaster vizmaster is offline
Member
 
Join Date: Aug 2006
Posts: 27
Does <node3d>.pauseActions pause between actions in a pool or does it pause the actions. Will it pause a timer in the pool?
__________________
VizMaster
Reply With Quote
  #5  
Old 08-21-2008, 04:42 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You cannot play/pause timers within a class timer. <node>.pauseActions will pause the running action. If you have a vizact.waittime action, it will be paused and resumed from where it was paused.
Reply With Quote
  #6  
Old 08-22-2008, 09:45 AM
vizmaster vizmaster is offline
Member
 
Join Date: Aug 2006
Posts: 27
Can you answer:
Do class timers work independent of each other. Can I play and pause within a class?
__________________
VizMaster
Reply With Quote
  #7  
Old 08-22-2008, 10:36 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
No, you cannot. I believe I answered that in my previous post. Sorry if it was not clear.
Reply With Quote
Reply


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Viewpoint control Vinicius Lima Vizard 6 08-20-2007 06:51 PM
intersense: Failed to set control word on \\.\COM1 OueOue Precision Position Tracker (PPT) 2 01-18-2007 01:51 PM
timers and director function Jerry Vizard 1 06-22-2006 10:47 AM
multiple timers paulpars Vizard 4 06-02-2006 11:12 AM
Overriding Mouse Control Vygreif Vizard 3 09-28-2005 09:51 PM


All times are GMT -7. The time now is 06:22 AM.


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