From 2b89cdf6dd8e183ad3f07bfb7b6d67a15a508752 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Sat, 29 Jun 2013 03:50:26 +0200 Subject: svg: add DMX PARs --- svg/subcan.js | 19 ++++++++ svg/subcan_dxf.svg | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 145 insertions(+), 2 deletions(-) (limited to 'svg') diff --git a/svg/subcan.js b/svg/subcan.js index 21c2d01..d3652c0 100644 --- a/svg/subcan.js +++ b/svg/subcan.js @@ -295,6 +295,25 @@ function update_elements(json) { console.log("unknown dynamic content type", node.localName); } } + + nodes = simple_xpath('//*[contains(svg:title, "=")]'); + for (i in nodes) { + var node = nodes[i]; + var spec = node.getElementsByTagName('title')[0].firstChild.nodeValue.split('=', 2); + var dataelem = json[spec[0]]; + + if (dataelem === null) + continue; + + if (node.localName == "path") { + node.style.fill = "rgb(" + + dataelem['r'] + ", " + + dataelem['g'] + ", " + + dataelem['b'] + ")"; + } else { + console.log("unknown dynamic content type", node.localName); + } + } } var xhr = new XMLHttpRequest(); diff --git a/svg/subcan_dxf.svg b/svg/subcan_dxf.svg index 031f606..d9f0498 100644 --- a/svg/subcan_dxf.svg +++ b/svg/subcan_dxf.svg @@ -4302,6 +4302,90 @@ id="tspan3984-1-0-8-6-2-3-8" x="734.5" y="709.86218">ist + + + dmx.lounge_decke=rgb + + + dmx.lounge_traverse + + + + dmx.lounge_buehne_links=rgb + + + dmx.lounge_buero_ecke=rgb + + + + dmx.lounge_midwest=rgb + @@ -4419,7 +4503,7 @@ style="fill:#000000;fill-opacity:0.00392157;stroke:none" id="evt_dali.lounge_buehne" width="112" - height="120" + height="88" x="104.5" y="79.5" inkscape:label="#rect3791" /> @@ -4431,5 +4515,45 @@ x="520.5" y="175.5" inkscape:label="#rect3791" /> + + + + + -- cgit v1.2.1