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. --- operationscore/PixelMapper.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'operationscore') diff --git a/operationscore/PixelMapper.py b/operationscore/PixelMapper.py index e3f2515..1f94fa5 100644 --- a/operationscore/PixelMapper.py +++ b/operationscore/PixelMapper.py @@ -3,8 +3,14 @@ import pdb class PixelMapper(SmootCoreObject): def init(self): self.mem = {} #Dictionary of all seen events + self.totalCalls = 0 + self.cachehits = 0 def mapEvent(self, eventLocation, screen): + self.totalCalls += 1 + if self.totalCalls % 100 == 0: + print self['Id'], self.cachehits / float(self.totalCalls) if eventLocation in self.mem: + self.cachehits += 1 return self.mem[eventLocation] else: self.mem[eventLocation] = self.mappingFunction(eventLocation, screen) -- cgit v1.2.3