diff options
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); + } }); }); |