Module SCA_DelaySensor
[hide private]
[frames] | no frames]

Source Code for Module SCA_DelaySensor

 1  # $Id: SCA_DelaySensor.py 16320 2008-08-31 19:07:10Z ben2610 $
 
 2  # Documentation for SCA_DelaySensor
 
 3  from SCA_ISensor import * 
 4  
 
5 -class SCA_DelaySensor(SCA_ISensor):
6 """ 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. 16 """
17 - def setDelay(delay):
18 """ 19 Set the initial delay before the positive trigger. 20 21 @param delay: length of the initial OFF period as number of frame, 0 for immediate trigger 22 @type delay: integer 23 """
24 - def setDuration(duration):
25 """ 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. 28 29 @param duration: length of the ON period in number of frame after the initial OFF period 30 @type duration: integer 31 """
32 - def setRepeat(repeat):
33 """ 34 Set if the sensor repeat mode. 35 36 @param repeat: 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once. 37 @type repeat: integer 38 """
39 - def getDelay():
40 """ 41 Return the delay parameter value. 42 43 @rtype: integer 44 """
45 - def getDuration():
46 """ 47 Return the duration parameter value 48 49 @rtype: integer 50 """
51 - def getRepeat():
52 """ 53 Return the repeat parameter value 54 55 @rtype: KX_TRUE or KX_FALSE 56 """
57