##// END OF EJS Templates
Fix noise plot not plotting gaps
Juan C. Espinoza -
r12:15f210b8fac1
parent child
Show More
@@ -155,11 +155,6 class PcolorBuffer {
155 var cnt = 0;
155 var cnt = 0;
156 last = x.slice(-1)[0];
156 last = x.slice(-1)[0];
157 while (Math.abs(parseFloat(xBuffer[i]) - last ) > 1.5 * parseFloat(interval)) {
157 while (Math.abs(parseFloat(xBuffer[i]) - last ) > 1.5 * parseFloat(interval)) {
158 //console.log(parseFloat(xBuffer[i]));
159 //console.log(last);
160 //console.log(Math.abs(parseFloat(xBuffer[i]) - last));
161 //console.log(parseFloat(interval));
162 //console.log("==========");
163 cnt += 1;
158 cnt += 1;
164 last = last + interval;
159 last = last + interval;
165 x.push(last);
160 x.push(last);
@@ -200,7 +195,7 class PcolorBuffer {
200
195
201 // fill data gaps
196 // fill data gaps
202 var cnt = 0;
197 var cnt = 0;
203 console.log('updating');
198
204 while (Math.abs(parseFloat(obj.time[0]) - this.last) > 1.5 * parseFloat(obj.interval)) {
199 while (Math.abs(parseFloat(obj.time[0]) - this.last) > 1.5 * parseFloat(obj.interval)) {
205 cnt += 1;
200 cnt += 1;
206 this.last += obj.interval;
201 this.last += obj.interval;
@@ -280,7 +275,6 class Pcolor {
280 }
275 }
281 /* This function is used to plot all the data that have the DB and just is used when is loaded or reloaded*/
276 /* This function is used to plot all the data that have the DB and just is used when is loaded or reloaded*/
282 setup(data) {
277 setup(data) {
283 console.log(data);
284 for (var i = 0; i < data.spc.length; i++) {
278 for (var i = 0; i < data.spc.length; i++) {
285 var layout = {
279 var layout = {
286 height: 400,
280 height: 400,
@@ -387,7 +381,7 class Pcolor {
387 }
381 }
388
382
389 plot(obj) {
383 plot(obj) {
390 this.data = obj;
384 // this.data = obj;
391 // add new data to plots and empty buffers
385 // add new data to plots and empty buffers
392 console.log('Plotting...');
386 console.log('Plotting...');
393 var t = new Date(obj.time[0] * 1000);
387 var t = new Date(obj.time[0] * 1000);
@@ -421,15 +415,6 class Pcolor {
421
415
422 });
416 });
423
417
424 /*Plotly.relayout(div, {
425 xaxis: {
426 range: [values.xmin, values.xmax]
427 },
428
429
430 });*/
431
432
433 Plotly.restyle(div, {
418 Plotly.restyle(div, {
434 zmin: values.zmin,
419 zmin: values.zmin,
435 zmax: values.zmax,
420 zmax: values.zmax,
@@ -483,11 +468,11 class Scatter {
483 this.ybuffer.push([]);
468 this.ybuffer.push([]);
484 var trace = {
469 var trace = {
485 x: t,
470 x: t,
486 y: data[this.key][i],
471 y: values.data[i],
487 mode: 'lines',
472 mode: 'lines',
488 type: 'scatter',
473 type: 'scatter',
489 name: 'Channel ' + i,
474 name: 'Channel ' + i,
490 connectgaps:false,
475 connectgaps: false,
491 };
476 };
492
477
493 traces.push(trace);
478 traces.push(trace);
General Comments 0
You need to be logged in to leave comments. Login now