Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fixtures/cameo/thunder-wash-100-rgb.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"meta": {
"authors": ["FloEdelmann"],
"createDate": "2017-02-24",
"lastModifyDate": "2017-02-24"
"lastModifyDate": "2017-03-01"
},
"physical": {
"dimensions": [310, 70, 70],
Expand Down Expand Up @@ -61,7 +61,7 @@
{
"range": [250, 255],
"name": "Strobe open",
"showInMenu": false
"hideInMenu": true
}
]
},
Expand Down Expand Up @@ -111,7 +111,7 @@
{
"range": [250, 255],
"name": "Strobe open",
"showInMenu": false
"hideInMenu": true
}
]
},
Expand Down
6 changes: 3 additions & 3 deletions fixtures/cameo/thunder-wash-100-w.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"meta": {
"authors": ["FloEdelmann"],
"createDate": "2017-02-24",
"lastModifyDate": "2017-02-24"
"lastModifyDate": "2017-03-01"
},
"physical": {
"dimensions": [310, 70, 70],
Expand Down Expand Up @@ -61,7 +61,7 @@
{
"range": [250, 255],
"name": "Strobe open",
"showInMenu": false
"hideInMenu": true
}
]
},
Expand Down Expand Up @@ -111,7 +111,7 @@
{
"range": [250, 255],
"name": "Strobe open",
"showInMenu": false
"hideInMenu": true
}
]
},
Expand Down
6 changes: 3 additions & 3 deletions fixtures/cameo/thunder-wash-600-rgb.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"meta": {
"authors": ["FloEdelmann"],
"createDate": "2017-02-24",
"lastModifyDate": "2017-02-24"
"lastModifyDate": "2017-03-01"
},
"physical": {
"dimensions": [335, 182, 93],
Expand Down Expand Up @@ -61,7 +61,7 @@
{
"range": [250, 255],
"name": "Strobe open",
"showInMenu": false
"hideInMenu": true
}
]
},
Expand Down Expand Up @@ -111,7 +111,7 @@
{
"range": [250, 255],
"name": "Strobe open",
"showInMenu": false
"hideInMenu": true
}
]
},
Expand Down
6 changes: 3 additions & 3 deletions fixtures/cameo/thunder-wash-600-w.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"meta": {
"authors": ["FloEdelmann"],
"createDate": "2017-02-24",
"lastModifyDate": "2017-02-24"
"lastModifyDate": "2017-03-01"
},
"physical": {
"dimensions": [335, 182, 93],
Expand Down Expand Up @@ -61,7 +61,7 @@
{
"range": [250, 255],
"name": "Strobe open",
"showInMenu": false
"hideInMenu": true
}
]
},
Expand Down Expand Up @@ -111,7 +111,7 @@
{
"range": [250, 255],
"name": "Strobe open",
"showInMenu": false
"hideInMenu": true
}
]
},
Expand Down
66 changes: 66 additions & 0 deletions fixtures/defaults.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
module.exports = {
"name": "Fixture name", // required
"shortName": null, // default: name
"categories": ["Other"], // required
"meta": {
"authors": [],
"createDate": "1970-01-01",
"lastModifyDate": "1970-01-01"
},
"comment": "",
"manualURL": "",
"physical": {
"dimensions": [0, 0, 0],
"weight": 0,
"power": 0,
"DMXconnector": "3-pin",
"bulb": {
"type": "",
"colorTemperature": 0,
"lumens": 0
},
"lens": {
"name": "Other",
"degreesMinMax": [0, 0]
},
"focus": {
"type": "Fixed",
"panMax": 0,
"tiltMax": 0
}
},
"availableChannels": { // required
"channel key": {
"name": null, // default: channel key
"type": "SingleColor", // required
"color": "Generic",
"defaultValue": 0,
"highlightValue": 0,
"invert": false,
"constant": false,
"crossfade": false,
"precendence": "LTP",
"capabilities": [
{
"range": [0, 255], // required
"name": "0-100%", // required
"hideInMenu": false,
"center": false,
"color": "",
"color2": "",
"image": ""
}
]
}
},
"multiByteChannels": [],
"heads": {},
"modes": [ // required
{
"name": "1-channel Mode", // required
"shortName": null, // default: name
"physical": {},
"channels": ["channel key"] // required
}
]
};
120 changes: 120 additions & 0 deletions fixtures/schema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
const schema = require('js-schema');

