Skip to content

Commit 68672c6

Browse files
authored
RDM data (#291)
Add RDM data (#291)
1 parent 5b31356 commit 68672c6

31 files changed

+476
-41
lines changed

cli/fixture-features/rdm.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = [{
2+
name: 'RDM',
3+
description: 'Whether an RDM model ID is set',
4+
order: 40,
5+
hasFeature: fixture => fixture.rdm !== null
6+
}];

cli/generate-register.js

+29-1
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,18 @@ let register = {
88
filesystem: {},
99
manufacturers: {},
1010
categories: {},
11-
contributors: {}
11+
contributors: {},
12+
rdm: {}
1213
};
1314
let categories = {};
1415
let contributors = {};
16+
let rdm = {};
1517

1618
const fixturePath = path.join(__dirname, '..', 'fixtures');
1719

1820
try {
21+
const manufacturers = JSON.parse(fs.readFileSync(path.join(fixturePath, 'manufacturers.json'), 'utf8'));
22+
1923
// add all fixture.json files to the register
2024
for (const manKey of fs.readdirSync(fixturePath).sort()) {
2125
const manDir = path.join(fixturePath, manKey);
@@ -24,6 +28,13 @@ try {
2428
if (fs.statSync(manDir).isDirectory()) {
2529
register.manufacturers[manKey] = [];
2630

31+
if ('rdmId' in manufacturers[manKey]) {
32+
rdm[manufacturers[manKey].rdmId] = {
33+
key: manKey,
34+
models: {}
35+
};
36+
}
37+
2738
for (const filename of fs.readdirSync(manDir).sort()) {
2839
const ext = path.extname(filename);
2940
if (ext === '.json') {
@@ -63,6 +74,11 @@ try {
6374
}
6475
contributors[contributor].push(manKey + '/' + fixKey);
6576
}
77+
78+
// add to rdm register
79+
if ('rdm' in fixData) {
80+
rdm[manufacturers[manKey].rdmId].models[fixData.rdm.modelId] = fixKey;
81+
}
6682
}
6783
}
6884
}
@@ -97,6 +113,18 @@ register.lastUpdated = Object.keys(register.filesystem).sort((a, b) => {
97113
return dateDelta !== 0 ? dateDelta : keyDelta;
98114
});
99115

116+
// copy sorted RDM data into register
117+
for (const manId of Object.keys(rdm).sort()) {
118+
register.rdm[manId] = {
119+
key: rdm[manId].key,
120+
models: {}
121+
};
122+
123+
for (const fixId of Object.keys(rdm[manId].models).sort()) {
124+
register.rdm[manId].models[fixId] = rdm[manId].models[fixId];
125+
}
126+
}
127+
100128
const filename = path.join(fixturePath, (process.argv.length === 3 ? process.argv[2] : 'register.json'));
101129

102130
fs.writeFile(filename, JSON.stringify(register, null, 2), 'utf8', error => {

fixtures/manufacturers.json

+14-7
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,22 @@
1616
},
1717
"coemar": {
1818
"name": "Coemar",
19-
"website": "http://www.coemar.com/"
19+
"website": "http://www.coemar.com/",
20+
"rdmId": 17229
2021
},
2122
"chauvet-dj": {
2223
"name": "Chauvet DJ",
23-
"website": "https://www.chauvetdj.com/"
24+
"website": "https://www.chauvetdj.com/",
25+
"rdmId": 8612
2426
},
2527
"dts": {
2628
"name": "DTS",
2729
"website": "https://dts-lighting.it/"
2830
},
2931
"elation": {
3032
"name": "Elation",
31-
"website": "http://www.elationlighting.com/"
33+
"website": "http://www.elationlighting.com/",
34+
"rdmId": 8870
3235
},
3336
"eliminator": {
3437
"name": "Eliminator Lighting",
@@ -60,11 +63,13 @@
6063
},
6164
"martin": {
6265
"name": "Martin",
63-
"website": "http://www.martin.com/"
66+
"website": "http://www.martin.com/",
67+
"rdmId": 19792
6468
},
6569
"mdg": {
6670
"name": "MDG",
67-
"website": "http://www.mdgfog.com/en"
71+
"website": "http://www.mdgfog.com/en",
72+
"rdmId": 19780
6873
},
6974
"prolights": {
7075
"name": "Prolights",
@@ -76,10 +81,12 @@
7681
},
7782
"robe": {
7883
"name": "Robe",
79-
"website": "https://www.robe.cz/"
84+
"website": "https://www.robe.cz/",
85+
"rdmId": 21075
8086
},
8187
"showtec": {
8288
"name": "Showtec",
83-
"website": "http://www.highlite.nl/"
89+
"website": "http://www.highlite.nl/",
90+
"rdmId": 10676
8491
}
8592
}

fixtures/martin/mac-aura.json

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
},
1010
"comment": "moving wash:\n- single-lens wash with fully premixed color \n- broad color palette, RGBW color mixing \n- eye-candy Aura EffectsTM",
1111
"manualURL": "http://www.martin.com/files/files/productdocuments/11_MANUALS/999/UM_MACAura_EN_B.pdf",
12+
"rdm": {
13+
"modelId": 4
14+
},
1215
"physical": {
1316
"dimensions": [302, 360, 302],
1417
"weight": 5.6,

fixtures/martin/mac-viper-airfx.json

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
},
1010
"comment": "Viper Air FX:\n- 35000 Lumens \n- 1:5 zoom - Continuous and fast zoom with auto-linked focus\n- 160 mm precision PC front lens for fat beam looks\n- The Martin Quadray Module is available as an accessory for the MAC Viper AirFX. It splits the MAC Viper AirFX beam into four individually controllable rays.",
1111
"manualURL": "http://www.martin.com/files/files/productdocuments/11_MANUALS/999/UM_MACViperAirFX_EN_B.pdf",
12+
"rdm": {
13+
"modelId": 44,
14+
"softwareVersion": "1.2.0"
15+
},
1216
"physical": {
1317
"dimensions": [473, 749, 566],
1418
"weight": 35.7,
@@ -1179,6 +1183,7 @@
11791183
{
11801184
"name": "Extended",
11811185
"shortName": "ext",
1186+
"rdmPersonalityIndex": 1,
11821187
"channels": [
11831188
"Strobe / Shutter",
11841189
"Dimmer fade",

fixtures/martin/mac-viper-performance.json

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"lastModifyDate": "2017-09-08"
99
},
1010
"manualURL": "http://www.martin.com/files/files/productdocuments/11_MANUALS/999/35000275c%20UM_MACViperPerf_EN_C.pdf",
11+
"rdm": {
12+
"modelId": 65,
13+
"softwareVersion": "1.0.0"
14+
},
1115
"physical": {
1216
"dimensions": [472, 748, 566],
1317
"weight": 37.9,
@@ -1035,6 +1039,7 @@
10351039
{
10361040
"name": "Basic 16-bit",
10371041
"shortName": "bas",
1042+
"rdmPersonalityIndex": 1,
10381043
"channels": [
10391044
"Strobe / Shutter",
10401045
"Dimmer fade",
@@ -1073,6 +1078,7 @@
10731078
{
10741079
"name": "Extended 16-bit",
10751080
"shortName": "ext",
1081+
"rdmPersonalityIndex": 2,
10761082
"channels": [
10771083
"Strobe / Shutter",
10781084
"Dimmer fade",

fixtures/martin/mac-viper-wash.json

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
},
1010
"comment": "This fixture definition covers both the MAC Viper Wash and the MAC Viper Wash DX. The Color Wheel, Iris and all Internal Barndoor channels are only available in the DX variant.\n\nNote: Focus and Zoom are 8-bit channels, the manual is wrong there.",
1111
"manualURL": "http://www.martin.com/files/files/productdocuments/11_MANUALS/999/UM_MACViperWash_EN_B.pdf",
12+
"rdm": {
13+
"modelId": 43,
14+
"softwareVersion": "1.3.0"
15+
},
1216
"physical": {
1317
"dimensions": [473, 749, 566],
1418
"weight": 33,
@@ -541,6 +545,7 @@
541545
{
542546
"name": "Basic",
543547
"shortName": "basic",
548+
"rdmPersonalityIndex": 1,
544549
"channels": [
545550
"Strobe / Shutter",
546551
"Dimmer",
@@ -565,6 +570,7 @@
565570
{
566571
"name": "Extended",
567572
"shortName": "ext",
573+
"rdmPersonalityIndex": 2,
568574
"channels": [
569575
"Strobe / Shutter",
570576
"Dimmer",

fixtures/register.json

+37
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,43 @@
599599
"prolights/diamond-19"
600600
]
601601
},
602+
"rdm": {
603+
"8612": {
604+
"key": "chauvet-dj",
605+
"models": {}
606+
},
607+
"8870": {
608+
"key": "elation",
609+
"models": {}
610+
},
611+
"10676": {
612+
"key": "showtec",
613+
"models": {}
614+
},
615+
"17229": {
616+
"key": "coemar",
617+
"models": {}
618+
},
619+
"19780": {
620+
"key": "mdg",
621+
"models": {}
622+
},
623+
"19792": {
624+
"key": "martin",
625+
"models": {
626+
"4": "mac-aura",
627+
"43": "mac-viper-wash",
628+
"44": "mac-viper-airfx",
629+
"65": "mac-viper-performance"
630+
}
631+
},
632+
"21075": {
633+
"key": "robe",
634+
"models": {
635+
"7": "colorspot-2500e-at"
636+
}
637+
}
638+
},
602639
"lastUpdated": [
603640
"eliminator/stealth-beam",
604641
"jb-systems/twin-effect-laser",

fixtures/robe/colorspot-2500e-at.json

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"lastModifyDate": "2017-09-07"
99
},
1010
"manualURL": "https://www.robe.cz/index.php?type=10898&tx_odproducts_f%5baction%5d=downloadFile&tx_odproducts_f%5bfile%5d=robe/downloads/user_manuals/User_manual_ColorSpot_2500E_AT.pdf",
11+
"rdm": {
12+
"modelId": 7
13+
},
1114
"physical": {
1215
"dimensions": [536, 638, 678],
1316
"weight": 42.5,

fixtures/schema.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const schema = require('js-schema');
1212
*
1313
* @type {string}
1414
*/
15-
module.exports.VERSION = '2.0.0';
15+
module.exports.VERSION = '2.1.0';
1616

1717
/**
1818
* see https://github.com/molnarg/js-schema
@@ -124,6 +124,7 @@ const Channel = schema({
124124
const Mode = schema({
125125
'name': NonEmptyString,
126126
'?shortName': NonEmptyString, // if not set: use name
127+
'?rdmPersonalityIndex': Number.min(1).step(1),
127128
'?physical': Physical, // overrides fixture's Physical
128129
'channels': Array.of([null, ChannelKey, ChannelAliasKey]), // null for unused channels
129130
'*': Function
@@ -147,6 +148,11 @@ const Fixture = schema({
147148
}),
148149
'?comment': NonEmptyMultiLineString,
149150
'?manualURL': URL,
151+
'?rdm': schema({
152+
'modelId': Number.min(0).step(1),
153+
'?softwareVersion': String,
154+
'*': Function
155+
}),
150156
'?physical': Physical,
151157
'availableChannels': schema({
152158
'*': Channel // '*' is the channel key
@@ -163,6 +169,7 @@ const Manufacturers = schema({
163169
'name': NonEmptyString,
164170
'?comment': NonEmptyMultiLineString,
165171
'?website': URL,
172+
'?rdmId': Number.min(0).step(1),
166173
'*': Function
167174
})
168175
});

lib/add-fixtures.js

+21-10
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ var properties = require('../fixtures/schema.js').properties;
66
*/
77
module.exports = function addFixtures(request, response) {
88
createPullRequest(getOutObjectFromEditorData(request.body.fixtures), (error, pullRequestUrl) => {
9-
response
10-
.status(201)
11-
.type('application/json')
12-
.send(Buffer.from(
13-
JSON.stringify({
14-
pullRequestUrl: pullRequestUrl,
15-
error: error
16-
})
17-
));
18-
});
9+
response.status(201)
10+
.type('application/json')
11+
.send(Buffer.from(
12+
JSON.stringify({
13+
pullRequestUrl: pullRequestUrl,
14+
error: error
15+
})
16+
));
17+
});
1918
};
2019

2120

@@ -73,6 +72,14 @@ function addFixture(fixture) {
7372
addAvailableChannel(key, fixture.availableChannels, chId);
7473
}
7574
}
75+
else if (prop === 'rdm' && propExistsIn('rdmModelId', fixture)) {
76+
out.fixtures[key].rdm = {
77+
modelId: fixture.rdmModelId
78+
};
79+
if (propExistsIn('rdmSoftwareVersion', fixture)) {
80+
out.fixtures[key].rdm.softwareVersion = fixture.rdmSoftwareVersion;
81+
}
82+
}
7683
else if (prop === 'modes') {
7784
out.fixtures[key].modes = [];
7885
for (const mode of fixture.modes) {
@@ -105,6 +112,10 @@ function getManufacturerKey(fixture) {
105112
out.manufacturers[manKey].website = fixture.newManufacturerWebsite;
106113
}
107114

115+
if (propExistsIn('newManufacturerRdmId', fixture)) {
116+
out.manufacturers[manKey].rdmId = fixture.newManufacturerRdmId;
117+
}
118+
108119
return manKey;
109120
}
110121

0 commit comments

Comments
 (0)