aboutsummaryrefslogtreecommitdiff
path: root/pixelmappers
diff options
context:
space:
mode:
authorGravatar dxiao <dxiao@mit.edu>2011-02-13 19:00:44 -0500
committerGravatar dxiao <dxiao@mit.edu>2011-02-13 19:00:44 -0500
commit7a4f06d15b0fe9bd22996af6a1ca2c3ca5ca3e3f (patch)
treeb15d0ba7ca22b3064e877ca6965f4a8ce84d7640 /pixelmappers
parent43bf9e8b188638ca2e11f5dff691cf54902ac8dc (diff)
Added a vertical bars animation to C5Sign-dxiao
Diffstat (limited to 'pixelmappers')
-rw-r--r--pixelmappers/C5SignMapper.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pixelmappers/C5SignMapper.py b/pixelmappers/C5SignMapper.py
index 79ebe1a..24631c4 100644
--- a/pixelmappers/C5SignMapper.py
+++ b/pixelmappers/C5SignMapper.py
@@ -1,6 +1,7 @@
from operationscore.PixelMapper import *
import util.Geo as Geo
import sys
+import math
class C5SignMapper(PixelMapper):
"""C5SignMapper is a modification to SimpleMapper which maps events to the
nearest Pixel. In addtion, it also maps sign artifacts (letters, logo, etc)
@@ -99,7 +100,9 @@ class C5SignMapper(PixelMapper):
[eventLocation, signPart] = eventLocSplit
signParts = signPart.split('.')
pixelLocs = signPosition[signParts[0]][signParts[1]]
- screen = [p for p in screen if (p.location in pixelLocs)]
+ screenPixels = [p for p in screen if (p.location in pixelLocs)]
+ else:
+ screenPixels = [p for p in screen]
#{x}>5,{y}<k
@@ -111,7 +114,7 @@ class C5SignMapper(PixelMapper):
conditionLambdas = [eval('lambda pixel:'+condition) for condition in conditions]
else:
conditionLambdas = []
- for pixel in screen:
+ for pixel in screenPixels:
try:
pixelValid = True
for p in conditionLambdas:
@@ -121,6 +124,7 @@ class C5SignMapper(PixelMapper):
if pixelValid:
ret.append((pixel, 1))
except Exception as exp:
+ import pdb; pdb.set_trace()
raise Exception('Bad event condition')
return ret