summaryrefslogtreecommitdiff
path: root/ebus/webapp/static/ebus.js
diff options
context:
space:
mode:
authoryvesf <yvesf-git@xapek.org>2011-07-17 16:00:10 +0200
committeryvesf <yvesf-git@xapek.org>2011-07-17 16:00:10 +0200
commit578f530ca0d0c01166b9a28fd0b2e0ab0ef750cc (patch)
treec38516b28133bf2c552cdf2756a2726999d01417 /ebus/webapp/static/ebus.js
parent314608a4f88b78a84556db9101b004f405534be7 (diff)
downloadebus-alt-578f530ca0d0c01166b9a28fd0b2e0ab0ef750cc.tar.gz
ebus-alt-578f530ca0d0c01166b9a28fd0b2e0ab0ef750cc.zip
.js ausgelagert; overview plot - keine selektion
Diffstat (limited to 'ebus/webapp/static/ebus.js')
-rw-r--r--ebus/webapp/static/ebus.js55
1 files changed, 55 insertions, 0 deletions
diff --git a/ebus/webapp/static/ebus.js b/ebus/webapp/static/ebus.js
new file mode 100644
index 0000000..dc86cda
--- /dev/null
+++ b/ebus/webapp/static/ebus.js
@@ -0,0 +1,55 @@
+$(document).ready(function(){
+ var from = Math.round(new Date().getTime()/1000) - 3*24*60*60; //86400;
+ var fromOverview = Math.round(new Date().getTime()/1000) - 30*24*60*60; //86400;
+ var to = Math.round(new Date().getTime()/1000);
+ var dataset = []
+ var datasetOverview = [];
+ var replot = function() {
+ $.plot($("#ebusgraph"),
+ dataset,
+ { xaxis: { mode: "time"}});
+ };
+ var replotOverview = function() {
+ $.plot($("#overview"),
+ datasetOverview,
+ {
+ series: {
+ lines: { show: true, lineWidth: 1 },
+ shadowSize: 0
+ },
+ xaxis: { mode: "time" },
+ yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 },
+ selection: { mode: "x" }
+ });
+ };
+ var plotSensor = function(sensorname) {
+ $.getJSON("/sensor/"+escape(sensorname)+"/"+from+"/"+to,
+ function(response) {
+ if (response['data']) {
+ dataset.push({'data':response['data'],
+ 'label':sensorname});
+ replot();
+ } else {
+ alert("Fehler: " + response["error"]);
+ }
+ });
+ $.getJSON("/sensor_cached/"+escape(sensorname)+"/"+fromOverview, //+"/"+to,
+ function(response) {
+ if (response['data']) {
+ datasetOverview.push({'data':response['data'],
+ 'label':null});
+ replotOverview();
+ } else {
+ alert("Overview Fehler: " + response["error"]);
+ }
+ });
+
+ };
+
+
+ plotSensor("heizkreisregler9.solarDaten.tempKollektor");
+//ausreisser// plotSensor("heizkreisregler9.solarDaten.tempWarmwasserSolar");
+ plotSensor("heizkreisregler10.betriebsdatenRegler1.kesselTemperatur");
+ plotSensor("feuerungsautomat1.betriebsdatenRegler1.aussenTemperatur");
+ // TODO http://people.iola.dk/olau/flot/examples/annotating.html
+}); \ No newline at end of file