1
# $Id: SCA_DelaySensor.py 16320 2008-08-31 19:07:10Z ben2610 $
2
# Documentation for SCA_DelaySensor
3
from SCA_ISensor import *
5
class SCA_DelaySensor(SCA_ISensor):
7
The Delay sensor generates positive and negative triggers at precise time,
8
expressed in number of frames. The delay parameter defines the length
9
of the initial OFF period. A positive trigger is generated at the end of this period.
10
The duration parameter defines the length of the ON period following the OFF period.
11
There is a negative trigger at the end of the ON period. If duration is 0, the sensor
12
stays ON and there is no negative trigger.
13
The sensor runs the OFF-ON cycle once unless the repeat option is set: the
14
OFF-ON cycle repeats indefinately (or the OFF cycle if duration is 0).
15
Use SCA_ISensor::reset() at any time to restart sensor.
19
Set the initial delay before the positive trigger.
21
@param delay: length of the initial OFF period as number of frame, 0 for immediate trigger
24
def setDuration(duration):
26
Set the duration of the ON pulse after initial delay and the generation of the positive trigger.
27
If duration is greater than 0, a negative trigger is sent at the end of the ON pulse.
29
@param duration: length of the ON period in number of frame after the initial OFF period
30
@type duration: integer
32
def setRepeat(repeat):
34
Set if the sensor repeat mode.
36
@param repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once.
41
Return the delay parameter value.
47
Return the duration parameter value
53
Return the repeat parameter value
55
@rtype: KX_TRUE or KX_FALSE