From cb69d2e1c7ced951cbf7a31ee286b0ed92cab8a8 Mon Sep 17 00:00:00 2001 From: rcoh Date: Fri, 18 Feb 2011 16:56:43 -0500 Subject: Adding Epydoc generated docs. --- html/SmootLight.behaviors.Flasher-pysrc.html | 154 +++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 html/SmootLight.behaviors.Flasher-pysrc.html (limited to 'html/SmootLight.behaviors.Flasher-pysrc.html') diff --git a/html/SmootLight.behaviors.Flasher-pysrc.html b/html/SmootLight.behaviors.Flasher-pysrc.html new file mode 100644 index 0000000..57e100a --- /dev/null +++ b/html/SmootLight.behaviors.Flasher-pysrc.html @@ -0,0 +1,154 @@ + + + + + SmootLight.behaviors.Flasher + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package SmootLight :: + Package behaviors :: + Module Flasher + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module SmootLight.behaviors.Flasher

+
+ 1   
+ 2  from operationscore.Behavior import * 
+ 3  import util.ColorOps as colorops 
+ 4  import pdb 
+
5 -class Flasher(Behavior): +
6 """Implements a pulsing/flashing behavior. + 7 Jim Salem + 8 + 9 Args: +10 Factor - The speed of flashing. Must be b/w 0 and 1. Default is .95 +11 """ +
12 - def processResponse(self, sensorInputs, recursiveInputs): +
13 ret = [] +14 for response in sensorInputs: +15 # Get the multiplier +16 if self['Factor'] != None: +17 factor = self['Factor'] +18 else: +19 factor = 0.95 +20 # Initialize the first time +21 if not 'FireflyStartColor' in response: +22 response['FireflyValue'] = 1.0 +23 response['FireflyDir'] = 1 +24 response['FireflyStartColor'] = response['Color']; +25 else: +26 # Update the current value +27 if response['FireflyDir'] == 1: +28 response['FireflyValue'] = response['FireflyValue'] * factor +29 if response['FireflyValue'] <= 0.01: +30 response['FireflyValue'] = 0.01 +31 response['FireflyDir'] = 0 +32 else: +33 response['FireflyValue'] = response['FireflyValue'] / factor +34 if response['FireflyValue'] >= 1.0: +35 response['FireflyValue'] = 1.0 +36 response['FireflyDir'] = 1 +37 +38 # Compute the color +39 response['Color'] = colorops.multiplyColor(response['FireflyStartColor'], response['FireflyValue']) +40 ret.append(response) +41 return (ret, []) #no direct ouput +
42 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + -- cgit v1.2.3