diff options
author | rcoh <rcoh@mit.edu> | 2010-12-20 14:50:08 -0500 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2010-12-20 14:50:08 -0500 |
commit | 2736307c1d6d67868ca54a3df951f9e959efedd0 (patch) | |
tree | 50a61c798d52987f8fe575f678aaff5b5b9455b9 /pixelcore/Screen.py | |
parent | 7386cbc7ce48e3996d92d84cff3d1a4dab8f538d (diff) |
Util cleanup is done! Util.py is now refactored into the util module. Woo! RCOH
Diffstat (limited to 'pixelcore/Screen.py')
-rw-r--r-- | pixelcore/Screen.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pixelcore/Screen.py b/pixelcore/Screen.py index 92805a8..a20cc72 100644 --- a/pixelcore/Screen.py +++ b/pixelcore/Screen.py @@ -1,5 +1,7 @@ from pixelcore.Pixel import * from pixelcore.PixelStrip import * +from operationscore.PixelEvent import * +import util.Search as Search import itertools #Class representing a collection of Pixels grouped into PixelStrips. Needs a #PixelMapper, currently set via setMapper by may be migrated into the argDict. @@ -17,8 +19,8 @@ class Screen: self.computeXSortedPixels() #Returns (pixelIndex, pixel). Does a binary search. def pixelsInRange(self, minX, maxX): - minIndex = Util.find_ge(self.xPixelLocs, minX) - maxIndex = Util.find_le(self.xPixelLocs, maxX)+1 + minIndex = Search.find_ge(self.xPixelLocs, minX) + maxIndex = Search.find_le(self.xPixelLocs, maxX)+1 return self.xSortedPixels[minIndex:maxIndex] def computeXSortedPixels(self): for pixel in self: @@ -70,7 +72,7 @@ class Screen: pass #pdb.set_trace() pixelWeightList = self.mapper.mapEvent(responseInfo['Location'], self) - Util.addPixelEventIfMissing(responseInfo) + PixelEvent.addPixelEventIfMissing(responseInfo) for (pixel, weight) in pixelWeightList: pixel.processInput(responseInfo['PixelEvent'].scale(weight), 0) #TODO: z-index |