[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,
buffers = {},
lengths = {},
realtimeIndex = {},
lengthArray = [],
bufferArray = [];
@ -52,6 +53,8 @@ define(
} else {
// Just shift the existing buffer
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
max[1] = Math.max(max[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;
@ -111,6 +119,11 @@ define(
});
}
// Update historical data for this domain object
function setHistorical(domainObject) {
}
// Handle new telemetry data
function update() {
var objects = subscription.getTelemetryObjects();
@ -205,7 +218,11 @@ define(
/**
* Update with latest data.
*/
update: update
update: update,
/**
* Fill in historical data.
*/
setHistorical: setHistorical
};
}