diff options
author | yvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd> | 2010-06-09 11:14:18 +0000 |
---|---|---|
committer | yvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd> | 2010-06-09 11:14:18 +0000 |
commit | feebdc2e14426921a585c31c5279886bca3e2eca (patch) | |
tree | 82fbb3700d5d43d1d302d95c639d0d540b7bcabb /static/index.html | |
parent | 602182ed488c9713d793206f6da2f3758051c32d (diff) | |
download | ebus-alt-feebdc2e14426921a585c31c5279886bca3e2eca.tar.gz ebus-alt-feebdc2e14426921a585c31c5279886bca3e2eca.zip |
foo
git-svn-id: http://10.2.2.13/svn/common/ebus@1676 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd
Diffstat (limited to 'static/index.html')
-rw-r--r-- | static/index.html | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..3c8445a --- /dev/null +++ b/static/index.html @@ -0,0 +1,93 @@ +<!doctype html> +<html> + <head> + <title>EBUS Daten</title> + <script src="/static/jquery.js"></script> + <script src="/static/jquery-flot.js"></script> + </head> + <body> + <div id="placeholder">Aktivieren Sie JavaScript</div> + <script> + var placeholder = jQuery("div#placeholder"); + placeholder.css({fontSize:"2em", paddingLeft:"30%"}).text("Hole Daten"); + var options = { + lines: { show: true }, + points: { show: true }, + xaxis: { mode:'time' }, + grid: { markings: [] } + }; + function onDataReceived(recData) { + data = new Array(); + for (var key in recData) { + if (! key.match(/\.reduced/)) { + data.push(recData[key]); + } + } + placeholder.css({width:"90%", height:window.innerHeight-100, paddingLeft:0, fontSize:"1em"}).text(""); + plot = $.plot(placeholder, data, options); + + var start = null; + for (var m in recData["solarDaten.solarPumpe.reduced"].data) { + m = recData["solarDaten.solarPumpe.reduced"].data[m]; + pumpeAn = m[1]; + + if (pumpeAn && start == null) + start = m[0]; + else if (!pumpeAn && start != null) { + options.grid.markings.push({ + color: "rgba(100, 200, 15, 0.5)", + lineWidth: 1, + xaxis: { from: start, to: m[0]}}); + start = null; + } else { + start = null; + } + } + if (start != null) + options.grid.markings.push({ + color: "rgba(100, 200, 15, 0.5)", + lineWidth: 1, + xaxis: { from: start, to:99999999999999}}); + + var start = null; + for (var m in recData["betriebsdatenFeuerungsautomat.betriebszustand.reduced"].data) { + m = recData["betriebsdatenFeuerungsautomat.betriebszustand.reduced"].data[m]; + if (m[1] == "brauchwasserHeizbetrieb" && start == null) { + start = m[0]; + } else if (m[1] == "brennerAbschalten" && start != null) { + options.grid.markings.push({ + color: "rgba(205, 15, 15, 0.5)", + lineWidth: 1, + xaxis: { from: start, to: m[0]}}); + start = null; + } + } + if (start != null) + options.grid.markings.push({ + color: "rgba(205, 15, 15, 0.5)", + lineWidth: 1, + xaxis: { from: start, to: 99999999999999}}); + + + // replot + plot = $.plot(placeholder, data, options); + } + jQuery(document).ready(function() { + var dataTypes = [ + "solarDaten.tempKollektor", + "solarDaten.tempWarmwasserSolar", + "betriebsdatenRegler1.aussenTemperatur", + "betriebsdatenRegler1.kesselTemperatur", + "betriebsdatenRegler1.boilerTemperatur", + "solarDaten.solarPumpe.reduced", + "betriebsdatenFeuerungsautomat.betriebszustand.reduced" + ] + $.ajax({ + url:'/json/' + dataTypes.join(","), + method:'GET', + dataType:'json', + success: onDataReceived}); + }); + </script> + </body> +</html> |