forked from batourin/DanielsLightingLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DMXPTZFixture.cs
390 lines (374 loc) · 11.9 KB
/
DMXPTZFixture.cs
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using Daniels.Common;
namespace Daniels.Lighting
{
public class DMXPTZFixture : DMXFixture
{
public DMXPTZFixture(LightGroup group, DMXFixtureConfig config, BasicTriList transport)
: base(group, config, transport)
{
}
public override string ToString()
{
StringBuilder sb = new StringBuilder(base.ToString());
sb.AppendLine("\tPan: " + Pan);
sb.AppendLine("\tTilt: " + Tilt);
sb.AppendLine("\tZoom: " + Zoom + " (" + (1f * Zoom / ushort.MaxValue).ToString("P2") + ")");
sb.AppendLine("\tIris: " + Iris + " (" + (1f * Iris / ushort.MaxValue).ToString("P2") + ")");
sb.AppendLine("\tFocus: " + Focus + " (" + (1f * Focus / ushort.MaxValue).ToString("P2") + ")");
sb.AppendLine("\tBlade1: " + Blade1);
sb.AppendLine("\tBlade1Rotate: " + Blade1Rotate);
sb.AppendLine("\tBlade2: " + Blade2);
sb.AppendLine("\tBlade2Rotate: " + Blade2Rotate);
sb.AppendLine("\tBlade3: " + Blade3);
sb.AppendLine("\tBlade3Rotate: " + Blade3Rotate);
sb.AppendLine("\tBlade4: " + Blade4);
sb.AppendLine("\tBlade4Rotate: " + Blade4Rotate);
return sb.ToString();
}
#region Pan
/*
* Pan
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> PanChanged;
protected virtual void OnPanChanged(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = PanChanged;
if (handler != null)
{
handler(this, e);
}
}
private ushort _pan;
[JsonProperty]
public ushort Pan
{
get { return _pan; }
set
{
_pan = value;
setTransportValue(DMXChannel.Pan, value);
OnPanChanged(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Pan
#region Tilt
/*
* Tilt
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> TiltChanged;
protected virtual void OnTiltChanged(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = TiltChanged;
if (handler != null)
{
handler(this, e);
}
}
private ushort _tilt;
[JsonProperty]
public ushort Tilt
{
get { return _tilt; }
set
{
_tilt = value;
setTransportValue(DMXChannel.Tilt, value);
OnTiltChanged(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Tilt
#region Zoom
/*
* Zoom
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> ZoomChanged;
protected virtual void OnZoomChanged(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = ZoomChanged;
if (handler != null)
{
handler(this, e);
}
}
private ushort _zoom;
[JsonProperty]
public ushort Zoom
{
get { return _zoom; }
set
{
_zoom = value;
setTransportValue(DMXChannel.Zoom, value);
OnZoomChanged(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Zoom
#region Iris
/*
* Iris
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> IrisChanged;
protected virtual void OnIrisChanged(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = IrisChanged;
if (handler != null)
{
handler(this, e);
}
}
private ushort _iris;
[JsonProperty]
public ushort Iris
{
get { return _iris; }
set
{
_iris = value;
setTransportValue(DMXChannel.Iris, value);
OnIrisChanged(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Iris
#region Focus
/*
* Focus
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> FocusChanged;
protected virtual void OnFocusChanged(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = FocusChanged;
if (handler != null)
{
handler(this, e);
}
}
private ushort _focus;
[JsonProperty]
public ushort Focus
{
get { return _focus; }
set
{
_focus = value;
setTransportValue(DMXChannel.Focus, value);
OnFocusChanged(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Focus
#region Blade1
/*
* Blade1
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> Blade1Changed;
protected virtual void OnBlade1Changed(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = Blade1Changed;
if (handler != null)
{
handler(this, e);
}
}
private ushort _blade1;
[JsonProperty]
public ushort Blade1
{
get { return _blade1; }
set
{
_blade1 = value;
setTransportValue(DMXChannel.Blade1, value);
OnBlade1Changed(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Blade1
#region Blade1Rotate
/*
* Blade1Rotate
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> Blade1RotateChanged;
protected virtual void OnBlade1RotateChanged(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = Blade1RotateChanged;
if (handler != null)
{
handler(this, e);
}
}
private ushort _blade1Rotate;
[JsonProperty]
public ushort Blade1Rotate
{
get { return _blade1Rotate; }
set
{
_blade1Rotate = value;
setTransportValue(DMXChannel.Blade1Rotate, value);
OnBlade1RotateChanged(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Blade1Rotate
#region Blade2
/*
* Blade2
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> Blade2Changed;
protected virtual void OnBlade2Changed(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = Blade2Changed;
if (handler != null)
{
handler(this, e);
}
}
private ushort _blade2;
[JsonProperty]
public ushort Blade2
{
get { return _blade2; }
set
{
_blade2 = value;
setTransportValue(DMXChannel.Blade2, value);
OnBlade2Changed(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Blade2
#region Blade2Rotate
/*
* Blade2Rotate
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> Blade2RotateChanged;
protected virtual void OnBlade2RotateChanged(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = Blade2RotateChanged;
if (handler != null)
{
handler(this, e);
}
}
private ushort _blade2Rotate;
[JsonProperty]
public ushort Blade2Rotate
{
get { return _blade2Rotate; }
set
{
_blade2Rotate = value;
setTransportValue(DMXChannel.Blade2Rotate, value);
OnBlade2RotateChanged(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Blade2Rotate
#region Blade3
/*
* Blade3
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> Blade3Changed;
protected virtual void OnBlade3Changed(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = Blade3Changed;
if (handler != null)
{
handler(this, e);
}
}
private ushort _blade3;
[JsonProperty]
public ushort Blade3
{
get { return _blade3; }
set
{
_blade3 = value;
setTransportValue(DMXChannel.Blade3, value);
OnBlade3Changed(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Blade3
#region Blade3Rotate
/*
* Blade3Rotate
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> Blade3RotateChanged;
protected virtual void OnBlade3RotateChanged(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = Blade3RotateChanged;
if (handler != null)
{
handler(this, e);
}
}
private ushort _blade3Rotate;
[JsonProperty]
public ushort Blade3Rotate
{
get { return _blade3Rotate; }
set
{
_blade3Rotate = value;
setTransportValue(DMXChannel.Blade3Rotate, value);
OnBlade3RotateChanged(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Blade3Rotate
#region Blade4
/*
* Blade4
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> Blade4Changed;
protected virtual void OnBlade4Changed(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = Blade4Changed;
if (handler != null)
{
handler(this, e);
}
}
private ushort _blade4;
[JsonProperty]
public ushort Blade4
{
get { return _blade4; }
set
{
_blade4 = value;
setTransportValue(DMXChannel.Blade4, value);
OnBlade4Changed(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Blade4
#region Blade4Rotate
/*
* Blade4Rotate
*/
public event EventHandler<ReadOnlyEventArgs<ushort>> Blade4RotateChanged;
protected virtual void OnBlade4RotateChanged(ReadOnlyEventArgs<ushort> e)
{
EventHandler<ReadOnlyEventArgs<ushort>> handler = Blade4RotateChanged;
if (handler != null)
{
handler(this, e);
}
}
private ushort _blade4Rotate;
[JsonProperty]
public ushort Blade4Rotate
{
get { return _blade4Rotate; }
set
{
_blade4Rotate = value;
setTransportValue(DMXChannel.Blade4Rotate, value);
OnBlade4RotateChanged(new ReadOnlyEventArgs<ushort>(value));
}
}
#endregion Blade43Rotate
}
}