Avoid plotting invalid temperature sensor values.
authorPat Thoyts <Patrick.Thoyts@renishaw.com>
Fri, 13 May 2016 09:27:34 +0000 (10:27 +0100)
committerPat Thoyts <Patrick.Thoyts@renishaw.com>
Fri, 13 May 2016 09:27:34 +0000 (10:27 +0100)
static/sensor-hub.html

index 61749069d911642d880c255d3defe47f880e81b9..1aa39fa5eb10aa9cb7f35e39bd4c9053a215afb6 100644 (file)
@@ -112,7 +112,10 @@ function on_draw_graph(data) {
     $.each(data.result, function(i,item) {
         var t = item.timestamp*1000;
         $.each(item.sensors, function(n, sensor) {
-            plotdata[n].data.push([t,sensor.value]);
+            var v = sensor.value;
+            if (v < -100)
+                v = plotdata[n].data[plotdata[n].data.length - 1];
+            plotdata[n].data.push([t,v]);
         });
     });
     $('#status').html('');