Changeset - 8268224c1b23
[Not reviewed]
default
0 3 0
drewp@bigasterisk.com - 8 years ago 2017-06-02 06:58:49
drewp@bigasterisk.com
WIP support for choice/enum attrs
Ignore-this: e1a59eef744fa550f6612fdb037cb940
3 files changed with 14 insertions and 3 deletions:
0 comments (0 inline, 0 general)
bin/collector
Show inline comments
 
#!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
light9/collector/device.py
Show inline comments
 
@@ -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)
show/dance2017/deviceClass.n3
Show inline comments
 
@@ -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 ],
0 comments (0 inline, 0 general)