# HG changeset patch # User drewp@bigasterisk.com # Date 2017-06-02 06:58:49 # Node ID 8268224c1b23cc5b26fcf69c5a4bfe69665f2dd2 # Parent 21a52ce16954e59c86da98f4839a1f8e3fe7bf08 WIP support for choice/enum attrs Ignore-this: e1a59eef744fa550f6612fdb037cb940 diff --git a/bin/collector b/bin/collector --- a/bin/collector +++ b/bin/collector @@ -1,4 +1,12 @@ #!bin/python +""" +Collector receives device attrs from multiple senders, combines +them, and sends output attrs to hardware. The combining part has +custom code for some attributes. + +Input can be over http or zmq. +""" + from __future__ import division from rdflib import URIRef, Literal from twisted.internet import reactor, utils diff --git a/light9/collector/device.py b/light9/collector/device.py --- a/light9/collector/device.py +++ b/light9/collector/device.py @@ -114,8 +114,8 @@ def toOutputAttrs(deviceType, deviceAttr L9['dimmer']: 255, L9['colorChange']: 0, L9['colorSpeed']: 0, - L9['goboShake']: 0, - L9['goboChoose']: 0, + L9['goboShake']: _8bit(floatAttr(L9['goboShake'])), + L9['goboChoose']: _8bit(floatAttr(L9['mini15GoboChoice'])), } out[L9['red']], out[L9['green']], out[L9['blue']] = rgbAttr(L9['color']) out[L9['xRotation']], out[L9['xFine']] = fine16Attr(L9['rx'], 1/540) diff --git a/show/dance2017/deviceClass.n3 b/show/dance2017/deviceClass.n3 --- a/show/dance2017/deviceClass.n3 +++ b/show/dance2017/deviceClass.n3 @@ -17,6 +17,9 @@ rdfs:comment "0=stopped, 1=rotate the fastest". :quantumGoboChoice a :DeviceAttr; rdfs:label "quantumGoboChoice"; :dataType :choice; :choice :open, :spider, :windmill, :limbo, :brush, :whirlpool, :stars . +:mini15GoboChoice a :DeviceAttr; :dataType :scalar; + :choice :g1, :g2 . + :goboShake a :DeviceAttr; :dataType :scalar . :SimpleDimmer a :DeviceClass; @@ -33,7 +36,7 @@ [ :outputAttr :blue; :dmxOffset 3 ] . :Mini15 a :DeviceClass; - :deviceAttr :color, :rx, :ry; + :deviceAttr :color, :rx, :ry, :mini15GoboChoice, :goboShake ; :attr [ :outputAttr :xRotation; :dmxOffset 0 ], [ :outputAttr :xFine; :dmxOffset 1 ],