diff options
author | rcoh <rcoh@mit.edu> | 2011-02-16 15:26:29 -0500 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2011-02-16 15:26:29 -0500 |
commit | 3c405fa182b1e524f5724e65266667d8f65dc179 (patch) | |
tree | 2e1320d152f4ae8579eb8f651be0af12da25c6cb /layouts/SpecifiedLayout.py | |
parent | d8ba03006e2ea1400e80caded738e79c186e8de3 (diff) | |
parent | f34e1c732036553e4a68534dfc1b24a13ccd33ce (diff) |
Merge branch 'master' into behavior-factory
Diffstat (limited to 'layouts/SpecifiedLayout.py')
-rw-r--r-- | layouts/SpecifiedLayout.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/layouts/SpecifiedLayout.py b/layouts/SpecifiedLayout.py new file mode 100644 index 0000000..5a6e963 --- /dev/null +++ b/layouts/SpecifiedLayout.py @@ -0,0 +1,21 @@ +from operationscore.PixelAssembler import * +class SpecifiedLayout(PixelAssembler): + """SpecifiedLayout is a class that allows precise specification of each individual LED. + Configure with a <Locations> tag in the args dict as follows': + <Args> + <Locations> + <Loc>(1,1)</Loc> + <Loc>(50,50)</Loc> + </Locations> + etc. + </Args> + You may put attributes on the Locs so that you don't get confused. + """ + + def layoutInit(self): + self.lightNum = -1 + + def layoutFunc(self, lastLocation): + self.lightNum += 1 + return self['Locations'][self.lightNum] + |