summaryrefslogtreecommitdiff
path: root/ebus/webapp/static/console.html
diff options
context:
space:
mode:
Diffstat (limited to 'ebus/webapp/static/console.html')
-rw-r--r--ebus/webapp/static/console.html48
1 files changed, 43 insertions, 5 deletions
diff --git a/ebus/webapp/static/console.html b/ebus/webapp/static/console.html
index 83dce58..c32445c 100644
--- a/ebus/webapp/static/console.html
+++ b/ebus/webapp/static/console.html
@@ -1,20 +1,47 @@
<html>
<head>
<script src="lib/jquery-1.6.2/jquery-1.6.2.min.js"></script>
+ <script src="lib/d3-v2.6.1/d3.js"></script>
+ <style>
+ #log {
+ height: 300px;
+ overflow-y: scroll;
+ }
+ </style>
</head>
<body>
+<div id="image">
+</div>
<div id="log">
</div>
<script>
+ var mapping = {
+ "heizkesselWert" : "heizkreisregler10.betriebsdatenRegler1.kesselTemperatur",
+ "tempkollektorWert" : "heizkreisregler9.solarDaten.tempKollektor",
+ "boilerWert" : "feuerungsautomat1.betriebsdatenRegler1.boilerTemperatur"
+ };
+ function timeToString(timestamp) {
+ var d = new Date();
+ return "" + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds();
+ }
function log(data) {
for (var i in data) {
+ var row = data[i];
+
var sensor_name = data[i][0];
var timestamp = data[i][1];
var value = data[i][2];
- var caption = "" + timestamp + ": " + sensor_name + " Value: " + value;
+ var caption = "" + timeToString(row.timestamp) + ": " + row.name + " Value: " + row.value_real + " - " + row.value_string;
- jQuery("div#log").append(
+ jQuery("div#log").prepend(
jQuery("<div>").text(caption));
+
+ for (var mapping_element_id in mapping) {
+ var mapping_sensor_name = mapping[mapping_element_id];
+ if (row.name == mapping_sensor_name) {
+ d3.select("#" + mapping_element_id).text("" + row.value_real);
+ }
+ }
}
}
@@ -25,9 +52,20 @@
});
}
- jQuery.getJSON("../stream", function(resp) {
- log(resp.data);
- reload(resp.time_stop);
+ jQuery(document).ready(function() {
+
+ d3.xml("draw.svg", "image/svg+xml", function(xml) {
+ jQuery("#image")[0].appendChild(xml.documentElement);
+ });
+
+ jQuery.getJSON("../all_values", function(resp) {
+ log(resp.data);
+
+ jQuery.getJSON("../stream", function(resp) {
+ log(resp.data);
+ reload(resp.time_stop);
+ });
+ });
});
</script>
</body>