Mercurial > code > home > repos > light9
changeset 1590:8268224c1b23
WIP support for choice/enum attrs
Ignore-this: e1a59eef744fa550f6612fdb037cb940
author | drewp@bigasterisk.com |
---|---|
date | Fri, 02 Jun 2017 06:58:49 +0000 |
parents | 21a52ce16954 |
children | 2713d2f7a0fc |
files | bin/collector light9/collector/device.py show/dance2017/deviceClass.n3 |
diffstat | 3 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/collector Wed May 31 08:20:19 2017 +0000 +++ b/bin/collector Fri Jun 02 06:58:49 2017 +0000 @@ -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
--- a/light9/collector/device.py Wed May 31 08:20:19 2017 +0000 +++ b/light9/collector/device.py Fri Jun 02 06:58:49 2017 +0000 @@ -114,8 +114,8 @@ 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)
--- a/show/dance2017/deviceClass.n3 Wed May 31 08:20:19 2017 +0000 +++ b/show/dance2017/deviceClass.n3 Fri Jun 02 06:58:49 2017 +0000 @@ -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 ],