diff options
author | David Lamparter <equinox@diac24.net> | 2013-06-29 13:36:59 +0000 |
---|---|---|
committer | root <root@beaglebone.local.sublab.org> | 2013-06-29 13:36:59 +0000 |
commit | 8564203f3515d1a449451922dab824396bb60072 (patch) | |
tree | a1ae8c6fffa5317d8c47bb386e4ce6a72d2dcdc4 | |
parent | 644a17b089b48b4deb734c750df152ab0a608e58 (diff) |
cethcan: svg: basic DMX dimming
b/w only, no color picking.
-rw-r--r-- | svg/subcan.js | 19 | ||||
-rw-r--r-- | svg/subcan_dxf.svg | 10 |
2 files changed, 20 insertions, 9 deletions
diff --git a/svg/subcan.js b/svg/subcan.js index c75af50..7f2e6cd 100644 --- a/svg/subcan.js +++ b/svg/subcan.js @@ -42,12 +42,18 @@ function on_evt_click(node) { $.jsonRPC.request('light_get', { params: [id], error: function(result) { - console.log('light_get error', result); + console.log('light_get', id, 'error', result); }, success: function(result) { /* <<< */ - console.log('light_get', result['result']); - var set = result['result']['set']; + r = result['result'] + console.log('light_get', r); + var set; + if (r['r'] !== null) { + set = (r['r'] + r['g'] + r['b']) / 3; + } else { + set = r['set']; + } var newset = set ? 0 : 255; $.jsonRPC.request('light_set', { params: [id, newset], @@ -106,7 +112,12 @@ function on_evt_mousedown(node, evt) { console.log('light_get error', result); }, success: function(result) { - mouseorig = result['result']['set']; + r = result['result'] + if (r['r'] !== null) { + mouseorig = (r['r'] + r['g'] + r['b']) / 3; + } else { + mouseorig = r['set']; + } mouseset = mouseorig; } }); diff --git a/svg/subcan_dxf.svg b/svg/subcan_dxf.svg index d9f0498..7c0b516 100644 --- a/svg/subcan_dxf.svg +++ b/svg/subcan_dxf.svg @@ -4517,7 +4517,7 @@ inkscape:label="#rect3791" /> <rect style="fill:#000000;fill-opacity:0.00392157;stroke:none" - id="evt_dali.lounge_buehne-0" + id="evt_dmx.lounge_traverse" width="104" height="40" x="168.5" @@ -4525,7 +4525,7 @@ inkscape:label="#rect3791" /> <rect style="fill:#000000;fill-opacity:0.00392157;stroke:none" - id="evt_dali.lounge_buehne-0-7" + id="evt_dmx.lounge_buehne_links" width="104" height="56" x="168.5" @@ -4533,7 +4533,7 @@ inkscape:label="#rect3791" /> <rect style="fill:#000000;fill-opacity:0.00392157;stroke:none" - id="evt_dali.lounge_buehne-0-71" + id="evt_dmx.lounge_decke" width="104" height="56" x="168.5" @@ -4541,7 +4541,7 @@ inkscape:label="#rect3791" /> <rect style="fill:#000000;fill-opacity:0.00392157;stroke:none" - id="evt_dali.lounge_buehne-0-71-8" + id="evt_dmx.lounge_buero_ecke" width="104" height="56" x="320.5" @@ -4549,7 +4549,7 @@ inkscape:label="#rect3791" /> <rect style="fill:#000000;fill-opacity:0.00392157;stroke:none" - id="evt_dali.lounge_midwest" + id="evt_dmx.lounge_midwest" width="104" height="56" x="320.5" |