Skip to content

Commit a396b40

Browse files
authored
Add/restore fine channel related fixture features (#3622)
1 parent 401b27a commit a396b40

File tree

4 files changed

+320
-216
lines changed

4 files changed

+320
-216
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import CoarseChannel from '../model/CoarseChannel.js';
2+
3+
/** @typedef {import('../model/Fixture.js').default} Fixture */
4+
5+
export default [
6+
{
7+
id: `16bit-capability-range`,
8+
name: `16bit capability range`,
9+
description: `Whether a capability has a 16bit DMX value range`,
10+
11+
/**
12+
* @param {Fixture} fixture The Fixture instance
13+
* @returns {boolean} true if the fixture uses the feature
14+
*/
15+
hasFeature: fixture => fixture.coarseChannels.some(
16+
channel => channel.dmxValueResolution === CoarseChannel.RESOLUTION_16BIT && channel.capabilities.some(
17+
capability => capability.rawDmxRange.start % 256 !== 0,
18+
),
19+
),
20+
},
21+
22+
{
23+
id: `16bit-default-value`,
24+
name: `16bit default value`,
25+
description: `Whether a channel has a 16bit default value`,
26+
27+
/**
28+
* @param {Fixture} fixture The Fixture instance
29+
* @returns {boolean} true if the fixture uses the feature
30+
*/
31+
hasFeature: fixture => fixture.coarseChannels.some(
32+
channel => Number.isInteger(channel.jsonObject.defaultValue) && channel.defaultValue % 256 !== 0,
33+
),
34+
},
35+
];

lib/fixture-features/fine-channels.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default [
3535
* @returns {boolean} true if the fixture uses the feature
3636
*/
3737
hasFeature: fixture => fixture.coarseChannels.some(
38-
channel => channel.hasCapabilities && channel.fineChannelAliases.length > 0,
38+
channel => channel.fineChannelAliases.length > 0 && channel.capabilities.length > 1,
3939
),
4040
},
4141
];

