Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
181 commits
Select commit Hold shift + click to select a range
09476a7
DMXControl3 Readme
fxedel Dec 23, 2017
4b00bc0
Basic export functionality
fxedel Dec 23, 2017
e0bebeb
Merge branch 'master' into dmxcontrol3-export
fxedel Dec 31, 2017
866a9d8
Color channels
fxedel Dec 31, 2017
84d659b
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Jan 1, 2018
a803f96
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Jan 2, 2018
017cbf4
Refactor color mixing creation
fxedel Jan 2, 2018
444d685
Support matrices, refactored colors again
fxedel Jan 3, 2018
729e9a3
Refactoring
fxedel Jan 3, 2018
1fa8f8f
Add position functions
fxedel Jan 7, 2018
5e35222
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Jan 7, 2018
cde5bcf
Prepare exportTest structure for new exportTest
fxedel Jan 7, 2018
6a2a1a0
Fix JSDoc
fxedel Jan 7, 2018
72c4cb6
Removed console.log
fxedel Jan 7, 2018
8e46864
Export Tests: always return array of errors
fxedel Jan 7, 2018
061b428
JSDoc enhancement for model
fxedel Jan 7, 2018
021565d
Add channel numbers export test
fxedel Jan 7, 2018
eaac788
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Jan 18, 2018
6c09cb9
Add channels per pixel key
fxedel Jan 18, 2018
2e514ea
Only process used pixelKeys
fxedel Jan 18, 2018
3228ece
dimmer functions
fxedel Jan 21, 2018
0dae2c6
Group different pixels into different function tags
fxedel Jan 22, 2018
38cc2f7
Shorten function names
fxedel Jan 22, 2018
a5b8e48
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Jan 22, 2018
af3f202
Lint
fxedel Jan 22, 2018
b166c48
Merge branch 'master' into dmxcontrol3-export
fxedel Feb 3, 2018
807dce7
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Aug 7, 2018
72ef0e5
Fix Millumin export test
fxedel Aug 7, 2018
fb40dfe
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Aug 8, 2018
9690cb9
Revert unnecessarily changed files
fxedel Aug 8, 2018
91e17e8
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Aug 10, 2018
4c3a4fe
Export test: Don't fail on duplicate dmxchannel
fxedel Aug 10, 2018
56149c9
Fix lint
fxedel Aug 10, 2018
0ee8260
Improve exports-valid readability
fxedel Aug 10, 2018
d02567a
Foundation for creating functions out of capabilities
fxedel Aug 10, 2018
59a3c1a
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Aug 23, 2018
092bda6
add getNormalizedCapabilities to fulfill DMXC's unit requirements
fxedel Aug 24, 2018
1d9db71
fix getBaseXmlCapability's dmx range inverting
fxedel Aug 24, 2018
a5d0cf9
add ptspeed function
fxedel Aug 24, 2018
0d79059
Fix dimmer capability attributes
fxedel Aug 24, 2018
cc81a42
Fix getBaseXmlCapability with zero startValue
fxedel Aug 24, 2018
3111489
Add color functions
fxedel Aug 24, 2018
a2bc93b
Move unit conversion into Entity class
fxedel Aug 25, 2018
bd6cd15
Fix normalizing scale
fxedel Aug 25, 2018
2e85561
Round minval/maxval to at most 3 decimal numbers
fxedel Aug 25, 2018
52de65b
Refactor range.mergeWith to return a new Range
fxedel Aug 25, 2018
53408d5
Ensure that CW and CCW isn't mixed in one capability
fxedel Aug 25, 2018
26a1d1b
Add colorwheel function
fxedel Aug 25, 2018
a9e036d
Add focus function
fxedel Aug 25, 2018
05d9fa6
Add frost function
fxedel Aug 25, 2018
455525a
Add iris function
fxedel Aug 25, 2018
633277d
Add zoom function
fxedel Aug 25, 2018
2d3dd17
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Sep 6, 2018
5a3b929
Refactor Range.mergeRanges()
fxedel Sep 6, 2018
26784e7
Migrate export script to merged changes
fxedel Sep 6, 2018
438f5ed
Completely rewritten export test
fxedel Sep 6, 2018
40841ad
fix requested changes
fxedel Sep 6, 2018
c82ab79
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Sep 6, 2018
d27cee6
Fix % defaultValues
fxedel Sep 6, 2018
07f5643
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Oct 12, 2018
a9dcee8
Incorporate model changes
fxedel Oct 12, 2018
85037e6
Refactor ColorWheelIndex handling
fxedel Oct 15, 2018
3941f77
Only generate channels used in this mode
fxedel Oct 18, 2018
48b6894
Fix Capability.isStep with colors
fxedel Oct 18, 2018
d516502
Make model API
fxedel Oct 18, 2018
788d5ed
Enable color wheel for ColorPresets
fxedel Oct 18, 2018
8b2108d
Add colorTemp function
fxedel Oct 18, 2018
6fb8b8c
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Oct 18, 2018
486cb42
Update plugins/dmxcontrol3/exportTests/channel-numbers.js
FloEdelmann Oct 19, 2018
c9180e2
Update plugins/dmxcontrol3/exportTests/channel-numbers.js
FloEdelmann Oct 19, 2018
b18d138
Update plugins/dmxcontrol3/exportTests/channel-numbers.js
FloEdelmann Oct 19, 2018
a261cb9
Update plugins/dmxcontrol3/exportTests/channel-numbers.js
FloEdelmann Oct 19, 2018
a47daef
Update plugins/dmxcontrol3/exportTests/channel-numbers.js
FloEdelmann Oct 19, 2018
d0420ef
Avoid magic numbers
fxedel Oct 20, 2018
f1a9440
Fix a few typos in JSDoc
FloEdelmann Oct 27, 2018
cbb619a
Add <procedures> with Maintenance capabilities
FloEdelmann Oct 27, 2018
bcecac0
Support prism function (with prismindex / prismrotation sub-functions)
FloEdelmann Oct 27, 2018
6f6ce5c
Support prismindex function
FloEdelmann Oct 27, 2018
112137d
Support prismrotation function
FloEdelmann Oct 27, 2018
5406ac3
Fix divide-by-zero in getNormalizedCapabilities
FloEdelmann Oct 27, 2018
8ac51f9
Make sure that minval < maxval
FloEdelmann Oct 27, 2018
c3b105e
Merge branch 'master' into dmxcontrol3-export
FloEdelmann Oct 28, 2018
d09e9fa
Fix export test to find procedures
FloEdelmann Oct 28, 2018
eae1de4
Fix ranges not being merged
FloEdelmann Oct 28, 2018
ceccd05
Fix channel index not being a number
FloEdelmann Oct 28, 2018
18fe45a
Support fog function
FloEdelmann Oct 28, 2018
fdac403
Support fan function
FloEdelmann Oct 28, 2018
42f19b5
Fix RangeError in export test for fixtures with multiple functions tags
FloEdelmann Oct 28, 2018
17979d4
Support index function
FloEdelmann Oct 28, 2018
694a79c
Support rotation function
FloEdelmann Oct 28, 2018
340eb39
Add procedures for Maintenance capabilities in all channel types
FloEdelmann Oct 28, 2018
58ef181
Mark procedure DMX ranges as used
FloEdelmann Oct 28, 2018
251909f
Merge branch 'master' into dmxcontrol3-export
FloEdelmann Oct 29, 2018
065fe81
Extract functions to separate file
FloEdelmann Oct 29, 2018
6f2a6f9
Merge branch 'dmxcontrol3-export' of github.com:OpenLightingProject/o…
fxedel Oct 30, 2018
d9fd7d5
Merge branch 'master' into dmxcontrol3-export
FloEdelmann Oct 31, 2018
6a6a0e4
Better XML variable names
fxedel Nov 8, 2018
4377f98
Refactor prism capability grouping
fxedel Nov 8, 2018
896325d
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Dec 3, 2018
f25a9bd
Simplify property scaling
fxedel Dec 3, 2018
f8b098e
Extract rotation speed caps into function
fxedel Dec 4, 2018
08fbfd7
Add center (split color) cap
fxedel Dec 4, 2018
3a7c8aa
Fix Clay Paky Alpha Spot QWO 800 color wheel
fxedel Dec 4, 2018
7e24d50
Merge branch 'master' into dmxcontrol3-export
fxedel Dec 9, 2018
90dd8a5
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Dec 25, 2018
f273382
Fix Entity conversion ms -> s
fxedel Dec 28, 2018
e6026db
Add strobe duration function
fxedel Dec 28, 2018
a5ab2d0
Fix link in plugin readme
fxedel Dec 28, 2018
d208eb6
Fix capability.shutterEffect JSDoc
fxedel Dec 28, 2018
d2d9b2d
Add strobe and strobespeed functions
fxedel Dec 28, 2018
fe1eabb
Simplify index functions
fxedel Dec 29, 2018
5faac87
Fix CW/CCW detection
fxedel Dec 29, 2018
7587480
Fix prism cap grouping
fxedel Dec 29, 2018
d8b2a18
Always use dmxRange in correct resolution
fxedel Dec 29, 2018
3afccd7
Add goboindex and goborotation
fxedel Dec 29, 2018
e576044
Add goboshake function
fxedel Dec 29, 2018
cabe939
Add gobowheel function
fxedel Dec 29, 2018
0720b61
Add raw, rawstep
fxedel Dec 29, 2018
84a09ac
Add const
fxedel Dec 29, 2018
eb24699
Don't include procedures in export test
fxedel Dec 29, 2018
6b438f8
Ignore NoFunction channels
fxedel Dec 29, 2018
2efb211
Fix switched NoFunction channels in export test
fxedel Dec 29, 2018
2182323
Improve JSDoc
fxedel Dec 29, 2018
5cc38c3
Ensure minval <= maxval in export test
fxedel Dec 29, 2018
9707692
Establish XML function grouping for <position> (pan/tilt)
fxedel Dec 29, 2018
7d2e009
Add <rgb>/<cmy> grouping
fxedel Dec 29, 2018
9877006
Add <gobowheel> grouping
fxedel Dec 29, 2018
c1bfb29
Add <prism> grouping
fxedel Dec 29, 2018
4213cc2
Merge <duration> into <strobe>
fxedel Dec 29, 2018
4c23901
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Dec 29, 2018
8f01a81
Merge strobespeed into strobe
fxedel Dec 31, 2018
e8112ef
Transform single strobespeed functions to strobe
fxedel Dec 31, 2018
19be9c1
Fix Martin Atomic 3000's strobe channel
fxedel Dec 31, 2018
cc23247
Fix ddfversion
fxedel Dec 31, 2018
69cd69a
Fix pixelKey array being modified by getPixelKeysByOrder method
fxedel Dec 31, 2018
78793b6
Simplify color functions
fxedel Dec 31, 2018
9457fba
New matrix implementation
fxedel Dec 31, 2018
7292a7b
Also use matrix function for Led Bars
fxedel Dec 31, 2018
8794c6d
Use val if maxval equals minval
fxedel Dec 31, 2018
3862b89
Shutter must have an open and a closed cap
fxedel Dec 31, 2018
54bfd85
Fix typo in matrix
fxedel Dec 31, 2018
ffdadb1
Handle functions that couldn't be grouped
fxedel Dec 31, 2018
983468a
Improve fan and fog
fxedel Dec 31, 2018
df778da
Replace getGroupedXmlFunctions(..) with non-pure function
fxedel Jan 5, 2019
ae9fcab
Add missing newline at EOF
fxedel Jan 5, 2019
8160a94
Improve wording
fxedel Jan 5, 2019
2ca5559
Remove unused unit from DmxControlCapability
fxedel Jan 5, 2019
ce20186
Make parsing to float clearer
fxedel Jan 5, 2019
70f1e55
Remove getDmxControlCapability for the sake of simplicity
fxedel Jan 5, 2019
e6ed8de
Make usage of getDmxControlCapabilities(..) clearer
fxedel Jan 5, 2019
a551f91
Improve frost
fxedel Jan 5, 2019
d8fda1f
Code style
fxedel Jan 5, 2019
910cfcf
Cleaner code
FloEdelmann Jan 7, 2019
1f6f262
Merge branch 'master' into dmxcontrol3-export
fxedel Jan 7, 2019
d4a3b8a
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Jan 8, 2019
3a5c136
Fix export-diff test for newly added plugins
fxedel Jan 8, 2019
af62231
Merge remote-tracking branch 'origin/master' into dmxcontrol3-export
fxedel Jan 9, 2019
4f792e2
Merge branch 'master' into dmxcontrol3-export
FloEdelmann Jan 17, 2019
2502749
Migrate DMXControl plugin to new wheel syntax
FloEdelmann Jan 17, 2019
4863e29
Fix and extend <index> and <rotation>
fxedel Jan 21, 2019
e36c7fb
Fix wheel type recognition
fxedel Jan 21, 2019
0b0c00d
Refactor getSplittedCapabilities and getMergedCapability
fxedel Jan 21, 2019
76dbfa2
Split color names if needed
fxedel Jan 21, 2019
46c43c4
Merge branch 'master' into dmxcontrol3-export
FloEdelmann Feb 22, 2022
df24174
Migrate CJS to ES modules
FloEdelmann Feb 22, 2022
a61ebbc
`baseUnitEntity` is now a getter
FloEdelmann Feb 22, 2022
a981e9e
Add dangling commas
FloEdelmann Feb 22, 2022
2d1356f
Fix `unicorn/prevent-abbreviations` issues
FloEdelmann Feb 22, 2022
5e6612c
Fix `unicorn/no-array-for-each` issues
FloEdelmann Feb 22, 2022
32e2b18
Fix JSDoc comments
FloEdelmann Feb 22, 2022
12ee716
Fix `no-extra-semi` issues
FloEdelmann Feb 22, 2022
0d13e94
Fix `sonarjs/no-nested-template-literals` issue
FloEdelmann Feb 22, 2022
2c71182
Fix `unicorn/prefer-number-properties` and `radix` issues
FloEdelmann Feb 22, 2022
875f594
Fix `unicorn/better-regex` issue
FloEdelmann Feb 22, 2022
b189621
Fix `unicorn/no-array-callback-reference` issues
FloEdelmann Feb 22, 2022
7e0eab6
Fix `no-shadow` issues
FloEdelmann Feb 22, 2022
35ea53d
Fix wrongly used `getChannelIndex`
FloEdelmann Feb 22, 2022
55c5e33
Fix links
FloEdelmann Feb 22, 2022
a959849
Convert plugin readme to plugin.json
FloEdelmann Feb 22, 2022
208a389
Add helpWanted message to plugin.json
FloEdelmann Feb 22, 2022
f21e4b9
Fix xmlbuilder v11+ usage
FloEdelmann Feb 22, 2022
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
160 changes: 160 additions & 0 deletions plugins/dmxcontrol3/ddf3-function-groups.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
import xmlbuilder from 'xmlbuilder';