/**
* see https://github.com/molnarg/js-schema
*
* in short:
* 'property' is required
* '?property' is unused
* '*' has to match all other properties
*
* we use "'*': Function" to disallow additional properties
* since JSON has no function type
*/

const DMXValue = Number.min(0).max(255).step(1);

const URL = schema(/^(ftp|http|https):\/\/[^ "]+$/);

const ISODate = schema(/^\d{4}-\d{2}-\d{2}$/);

const Color = schema(/^#[0-9a-f]{6}$/);

const Category = schema(['Other', 'Color Changer', 'Dimmer', 'Effect', 'Fan', 'Flower', 'Hazer', 'Laser', 'Moving Head', 'Scanner', 'Smoke', 'Strobe', 'Blinder']);

const Physical = schema({
'?dimensions': Array.of(3, Number.min(0)), // width, height, depth (in mm)
'?weight': Number.min(0), // in kg
'?power': Number.min(0), // in W
'?DMXconnector': ['3-pin', '5-pin', '3-pin and 5-pin', '3.5mm stereo jack'], // additions are welcome
'?bulb': schema({
'?type': String, // e.g. 'LED'
'?colorTemperature': Number.min(0), // in K
'?lumens': Number.min(0),
'*': Function
}),
'?lens': schema({
'?name': String, // e.g. 'PC', 'Fresnel'
'?degreesMinMax': Array.of(2, Number.min(0).max(360)),
'*': Function
}),
'?focus': schema({
'?type': ['Fixed', 'Head', 'Mirror', 'Barrel'], // additions are welcome
'?panMax': Number.min(0), // in degrees
'?tiltMax': Number.min(0), // in degrees
'*': Function
}),
'*': Function
});

const Capability = schema({
'range': Array.of(2, DMXValue),
'name': String,
'?hideInMenu': Boolean,
'?center': Boolean,
'?color': [Color, ''],
'?color2': [Color, ''],
'?image': String,
'*': Function
});

const Channel = schema({
'?name': [String, null], // null: use channel key
'type': ['Intensity', 'Strobe', 'Shutter', 'Speed', 'SingleColor', 'MultiColor', 'Gobo', 'Prism', 'Pan', 'Tilt', 'Beam', 'Effect', 'Maintenance', 'Nothing'],
'?color': ['Generic', 'Red', 'Green', 'Blue', 'Cyan', 'Magenta', 'Yellow', 'Amber', 'White', 'UV', 'Lime'],
'?defaultValue': DMXValue,
'?highlightValue': DMXValue,
'?invert': Boolean,
'?constant': Boolean,
'?crossfade': Boolean,
'?precendence': ['LTP', 'HTP'],
'?capabilities': Array.of(Capability),
'*': Function
});

const ChannelKey = String;

const Mode = schema({
'name': String,
'?shortName': [String, null], // null: use name
'?physical': Physical, // overrides fixture's Physical
'channels': Array.of([null, ChannelKey]), // null for unused channels
'*': Function
});

const Fixture = schema({
'name': String,
'?shortName': [String, null], // null: use name
'categories': Array.of(1, Infinity, Category),
'meta': schema({
'authors': Array.of(String),
'createDate': ISODate,
'lastModifyDate': ISODate,
'*': Function
}),
'?comment': String,
'?manualURL': [URL, ''],
'?physical': Physical,
'availableChannels': schema({
'*': Channel // '*' is the channel key
}),
'?multiByteChannels': Array.of(Array.of(ChannelKey)), // most significant channel first, e.g. [["ch1-coarse", "ch1-fine"], ["ch2-coarse", "ch2-fine"]]
'?heads': schema({
'*': Array.of(ChannelKey) // '*' is the head name
}),
'modes': Array.of(1, Infinity, Mode),
'*': Function
});

const Manufacturers = schema({
'*': schema({ // '*' is the manufacturer key
'name': String,
'?comment': String,
'?website': URL,
'*': Function
})
});


module.exports.Fixture = Fixture;
module.exports.Manufacturers = Manufacturers;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
"express": "4.14.1"
},
"devDependencies": {
"diff": "^3.2.0",
"colors": "^1.1.2",
"diff": "^3.2.0",
"js-schema": "^1.0.1",
"valid-url": "1.0.9"
},
"homepage": "http://open-fixture-library.herokuapp.com/",
Expand Down
Loading