summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ebus/webapp/static/ebus.js35
-rw-r--r--ebus/webapp/static/index.html3
2 files changed, 29 insertions, 9 deletions
diff --git a/ebus/webapp/static/ebus.js b/ebus/webapp/static/ebus.js
index e108f0a..15fe692 100644
--- a/ebus/webapp/static/ebus.js
+++ b/ebus/webapp/static/ebus.js
@@ -6,6 +6,7 @@ $(document).ready(function(){
var datasetOverview = [];
var plotOverview = null;
var plotDetail = null;
+ var indexFound = null;
var replot = function() {
if (plotDetail == null) {
@@ -60,9 +61,18 @@ $(document).ready(function(){
}
});
};
+
var unplotSensorDetail = function(sensorname) {
-
+ $.each(datasetDetail, function(i, sensor) {
+ alert(datasetDetail[i].label);
+ if (sensor.label == sensorname) {
+ indexFound = i;
+ }
+ });
+ datasetDetail.splice(indexFound,1);
+ replot();
};
+
var plotSensorOverview = function(sensorname) {
$.getJSON("sensor_cached/"+escape(sensorname)+"/"+fromOverview, //+"/"+to,
function(response) {
@@ -76,6 +86,15 @@ $(document).ready(function(){
});
};
+ var unplotSensorOverview = function(sensorname) {
+ $.each(datasetOverview, function(i, sensor) {
+ if (datasetOverview[i].label == sensorname) {
+ indexFound = i;
+ }
+ });
+ datasetOverview.splice(indexFound,1);
+ replotOverview();
+ }
$("#overview").bind("plotselected", function (event, ranges) {
range_from = Math.round(ranges.xaxis.from / 1000);
@@ -103,12 +122,12 @@ $(document).ready(function(){
plotSensor("heizkreisregler10.betriebsdatenRegler1.kesselTemperatur");
plotSensor("feuerungsautomat1.betriebsdatenRegler1.aussenTemperatur");
// TODO http://people.iola.dk/olau/flot/examples/annotating.html
- $('#button').click(function() {
- $.each(datasetDetail, function(i, sensor) {
- if (datasetDetail[i].label == "heizkreisregler9.solarDaten.tempKollektor") {
- datasetDetail.splice(i,1);
- replot();
- }
- });
+
+
+ $('#ausblenden').click(function() {
+ unplotSensor("heizkreisregler9.solarDaten.tempKollektor");
+ });
+ $('#einblenden').click(function() {
+ plotSensor("heizkreisregler9.solarDaten.tempKollektor");
});
});
diff --git a/ebus/webapp/static/index.html b/ebus/webapp/static/index.html
index e385865..7e2582d 100644
--- a/ebus/webapp/static/index.html
+++ b/ebus/webapp/static/index.html
@@ -9,6 +9,7 @@
<body>
<div id="ebusgraph"></div>
<div id="overview"></div>
- <div id="button">ausblenden</div>
+ <div id="ausblenden">ausblenden</div>
+ <div id="einblenden">einblenden</div>
</body>
</html>