diff options
author | marc <you@example.com> | 2011-07-23 19:23:37 +0200 |
---|---|---|
committer | marc <you@example.com> | 2011-07-23 19:23:37 +0200 |
commit | f85f93c6dda345321e821220f0a2b801194711dd (patch) | |
tree | e6de5cd16eb706936b3cfcafe7677f746d3bcee0 /ebus/webapp/static/ebus.js | |
parent | b6538e5d0f9b5fa58f8d94b33d8b7912471c0102 (diff) | |
download | ebus-alt-f85f93c6dda345321e821220f0a2b801194711dd.tar.gz ebus-alt-f85f93c6dda345321e821220f0a2b801194711dd.zip |
Auswählen vorkonfigurierter Sensoren
Diffstat (limited to 'ebus/webapp/static/ebus.js')
-rw-r--r-- | ebus/webapp/static/ebus.js | 36 |
1 files changed, 26 insertions, 10 deletions
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 = $("<div>").attr("id","pick_"+sensorname.sensorname.replace(/\./g,"_")) + .addClass("picker") + .appendTo("#sensorpicker"); + + var pickerCheckbox = $("<input>").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); + } }); }); |