aboutsummaryrefslogtreecommitdiff
path: root/layouts/SpecifiedLayout.py
blob: 5a6e963bf3679bea5e910d43215593c90718706e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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]