# HG changeset patch # User Drew Perttula # Date 2017-05-29 20:48:22 # Node ID e8161fdda8adbf701befc06c757c9533059b37df # Parent ef7ddef3acb5d63145c9e704a787d91b9bd6bc1f paint shows deviceattrs from graph Ignore-this: bf4b4b7c1f51af0a4f6b64f4800c1d3c diff --git a/light9/web/paint/paint-elements.coffee b/light9/web/paint/paint-elements.coffee --- a/light9/web/paint/paint-elements.coffee +++ b/light9/web/paint/paint-elements.coffee @@ -118,6 +118,7 @@ Polymer Polymer is: "light9-simulation" properties: { + graph: { type: Object } layers: { type: Object } solution: { type: Object } } @@ -129,6 +130,35 @@ Polymer onLayers: (layers) -> log('upd', layers) + +Polymer + is: "light9-device-settings", + properties: { + graph: { type: Object } + subj: {type: String, notify: true}, + label: {type: String, notify: true}, + attrs: {type: Array, notify: true}, + }, + observers: [ + 'onSubj(graph, subj)' + ] + ready: -> + @label = "aura2" + @attrs = [ + {attr: 'rx', val: .03}, + {attr: 'color', val: '#ffe897'}, + ] + onSubj: (graph, @subj) -> + graph.runHandler(@loadAttrs.bind(@), 'loadAttrs #{subj}') + loadAttrs: -> + U = (x) -> @graph.Uri(x) + @attrs = [] + for s in @graph.objects(U(@subj), U(':setting')) + attr = @graph.uriValue(s, U(':deviceAttr')) + attrLabel = @graph.stringValue(attr, U('rdfs:label')) + @push('attrs', {attr: attrLabel, val: @graph.floatValue(s, U(':value'))}) + + Polymer is: "light9-paint" diff --git a/light9/web/paint/paint-elements.html b/light9/web/paint/paint-elements.html --- a/light9/web/paint/paint-elements.html +++ b/light9/web/paint/paint-elements.html @@ -5,6 +5,7 @@ + @@ -92,12 +93,19 @@ + + + + + diff --git a/light9/web/paint/paint-report-elements.html b/light9/web/paint/paint-report-elements.html --- a/light9/web/paint/paint-report-elements.html +++ b/light9/web/paint/paint-report-elements.html @@ -25,7 +25,7 @@
Error: {{solution.bestMatch.dist}}
- + @@ -102,7 +102,7 @@ font-weight: bold; } -

{{label}}

+

{{label}}

@@ -116,25 +116,7 @@ - + diff --git a/show/dance2017/deviceClass.n3 b/show/dance2017/deviceClass.n3 --- a/show/dance2017/deviceClass.n3 +++ b/show/dance2017/deviceClass.n3 @@ -1,21 +1,21 @@ @prefix : . @prefix rdfs: . -:color a :DeviceAttr; :dataType :color . -:rx a :DeviceAttr; :dataType :angle . -:ry a :DeviceAttr; :dataType :angle . -:uv a :DeviceAttr; :dataType :scalar . -:brightness a :DeviceAttr; :dataType :scalar . -:zoom a :DeviceAttr; :dataType :scalar ; +:color a :DeviceAttr; rdfs:label "color"; :dataType :color . +:rx a :DeviceAttr; rdfs:label "rx"; :dataType :angle . +:ry a :DeviceAttr; rdfs:label "ry"; :dataType :angle . +:uv a :DeviceAttr; rdfs:label "uv"; :dataType :scalar . +:brightness a :DeviceAttr; rdfs:label "brightness"; :dataType :scalar . +:zoom a :DeviceAttr; rdfs:label "zoom"; :dataType :scalar ; rdfs:comment "maybe make this a separate 'wide to narrow' type" . -:focus a :DeviceAttr; :dataType :scalar . -:iris a :DeviceAttr; :dataType :scalar . -:prism a :DeviceAttr; :dataType :scalar . -:strobe a :DeviceAttr; :dataType :scalar; +:focus a :DeviceAttr; rdfs:label "focus"; :dataType :scalar . +:iris a :DeviceAttr; rdfs:label "iris"; :dataType :scalar . +:prism a :DeviceAttr; rdfs:label "prism"; :dataType :scalar . +:strobe a :DeviceAttr; rdfs:label "strobe"; :dataType :scalar; rdfs:comment "0=none, 1=fastest" . -:goboSpeed a :DeviceAttr; :dataType :scalar ; +:goboSpeed a :DeviceAttr; rdfs:label "goboSpeed"; :dataType :scalar ; rdfs:comment "0=stopped, 1=rotate the fastest". -:quantumGoboChoice a :DeviceAttr; :dataType :choice; +:quantumGoboChoice a :DeviceAttr; rdfs:label "quantumGoboChoice"; :dataType :choice; :choice :open, :spider, :windmill, :limbo, :brush, :whirlpool, :stars .
device attr