[Plot] Use new API from PlotUpdater

Use PlotLine and PlotLineBuffer from PlotUpdater, to enable
merging of real-time and historical telemetry. WTD-806.
This commit is contained in:
Victor Woeltjen
2015-04-17 14:00:00 -07:00
parent 4d34f19aa2
commit 7370b1a87f
5 changed files with 255 additions and 224 deletions

View File

@ -34,11 +34,11 @@ define(
subplot.setDomainOffset(prepared.getDomainOffset());
// Draw the buffers. Select color by index.
subplot.getDrawingObject().lines = prepared.getBuffers().map(function (buf, i) {
subplot.getDrawingObject().lines = prepared.getLineBuffers().map(function (buf, i) {
return {
buffer: buf,
buffer: buf.getBuffer(),
color: PlotPalette.getFloatColor(i),
points: prepared.getLength(i)
points: buf.getLength()
};
});

View File

@ -23,7 +23,7 @@ define(
});
function plotTelemetryTo(subplot, prepared, index) {
var buffer = prepared.getBuffers()[index];
var buffer = prepared.getLineBuffers()[index];
// Track the domain offset, used to bias domain values
// to minimize loss of precision when converted to 32-bit
@ -33,9 +33,9 @@ define(
// Draw the buffers. Always use the 0th color, because there
// is one line per plot.
subplot.getDrawingObject().lines = [{
buffer: buffer,
buffer: buffer.getBuffer(),
color: PlotPalette.getFloatColor(0),
points: prepared.getLength(index)
points: buffer.getLength()
}];
subplot.update();