aboutsummaryrefslogtreecommitdiff
path: root/config/SmootWindTest.xml
blob: f6e7a976f8f4f5e7e10f93e0578eb6e1ff15615f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!---All configuration items contain a "Class" tag specifying the python class they represent, and an "Args" tag specifying the args to be passed in.-->
<LightInstallation>
    <InstallationConfiguration>
        <Defaults>
            <PixelMapper>simplemap</PixelMapper>
        </Defaults>
    </InstallationConfiguration>
    <PixelConfiguration>
        <InheritsFrom>layouts/60StripLayout.xml</InheritsFrom>
    </PixelConfiguration>
    <PixelMapperConfiguration>
        <PixelMapper>
            <Class>pixelmappers.SimpleMapper</Class>
            <Args>
                <Id>simplemap</Id>
                <CutoffDist>20</CutoffDist>
            </Args>
        </PixelMapper>
        <PixelMapper>
            <Class>pixelmappers.GaussianMapper</Class>
            <Args>
                <Id>gaussmap</Id>
                <CutoffDist>10</CutoffDist>
                <MinWeight>0.1</MinWeight>
                <Width>10</Width>
                <Height>5</Height>
            </Args>
        </PixelMapper>
        <PixelMapper>
            <Class>pixelmappers.WindGaussianMapper</Class>
            <Args>
                <Id>windgaussmap</Id>
                <CutoffDist>150</CutoffDist>
                <MinWeight>0.005</MinWeight>
                <Width>30</Width>
                <Height>10</Height>
            </Args>
        </PixelMapper>
    </PixelMapperConfiguration>
    <RendererConfiguration>
        <Renderer>
            <InheritsFrom>renderers/60StripSeq.xml</InheritsFrom>
        </Renderer>
        <Renderer>
            <InheritsFrom>renderers/Pygame.xml</InheritsFrom>
        </Renderer>
    </RendererConfiguration>
    <InputConfiguration>
        <InputElement>
            <Class>inputs.PygameInput</Class>
            <Args><!--Passed as a dictionary-->
                <Id>pygame</Id>
                <RefreshInterval>1</RefreshInterval>
            </Args>
        </InputElement>
        <InputElement>
            <Class>inputs.PygameInput</Class>
            <Args>
                <Id>pygamekey</Id>
                <RefreshInterval>10</RefreshInterval>
                <Keyboard>True</Keyboard>
            </Args>
        </InputElement>
	<InputElement>
	  <Class>inputs.HTMLInput</Class>
	  <Args>
	    <Id>weatherinput</Id>
	    <Src>'http://sailing.mit.edu/weather/'</Src>
	    <!--<Regex>'rtWindSpeed = (\d+).*rtWindDir = (\d+)'</Regex>-->
	    <Regex>'rtWindSpeed = (\d+).*\s.*\s.*rtWindDir = (\d+)'</Regex>
	    <!--<RefreshInterval>60000</RefreshInterval>-->
	  </Args>
	</InputElement>
        <InputElement>
            <Class>inputs.RandomLocs</Class>
            <Args>
                <Id>randomLoc</Id>
            </Args>
        </InputElement>
    </InputConfiguration>
    <BehaviorConfiguration>
        <Behavior Id="colorchange">
            <InheritsFrom>behaviors/RandomColor.xml</InheritsFrom>
        </Behavior>
	<Behavior Id="staticcolor">
            <InheritsFrom>behaviors/RandomColor.xml</InheritsFrom>
	    <Args>
            	<ColorList>
			<Val>(100,200,255)</Val>
			<Val>(50,200,255)</Val>
			<Val>(0,200,255)</Val>
			<Val>(0,150,255)</Val>
		</ColorList>
	    </Args>
	</Behavior>
        <Behavior Id="decay">
            <InheritsFrom>behaviors/PixelDecay.xml</InheritsFrom>
        </Behavior>
        <Behavior>
            <Class>behaviors.XYMove</Class>
            <Args>
                <Id>xymove</Id>
                <XStep>0</XStep>
                <YStep>0</YStep>
            </Args>
        </Behavior>
        <Behavior>
            <Class>behaviors.BehaviorChain</Class>
            <Args>		
                <Id>movebounce</Id>
                <ChainedBehaviors>
                    <Id>xymove</Id>
                    <Id>yfor</Id>
		            <Id>xfor</Id> 	
                    <Id>20sectimeout</Id>
                </ChainedBehaviors>
            </Args>
        </Behavior>
        <Behavior>
            <Class>behaviors.Timeout</Class>
            <Args>
                <Id>20sectimeout</Id>
                <Timeout>20000</Timeout>
            </Args>
        </Behavior>
        <Behavior>
            <Class>behaviors.ModifyParam</Class>
            <Args>
                <Id>yfor</Id>
                <ParamName>YStep</ParamName>
                <ParamType>Sensor</ParamType>
                <ParamOp>2*(2*math.sin({x}/float(100))+math.sin({x}/float(50)))</ParamOp>          
            </Args>
        </Behavior>

	<Behavior>
            <Class>behaviors.ModifyParam</Class>
            <Args>
                <Id>xfor</Id>
                <ParamName>XStep</ParamName>
                <ParamType>Sensor</ParamType>
                <!--<ParamOp>75</ParamOp>-->
		<ParamOp>25</ParamOp>
            </Args>
        </Behavior>
       
	<Behavior>
	    <Class>behaviors.SmootWind</Class>    
	    <Args>
		<Id>smootwind</Id>		
		<Inputs>
          <Id>pygamekey</Id>
	    </Inputs>		
	    </Args>
	</Behavior>
        <Behavior>
            <Class>behaviors.ResponseMover</Class>
            <Args>
                <Id>mover</Id>
            </Args>
        </Behavior>
        <Behavior>
            <Class>behaviors.BehaviorChain</Class>
            <Args>
                <Id>xymover</Id>
                <Inputs>
		  <Id>pygame</Id>
		  <Id>randomLoc</Id>
		</Inputs>
                <ChainedBehaviors>
                    <Id>staticcolor</Id>
                    <Id>mover</Id>
                    <Id>decay</Id>
                </ChainedBehaviors>
                <RecursiveHooks>{'mover':'movebounce'}</RecursiveHooks>
                <RenderToScreen>True</RenderToScreen>
                <Mapper>windgaussmap</Mapper>
           </Args>
       </Behavior>
    </BehaviorConfiguration>
</LightInstallation>