changeset 1254:da8a4696227f

make the rgb strip work more like the neo ones Ignore-this: e272be49d61373e188f7da5de19c273b
author drewp@bigasterisk.com
date Sat, 13 Jun 2015 06:28:30 +0000
parents 7817e1ef0ff0
children b7fb7b2649fd
files light9/Effects.py light9/effecteval/effectloop.py
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/light9/Effects.py	Sat Jun 13 06:12:44 2015 +0000
+++ b/light9/Effects.py	Sat Jun 13 06:28:30 2015 +0000
@@ -18,7 +18,7 @@
 @register
 class Strip(object):
     """list of r,g,b tuples for sending to an LED strip"""
-    which = 'L' # LR means both
+    which = 'L' # LR means both. W is the wide one
     pixels = []
     @classmethod
     def solid(cls, which='L', color=(1,1,1), hsv=None):
--- a/light9/effecteval/effectloop.py	Sat Jun 13 06:12:44 2015 +0000
+++ b/light9/effecteval/effectloop.py	Sat Jun 13 06:28:30 2015 +0000
@@ -226,7 +226,7 @@
     def combineOutputs(self, outputs):
         combined = {'L': Z, 'R': Z,
                     'blacklight0': 0, 'blacklight1': 0,
-                    'rgb': numpy.zeros((1, 3), dtype=numpy.float16)}
+                    'W': numpy.zeros((1, 3), dtype=numpy.float16)}
         
         for out in outputs:
             log.debug('combine output %r', out)
@@ -236,7 +236,8 @@
             elif isinstance(out, Effects.Strip):
                 pixels = numpy.array(out.pixels, dtype=numpy.float16)
                 for w in out.which:
-                    combined[w] = numpy.maximum(combined[w], pixels)
+                    combined[w] = numpy.maximum(
+                        combined[w], pixels[:1,:] if w == 'W' else pixels)
                 
         return combined
 
@@ -247,7 +248,7 @@
                 ('setStrip', (1,), combined['R']),
                 ('setUv', (0,), combined['blacklight0']),
                 ('setUv', (1,), combined['blacklight1']),
-                ('setRgb', (), combined['rgb']),
+                ('setRgb', (), combined['W']),
             ]:
             key = (meth, selectArgs)
             compValue = value.tolist() if isinstance(value, numpy.ndarray) else value