tests/test-fixtures.json

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,54 @@
5252
"reused-channels"
5353
]
5454
},
55+
{
56+
"man": "ayrton",
57+
"key": "diablo-tc",
58+
"name": "Diablo-TC",
59+
"features": [
60+
"16bit-default-value",
61+
"capability-type-NoFunction",
62+
"capability-type-ShutterStrobe",
63+
"capability-type-Intensity",
64+
"capability-type-ColorIntensity",
65+
"capability-type-ColorTemperature",
66+
"capability-type-Pan",
67+
"capability-type-Tilt",
68+
"capability-type-PanTiltSpeed",
69+
"capability-type-WheelSlot",
70+
"capability-type-WheelShake",
71+
"capability-type-WheelSlotRotation",
72+
"capability-type-WheelRotation",
73+
"capability-type-Effect",
74+
"capability-type-EffectSpeed",
75+
"capability-type-Focus",
76+
"capability-type-Zoom",
77+
"capability-type-Iris",
78+
"capability-type-IrisEffect",
79+
"capability-type-Frost",
80+
"capability-type-Prism",
81+
"capability-type-PrismRotation",
82+
"capability-type-BladeInsertion",
83+
"capability-type-BladeSystemRotation",
84+
"capability-type-Time",
85+
"capability-type-Maintenance",
86+
"fine-channel-alias",
87+
"fine-channel-capabilities",
88+
"floating-point-dimensions",
89+
"floating-point-weight",
90+
"floating-point-lens-degrees",
91+
"multiple-categories",
92+
"reused-channels",
93+
"wheel-type-Color",
94+
"wheel-type-Gobo",
95+
"wheel-type-AnimationGobo",
96+
"wheel-slot-type-Open",
97+
"wheel-slot-type-Color",
98+
"wheel-slot-type-Gobo",
99+
"wheel-slot-type-AnimationGoboStart",
100+
"wheel-slot-type-AnimationGoboEnd"
101+
]
102+
},
55103
{
56104
"man": "cameo",
57105
"key": "auro-beam-150",
@@ -207,6 +255,7 @@
207255
"key": "impression-laser",
208256
"name": "impression Laser",
209257
"features": [
258+
"16bit-default-value",
210259
"capability-type-NoFunction",
211260
"capability-type-ShutterStrobe",
212261
"capability-type-Intensity",
@@ -230,6 +279,8 @@
230279
"key": "knv-arc",
231280
"name": "KNV Arc",
232281
"features": [
282+
"16bit-capability-range",
283+
"16bit-default-value",
233284
"capability-type-NoFunction",
234285
"capability-type-ShutterStrobe",
235286
"capability-type-StrobeDuration",
@@ -242,6 +293,7 @@
242293
"capability-type-EffectParameter",
243294
"capability-type-Maintenance",
244295
"fine-channel-alias",
296+
"fine-channel-capabilities",
245297
"floating-point-weight",
246298
"matrix-pixelKeys",
247299
"matrix-pixelGroups",
@@ -283,6 +335,8 @@
283335
"key": "mac-axiom-hybrid",
284336
"name": "MAC Axiom Hybrid",
285337
"features": [
338+
"16bit-capability-range",
339+
"16bit-default-value",
286340
"capability-type-NoFunction",
287341
"capability-type-ShutterStrobe",
288342
"capability-type-Intensity",
@@ -303,6 +357,7 @@
303357
"capability-type-PrismRotation",
304358
"capability-type-Maintenance",
305359
"fine-channel-alias",
360+
"fine-channel-capabilities",
306361
"floating-point-weight",
307362
"multiple-categories",
308363
"switching-channels",
@@ -323,6 +378,8 @@
323378
"key": "mac-encore-performance",
324379
"name": "MAC Encore Performance",
325380
"features": [
381+
"16bit-capability-range",
382+
"16bit-default-value",
326383
"capability-type-NoFunction",
327384
"capability-type-ShutterStrobe",
328385
"capability-type-Intensity",
@@ -347,6 +404,7 @@
347404
"capability-type-Maintenance",
348405
"capability-type-Generic",
349406
"fine-channel-alias",
407+
"fine-channel-capabilities",
350408
"multiple-categories",
351409
"physical-override",
352410
"reused-channels",
@@ -367,6 +425,7 @@
367425
"key": "mania-scx500",
368426
"name": "Mania SCX500",
369427
"features": [
428+
"16bit-default-value",
370429
"capability-type-NoFunction",
371430
"capability-type-ShutterStrobe",
372431
"capability-type-Intensity",
@@ -410,6 +469,7 @@
410469
"key": "diamond19",
411470
"name": "DIAMOND19",
412471
"features": [
472+
"16bit-default-value",
413473
"capability-type-NoFunction",
414474
"capability-type-ShutterStrobe",
415475
"capability-type-StrobeSpeed",
@@ -442,6 +502,7 @@
442502
"key": "lux-ld01",
443503
"name": "Lux Ld01",
444504
"features": [
505+
"16bit-default-value",
445506
"capability-type-NoFunction",
446507
"capability-type-ShutterStrobe",
447508
"capability-type-Intensity",
@@ -467,14 +528,16 @@
467528
},
468529
{
469530
"man": "robe",
470-
"key": "robin-600e-spot",
471-
"name": "Robin 600E Spot",
531+
"key": "robin-viva-cmy",
532+
"name": "ROBIN Viva CMY",
472533
"features": [
534+
"16bit-capability-range",
535+
"16bit-default-value",
473536
"capability-type-NoFunction",
474537
"capability-type-ShutterStrobe",
475538
"capability-type-Intensity",
476539
"capability-type-ColorIntensity",
477-
"capability-type-ColorTemperature",
540+
"capability-type-ColorPreset",
478541
"capability-type-Pan",
479542
"capability-type-Tilt",
480543
"capability-type-PanTiltSpeed",
@@ -492,10 +555,10 @@
492555
"capability-type-FrostEffect",
493556
"capability-type-Prism",
494557
"capability-type-PrismRotation",
558+
"capability-type-Time",
495559
"capability-type-Maintenance",
496560
"fine-channel-alias",
497-
"floating-point-dimensions",
498-
"floating-point-weight",
561+
"fine-channel-capabilities",
499562
"multiple-categories",
500563
"rdm",
501564
"reused-channels",
@@ -575,6 +638,7 @@
575638
"key": "hero-wash-340fx-rgbw-zoom",
576639
"name": "Hero Wash 340FX RGBW Zoom",
577640
"features": [
641+
"16bit-default-value",
578642
"capability-type-NoFunction",
579643
"capability-type-ShutterStrobe",
580644
"capability-type-Intensity",

0 commit comments

Comments
 (0)