kopia lustrzana https://github.com/jamesgao/kiln_controller
don't resample if total number of points is below threshold
rodzic
52819c385b
commit
0198ae8778
|
@ -152,6 +152,8 @@ var tempgraph = (function(module) {
|
|||
}
|
||||
module.Graph.prototype.resample = function(data) {
|
||||
var npoints = 1000;
|
||||
if (data.length<=npoints)
|
||||
return data;
|
||||
var idxs = []
|
||||
var within = [];
|
||||
var within_idx = [];
|
||||
|
@ -161,7 +163,8 @@ var tempgraph = (function(module) {
|
|||
within_idx.push(i);
|
||||
}
|
||||
}
|
||||
if (within.length>npoints) {
|
||||
if (within.length<=npoints)
|
||||
return within;
|
||||
md = Math.floor(within.length/npoints);
|
||||
var fin = []
|
||||
for (var i=0; i<within.length; i++) {
|
||||
|
@ -170,9 +173,6 @@ var tempgraph = (function(module) {
|
|||
}
|
||||
return fin;
|
||||
}
|
||||
else
|
||||
return within;
|
||||
}
|
||||
module.Graph.prototype.update = function(className, data) {
|
||||
var data = this.resample(data);
|
||||
this.lines[className].data = data;
|
||||
|
|
Ładowanie…
Reference in New Issue