@@ -155,11 +155,6 class PcolorBuffer { | |||
|
155 | 155 | var cnt = 0; |
|
156 | 156 | last = x.slice(-1)[0]; |
|
157 | 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 | 158 |
|
|
164 | 159 | last = last + interval; |
|
165 | 160 | x.push(last); |
@@ -200,7 +195,7 class PcolorBuffer { | |||
|
200 | 195 | |
|
201 | 196 | // fill data gaps |
|
202 | 197 | var cnt = 0; |
|
203 | console.log('updating'); | |
|
198 | ||
|
204 | 199 | while (Math.abs(parseFloat(obj.time[0]) - this.last) > 1.5 * parseFloat(obj.interval)) { |
|
205 | 200 | cnt += 1; |
|
206 | 201 | this.last += obj.interval; |
@@ -280,7 +275,6 class Pcolor { | |||
|
280 | 275 | } |
|
281 | 276 | /* This function is used to plot all the data that have the DB and just is used when is loaded or reloaded*/ |
|
282 | 277 | setup(data) { |
|
283 | console.log(data); | |
|
284 | 278 | for (var i = 0; i < data.spc.length; i++) { |
|
285 | 279 | var layout = { |
|
286 | 280 | height: 400, |
@@ -387,7 +381,7 class Pcolor { | |||
|
387 | 381 | } |
|
388 | 382 | |
|
389 | 383 | plot(obj) { |
|
390 | this.data = obj; | |
|
384 | // this.data = obj; | |
|
391 | 385 | // add new data to plots and empty buffers |
|
392 | 386 | console.log('Plotting...'); |
|
393 | 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 | 418 | Plotly.restyle(div, { |
|
434 | 419 | zmin: values.zmin, |
|
435 | 420 | zmax: values.zmax, |
@@ -483,11 +468,11 class Scatter { | |||
|
483 | 468 | this.ybuffer.push([]); |
|
484 | 469 | var trace = { |
|
485 | 470 | x: t, |
|
486 |
y: data |
|
|
471 | y: values.data[i], | |
|
487 | 472 | mode: 'lines', |
|
488 | 473 | type: 'scatter', |
|
489 | 474 | name: 'Channel ' + i, |
|
490 | connectgaps:false, | |
|
475 | connectgaps: false, | |
|
491 | 476 | }; |
|
492 | 477 | |
|
493 | 478 | traces.push(trace); |
General Comments 0
You need to be logged in to leave comments.
Login now