[Timeline] Track realtime index in updater

Track realtime index in PlotUpdater to facilitate prepending of
historical data portion on-demand, WTD-806.
This commit is contained in:
Victor Woeltjen
2015-04-16 16:41:09 -07:00
parent 60e888e16e
commit 03e1633a22

View File

@ -29,6 +29,7 @@ define(
domainOffset, domainOffset,
buffers = {}, buffers = {},
lengths = {}, lengths = {},
realtimeIndex = {},
lengthArray = [], lengthArray = [],
bufferArray = []; bufferArray = [];
@ -52,6 +53,8 @@ define(
} else { } else {
// Just shift the existing buffer // Just shift the existing buffer
buffer.set(buffer.subarray(2)); buffer.set(buffer.subarray(2));
// Update the realtime index accordingly
realtimeIndex[id] = Math.max(realtimeIndex[id] - 1, 0);
} }
} }
@ -91,6 +94,11 @@ define(
// Observe max/min range values // Observe max/min range values
max[1] = Math.max(max[1], rangeValue); max[1] = Math.max(max[1], rangeValue);
min[1] = Math.min(min[1], rangeValue); min[1] = Math.min(min[1], rangeValue);
// Update the cutoff point for when we started receiving
// realtime data, to aid in clearing historical data later
if (realtimeIndex[id] === undefined) {
realtimeIndex[id] = index;
}
} }
return buffer; return buffer;
@ -111,6 +119,11 @@ define(
}); });
} }
// Update historical data for this domain object
function setHistorical(domainObject) {
}
// Handle new telemetry data // Handle new telemetry data
function update() { function update() {
var objects = subscription.getTelemetryObjects(); var objects = subscription.getTelemetryObjects();
@ -205,7 +218,11 @@ define(
/** /**
* Update with latest data. * Update with latest data.
*/ */
update: update update: update,
/**
* Fill in historical data.
*/
setHistorical: setHistorical
}; };
} }