|
128 | 128 | if (options.mode) { |
129 | 129 | this.mode = options.mode; |
130 | 130 | } |
131 | | - |
| 131 | + |
132 | 132 | if (options.maxhold !== undefined) { |
133 | 133 | this.maxhold = options.maxhold; |
| 134 | + if (this.maxhold.decay === undefined) { |
| 135 | + this.maxhold.decay = 0; |
| 136 | + } |
134 | 137 | } |
135 | 138 |
|
136 | 139 | // pipe data requires a valid size on overlay, but |
|
316 | 319 | this.ybuf = new ArrayBuffer(this.ybufn); |
317 | 320 | } |
318 | 321 |
|
| 322 | + if (settings.maxhold !== undefined) { |
| 323 | + this.maxhold = settings.maxhold; |
| 324 | + if (this.maxhold.decay === undefined) { |
| 325 | + this.maxhold.decay = 0; |
| 326 | + } |
| 327 | + // clear the maxhold buffer by setting to the current ypoint |
| 328 | + this.mhpoint.set(this.ypoint); |
| 329 | + } |
| 330 | + |
319 | 331 | if (settings.framesize !== undefined) { |
320 | 332 | this.size = settings.framesize; |
321 | 333 | this.xstart = this.hcb.xstart + (this.imin) * this.xdelta; |
|
325 | 337 | this.xmax = Math.max(this.hcb.xstart, d); |
326 | 338 | this.ybufn = this.size * Math.max(this.skip * m.PointArray.BYTES_PER_ELEMENT, m.PointArray.BYTES_PER_ELEMENT); |
327 | 339 | this.ybuf = new ArrayBuffer(this.ybufn); |
| 340 | + if (this.maxhold !== undefined) { |
| 341 | + this.mhptr = new ArrayBuffer(this.pointbufsize); |
| 342 | + this.mhpoint = new m.PointArray(this.mhptr); |
| 343 | + } |
328 | 344 | } |
329 | 345 |
|
330 | 346 | if (settings.color !== undefined) { |
331 | 347 | this.color = settings.color; |
332 | 348 | } |
| 349 | + |
333 | 350 | }, |
334 | 351 |
|
335 | 352 | reload: function(data, hdrmod) { |
|
581 | 598 | m.vsmul(this.ypoint, dbscale, this.ypoint); |
582 | 599 | } |
583 | 600 | mxmn = m.vmxmn(this.ypoint, npts); |
584 | | - |
| 601 | + |
585 | 602 | if ((this.maxhold !== undefined) && (this.mhpoint)) { |
586 | | - m.vmovmax(this.ypoint, 1, this.mhpoint, 1); |
| 603 | + m.vmovmax(this.ypoint, 1, this.mhpoint, 1, undefined, this.maxhold.decay); |
587 | 604 | } |
588 | 605 |
|
589 | 606 | qmax = mxmn.smax; |
|
0 commit comments