mirror of
https://github.com/nasa/openmct.git
synced 2025-02-01 00:45:41 +00:00
[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:
parent
60e888e16e
commit
03e1633a22
@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user