mirror of
https://github.com/nasa/openmct.git
synced 2025-06-14 13:18:15 +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:
@ -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
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user