summaryrefslogtreecommitdiff
path: root/ebus/webapp
diff options
context:
space:
mode:
authormarc <you@example.com>2011-07-23 19:23:37 +0200
committermarc <you@example.com>2011-07-23 19:23:37 +0200
commitf85f93c6dda345321e821220f0a2b801194711dd (patch)
treee6de5cd16eb706936b3cfcafe7677f746d3bcee0 /ebus/webapp
parentb6538e5d0f9b5fa58f8d94b33d8b7912471c0102 (diff)
downloadebus-alt-f85f93c6dda345321e821220f0a2b801194711dd.tar.gz
ebus-alt-f85f93c6dda345321e821220f0a2b801194711dd.zip
Auswählen vorkonfigurierter Sensoren
Diffstat (limited to 'ebus/webapp')
-rw-r--r--ebus/webapp/static/ebus.js36
-rw-r--r--ebus/webapp/static/index.html5
-rw-r--r--ebus/webapp/static/main.css6
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;
+}