From 5fb3ea060025241105dc8e9a174513c112f9a133 Mon Sep 17 00:00:00 2001 From: rcoh Date: Thu, 27 Jan 2011 16:50:59 -0500 Subject: A metric $#%$-ton of changes. Added doc-strings to EVERYTHING. Phew. Fixed a massive bug that increases performance in by up to a factor of 60. A bunch of new behaviors for the class. --- layouts/LineLayout.py | 2 +- layouts/ZigzagLayout.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/LineLayout.py b/layouts/LineLayout.py index 34f5e36..1d40105 100644 --- a/layouts/LineLayout.py +++ b/layouts/LineLayout.py @@ -1,5 +1,5 @@ from operationscore.PixelAssembler import * -#Simple layout class that simply makes a line of LEDs class LineLayout(PixelAssembler): + """LineLayout is a layout class that makes a line of LEDs""" def layoutFunc(self, lastLocation): return (lastLocation[0]+self.argDict['spacing'], lastLocation[1]) diff --git a/layouts/ZigzagLayout.py b/layouts/ZigzagLayout.py index 221571c..3fc2ea1 100644 --- a/layouts/ZigzagLayout.py +++ b/layouts/ZigzagLayout.py @@ -10,6 +10,15 @@ import pdb # | # X-X-X-X etc. class ZigzagLayout(PixelAssembler): + """ZigZagLayout is a slightly more complex layout class that makes a zig-Zag Led Pattern + Inheriting classes must specify zigLength, the length in lights of a of a zig + and zig Axis, the direction of the long X axis (X or Y). + EG: zig length = 4, zig Axis = X would give: + X-X-X-X + | + X-X-X-X + | + X-X-X-X etc. def initLayout(self): if not 'zigLength' in self.argDict: raise Exception('zigLength must be defined in argDict') -- cgit v1.2.3