From a223608dda0751551c6e8688c0c0e1c9a1d4e69c Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Fri, 21 Jan 2011 00:57:14 -0500 Subject: Added a new config file to run the upstairs lights. Modified PixelMapper to track cache hits. Added 60-strip layouts and renderer configs. --- pixelcore/Pixel.py | 8 ++++---- pixelcore/Screen.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'pixelcore') diff --git a/pixelcore/Pixel.py b/pixelcore/Pixel.py index b9fc07f..7260e56 100644 --- a/pixelcore/Pixel.py +++ b/pixelcore/Pixel.py @@ -29,10 +29,10 @@ class Pixel: #arg #Add a pixelEvent to the list of active events - def processInput(self,pixelEvent,zindex, currentTime=None): #consider migrating arg to dict + def processInput(self,pixelEvent,zindex, scale=1,currentTime=None): #consider migrating arg to dict if currentTime == None: currentTime = timeops.time() - self.events[currentTime] = (zindex, pixelEvent) + self.events[currentTime] = (zindex,scale, pixelEvent) def clearAllEvents(self): self.events = {} @@ -49,10 +49,10 @@ class Pixel: resultingColor = (0,0,0) colors = [] for eventTime in self.events: #TODO: right color weighting code - (zindex,event) = self.events[eventTime] + (zindex,scale,event) = self.events[eventTime] eventResult = event.state(currentTime-eventTime) if eventResult != None: - colors.append(eventResult) + colors.append(color.multiplyColor(eventResult,scale)) else: deadEvents.append(eventTime) diff --git a/pixelcore/Screen.py b/pixelcore/Screen.py index 6666235..cfadee8 100644 --- a/pixelcore/Screen.py +++ b/pixelcore/Screen.py @@ -73,6 +73,7 @@ class Screen: maxY = max(y, maxY) self.size = (0,0, maxX, maxY) self.sizeValid = True + print self.size return (0, 0, maxX+100, maxY+100) #TODO: cleaner #private @@ -88,8 +89,7 @@ class Screen: #if type(mapper) != type(PixelMapper): # raise Exception('No default mapper specified.') pixelWeightList = mapper.mapEvent(responseInfo['Location'], self) - PixelEvent.addPixelEventIfMissing(responseInfo) currentTime = timeops.time() for (pixel, weight) in pixelWeightList: - pixel.processInput(responseInfo['PixelEvent'].scale(weight), 0, currentTime) #TODO: z-index + pixel.processInput(responseInfo['PixelEvent'], 0,weight, currentTime) #TODO: z-index -- cgit v1.2.3