From f85f93c6dda345321e821220f0a2b801194711dd Mon Sep 17 00:00:00 2001 From: marc Date: Sat, 23 Jul 2011 19:23:37 +0200 Subject: =?UTF-8?q?Ausw=C3=A4hlen=20vorkonfigurierter=20Sensoren?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ebus/webapp/static/ebus.js | 36 ++++++++++++++++++++++++++---------- ebus/webapp/static/index.html | 5 +++-- ebus/webapp/static/main.css | 6 ++++++ 3 files changed, 35 insertions(+), 12 deletions(-) (limited to 'ebus/webapp/static') diff --git a/ebus/webapp/static/ebus.js b/ebus/webapp/static/ebus.js index b334144..ad98d91 100644 --- a/ebus/webapp/static/ebus.js +++ b/ebus/webapp/static/ebus.js @@ -7,7 +7,11 @@ $(document).ready(function(){ var plotOverview = null; var plotDetail = null; var indexFound = null; - + var sensorList = [{"sensorname":"heizkreisregler9.solarDaten.tempKollektor","show":true}, + {"sensorname":"heizkreisregler10.betriebsdatenRegler1.kesselTemperatur","show":true}, + {"sensorname":"heizkreisregler9.solarDaten.tempWarmwasserSolar","show":false}, + {"sensorname":"feuerungsautomat1.betriebsdatenRegler1.aussenTemperatur","show":true}, + {"sensorname":"heizkreisregler10.betriebsdatenRegler1.boilerTemperatur","show":true}]; var replot = function() { if (plotDetail == null) { plotDetail = $.plot($("#ebusgraph"), @@ -118,17 +122,29 @@ $(document).ready(function(){ } }); - plotSensor("heizkreisregler9.solarDaten.tempKollektor"); -//ausreisser// plotSensor("heizkreisregler9.solarDaten.tempWarmwasserSolar"); - plotSensor("heizkreisregler10.betriebsdatenRegler1.kesselTemperatur"); - plotSensor("feuerungsautomat1.betriebsdatenRegler1.aussenTemperatur"); + $.each(sensorList, function(i,sensorname) { + var pickerDiv = $("
").attr("id","pick_"+sensorname.sensorname.replace(/\./g,"_")) + .addClass("picker") + .appendTo("#sensorpicker"); + + var pickerCheckbox = $("").attr("type","checkbox") + .appendTo(pickerDiv); + $(pickerDiv).append(sensorname.sensorname); + if (sensorname.show) { + //Plot + plotSensor(sensorname.sensorname); + $(pickerCheckbox).attr("checked","checked"); + } + }); // TODO http://people.iola.dk/olau/flot/examples/annotating.html - $('#ausblenden').click(function() { - unplotSensor("heizkreisregler9.solarDaten.tempKollektor"); - }); - $('#einblenden').click(function() { - plotSensor("heizkreisregler9.solarDaten.tempKollektor"); + $('.picker input').click( function() { + var sensorname = $(this).parent().attr("id").replace("pick_","").replace(/_/g,"."); + if ($(this).is(":checked")) { + plotSensor(sensorname); + } else { + unplotSensor(sensorname); + } }); }); diff --git a/ebus/webapp/static/index.html b/ebus/webapp/static/index.html index 7e2582d..6c80444 100644 --- a/ebus/webapp/static/index.html +++ b/ebus/webapp/static/index.html @@ -8,8 +8,9 @@
+
+
+
-
ausblenden
-
einblenden
diff --git a/ebus/webapp/static/main.css b/ebus/webapp/static/main.css index 13cd761..5f85a43 100644 --- a/ebus/webapp/static/main.css +++ b/ebus/webapp/static/main.css @@ -14,3 +14,9 @@ body { margin:auto; height:100px; } + +#options { + width:800px; + margin:auto; + text-align:left; +} -- cgit v1.2.1