diff options
Diffstat (limited to 'ebus')
-rw-r--r-- | ebus/webapp/static/ebus.js | 36 | ||||
-rw-r--r-- | ebus/webapp/static/index.html | 5 | ||||
-rw-r--r-- | ebus/webapp/static/main.css | 6 |
3 files changed, 35 insertions, 12 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); + } }); }); 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 @@ </head> <body> <div id="ebusgraph"></div> + <div id="options"> + <div id="sensorpicker"></div> + </div> <div id="overview"></div> - <div id="ausblenden">ausblenden</div> - <div id="einblenden">einblenden</div> </body> </html> 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; +} |