summaryrefslogtreecommitdiff
path: root/ebus/webhdf/static
diff options
context:
space:
mode:
Diffstat (limited to 'ebus/webhdf/static')
-rw-r--r--ebus/webhdf/static/css/stylesheet.css15
-rw-r--r--ebus/webhdf/static/index.html2
-rw-r--r--ebus/webhdf/static/src/ebus.js25
3 files changed, 24 insertions, 18 deletions
diff --git a/ebus/webhdf/static/css/stylesheet.css b/ebus/webhdf/static/css/stylesheet.css
index edc0c9b..cfaa2fe 100644
--- a/ebus/webhdf/static/css/stylesheet.css
+++ b/ebus/webhdf/static/css/stylesheet.css
@@ -1,22 +1,25 @@
body {
+ margin: 0;
font-family:sans;
text-align:center;
+ width:100%;
}
#ebusgraph {
- margin:auto;
- width:100%;
+ margin: auto;
+ width: 90%;
height: 70%;
}
#overview {
- width: 100%;
- margin:auto;
- height:100px;
+ margin: 2% auto 0% auto;
+ width: 90%;
+ height: 100px;
}
#options {
- width:800px;
+ height: 10%;
+ width: 800px;
margin:auto;
text-align:left;
}
diff --git a/ebus/webhdf/static/index.html b/ebus/webhdf/static/index.html
index 04ecc15..53f103e 100644
--- a/ebus/webhdf/static/index.html
+++ b/ebus/webhdf/static/index.html
@@ -8,9 +8,9 @@
</head>
<body>
<div id="ebusgraph"></div>
+ <div id="overview"></div>
<div id="options">
<div id="sensorpicker"></div>
</div>
- <div id="overview"></div>
</body>
</html>
diff --git a/ebus/webhdf/static/src/ebus.js b/ebus/webhdf/static/src/ebus.js
index ce37557..5c4fa16 100644
--- a/ebus/webhdf/static/src/ebus.js
+++ b/ebus/webhdf/static/src/ebus.js
@@ -11,7 +11,7 @@ d.now = new Date().getTime();
function int(n) { return Math.round(n); };
$(document).ready(function(){
- var from = d.now - 5*d.day;
+ var from = d.now - 1*d.day;
var fromOverview = d.now - 30*d.day;
var to = d.now;
var datasetDetail = []
@@ -23,7 +23,7 @@ $(document).ready(function(){
{"sensorname":"heizkreisregler10.betriebsdatenRegler1.kesselTemperatur","show":true, "color":"#283074"},
{"sensorname":"heizkreisregler9.solarDaten.tempWarmwasserSolar","show":false, "color":"#f0ff4c"},
{"sensorname":"feuerungsautomat1.betriebsdatenRegler1.aussenTemperatur","show":false, "color":"#84b500"},
- {"sensorname":"de.wettermichel.temperature","show":true, "color":"#24f590"},
+ // {"sensorname":"de.wettermichel.temperature","show":true, "color":"#24f590"},
{"sensorname":"heizkreisregler10.betriebsdatenRegler1.boilerTemperatur","show":true, "color":"#48b4ff"}];
var pickSensorConfig = function(sensorname) {
@@ -40,7 +40,7 @@ $(document).ready(function(){
plotDetail = $.plot($("#ebusgraph"),
datasetDetail,
{
- xaxis: { mode: "time", min: from, max:to },
+ xaxis: { mode: "time", min: tzFix(from), max:tzFix(to) },
yaxis: { min: -16, max: 100 },
legend: { show : true}
});
@@ -54,7 +54,7 @@ $(document).ready(function(){
lines: { show: true, lineWidth: 1 },
shadowSize: 0
},
- xaxis: { mode: "time", min: fromOverview, max: d.now },
+ xaxis: { mode: "time", min: tzFix(fromOverview), max: tzFix(d.now) },
yaxis: { ticks: [], min: -26, max: 100, autoscaleMargin: 0.1 },
legend: { show: false },
selection: { mode: "x" }
@@ -73,15 +73,16 @@ $(document).ready(function(){
unplotSensorDetail(sensorname);
unplotSensorOverview(sensorname);
};
- var tzFix = function(d) {
- return d; //return d - new Date().getTimezoneOffset() * 60 * 1000;
- }
+ var tzFix = function(d) { return d - new Date().getTimezoneOffset() * 60 * 1000; }
+ var tzUnfix = function(d) { return d + new Date().getTimezoneOffset() * 60 * 1000; }
var plotSensorDetail = function(sensorConfig) {
$.getJSON("sensor/"+escape(sensorConfig.sensorname)+"/"+int(from/1000)+"/"+int(to/1000),
function(response) {
if (!response.error) {
- response.data = response.data.map(function(d) { return [ tzFix(d[0]), d[1] ]; });
+ response.data = response.data.map(function(d) {
+ return [ tzFix(d[0]*1000), d[1] ];
+ });
datasetDetail.push({'data':response['data'],
'label':sensorConfig.sensorname,
'color':sensorConfig.color});
@@ -106,7 +107,9 @@ $(document).ready(function(){
$.getJSON("avg/"+escape(sensorConfig.sensorname)+"/"+int(fromOverview/1000),
function(response) {
if (!response.error) {
- response.data = response.data.map(function(d) { return [ tzFix(d[0]), d[1] ]; });
+ response.data = response.data.map(function(d) {
+ return [ tzFix(d[0]*1000), d[1] ];
+ });
datasetOverview.push({'data':response['data'],
'label':sensorConfig.sensorname,
'color':sensorConfig.color});
@@ -136,8 +139,8 @@ $(document).ready(function(){
plotOverview.setSelection({xaxis: {'from': from, 'to': to}}, true);
return;
} else {
- from = range_from;
- to = range_to;
+ from = tzUnfix( range_from );
+ to = tzUnfix( range_to );
}
sensors = [];
for (elem in datasetOverview) {