export default [
{
functions: [`strobe`, `strobespeed`],
getXmlGroup: (strobe, strobespeed) => {
const xmlStrobe = xmlbuilder.create(`strobe`);
xmlStrobe.attribs = strobespeed.attribs;

const xmlStrobeType = xmlStrobe.element(`strobetype`);
xmlStrobeType.attribs = strobe.attribs;

for (const speedCapability of strobespeed.children) {
for (const strobeCapability of strobe.children) {
if (strobeCapability.attribs.type.value !== `open`) {
const xmlSpeedRange = xmlStrobe.element(`range`);
xmlSpeedRange.attribs = Object.assign({}, speedCapability.attribs);
xmlSpeedRange.attribs.type = strobeCapability.attribs.type;

xmlSpeedRange.element(`step`, {
handler: `strobetype`,
mindmx: strobeCapability.attribs.mindmx.value,
maxdmx: strobeCapability.attribs.maxdmx.value,
});
}
}
}

return xmlStrobe;
},
},
{
functions: [`strobespeed`],
getXmlGroup: strobespeed => {
strobespeed.name = `strobe`;
for (const child of strobespeed.children) {
child.attribute(`type`, `linear`);
}

return strobespeed;
},
},
{
functions: [`strobe`, `duration`],
getXmlGroup: mergeIntoFirst,
},
{
functions: [`pan`, `tilt`],
getXmlGroup: mergeIntoNew(`position`),
},
{
functions: [`pan`],
getXmlGroup: rename(`index`),
},
{
functions: [`tilt`],
getXmlGroup: rename(`index`),
},
{
functions: [`red`, `green`, `blue`],
getXmlGroup: mergeIntoNew(`rgb`),
},
{
functions: [`cyan`, `magenta`, `yellow`],
getXmlGroup: mergeIntoNew(`cmy`),
},
{
functions: [`rgb`, `white`],
getXmlGroup: mergeIntoFirst,
},
{
functions: [`rgb`, `amber`],
getXmlGroup: mergeIntoFirst,
},
{
functions: [`rgb`, `uv`],
getXmlGroup: mergeIntoFirst,
},
{
functions: [`rgb`, `cyan`],
getXmlGroup: mergeIntoFirst,
},
{
functions: [`rgb`, `yellow`],
getXmlGroup: mergeIntoFirst,
},
{
functions: [`rgb`, `lime`],
getXmlGroup: mergeIntoFirst,
},
{
functions: [`rgb`, `indigo`],
getXmlGroup: mergeIntoFirst,
},
{
functions: [`gobowheel`, `goboindex`],
getXmlGroup: mergeIntoFirst,
},
{
functions: [`goboindex`],
getXmlGroup: rename(`index`),
},
{
functions: [`gobowheel`, `goborotation`],
getXmlGroup: mergeIntoFirst,
},
{
functions: [`goborotation`],
getXmlGroup: rename(`rotation`),
},
{
functions: [`gobowheel`, `goboshake`],
getXmlGroup: mergeIntoFirst,
},
{
functions: [`prism`, `prismindex`],
getXmlGroup: mergeIntoFirst,
},
{
functions: [`prism`, `prismrotation`],
getXmlGroup: mergeIntoFirst,
},
];

/**
* @param {string} tagName The XML tag name of the new parent element.
* @returns {Function} A function that returns a new XML element with the given elements as children.
*/
function mergeIntoNew(tagName) {
return (...xmlElements) => {
const xmlParent = xmlbuilder.create(tagName);
for (const ele of xmlElements) {
xmlParent.importDocument(ele);
}
return xmlParent;
};
}

/**
* @param {XMLElement} firstElement The element in which the other elements should be merged into.
* @param {...XMLElement} xmlElements The elements that should be merge into the first element.
* @returns {XMLElement} The first element with the other elements as children.
*/
function mergeIntoFirst(firstElement, ...xmlElements) {
for (const ele of xmlElements) {
firstElement.importDocument(ele);
}
return firstElement;
}

/**
* @param {string} tagName The new XML tag name.
* @returns {Function} A function that alters the given XML element's tag name to the specified new name.
*/
function rename(tagName) {
return xmlElement => {
xmlElement.name = tagName;
return xmlElement;
};
}
Loading