mirror of
https://github.com/nasa/openmct.git
synced 2025-04-07 11:26:49 +00:00
[Time Controller] Get conductor working with fixed pos.
WTD-1515
This commit is contained in:
parent
0d710209b1
commit
a4dda695dd
@ -37,21 +37,27 @@ define(
|
||||
*/
|
||||
function SinewaveTelemetrySeries(request) {
|
||||
var latestObservedTime = Math.floor(Date.now() / 1000),
|
||||
count = latestObservedTime - firstObservedTime,
|
||||
endTime = (request.end !== undefined) ?
|
||||
Math.floor(request.end / 1000) : latestObservedTime,
|
||||
count =
|
||||
Math.min(endTime, latestObservedTime) - firstObservedTime,
|
||||
period = request.period || 30,
|
||||
generatorData = {},
|
||||
offset = (request.start !== undefined) ?
|
||||
Math.floor(request.start / 1000) - firstObservedTime :
|
||||
0;
|
||||
|
||||
if (request.size !== undefined) {
|
||||
offset = Math.max(offset, count - request.size);
|
||||
}
|
||||
|
||||
generatorData.getPointCount = function () {
|
||||
return count - offset;
|
||||
};
|
||||
|
||||
generatorData.getDomainValue = function (i, domain) {
|
||||
return (i + offset) * 1000 +
|
||||
(domain !== 'delta' ?
|
||||
(firstObservedTime * 1000) : 0);
|
||||
(domain !== 'delta' ? (firstObservedTime * 1000) : 0);
|
||||
};
|
||||
|
||||
generatorData.getRangeValue = function (i, range) {
|
||||
|
@ -44,18 +44,35 @@ define(
|
||||
this.wrappedCapability = telemetryCapability;
|
||||
}
|
||||
|
||||
ConductorTelemetryCapability.prototype.amendRequest = function (request) {
|
||||
request = request || {};
|
||||
|
||||
// This isn't really the right check, but it happens to distinguish
|
||||
// plots (which want to query for the full set of data for easy
|
||||
// panning) from views like fixed position, which only want the
|
||||
// single latest data point.
|
||||
if (request.size !== undefined) {
|
||||
request.start = this.timeConductor.displayStart();
|
||||
request.end = this.timeConductor.displayEnd();
|
||||
} else {
|
||||
request.start = this.timeConductor.queryStart();
|
||||
request.end = this.timeConductor.queryEnd();
|
||||
}
|
||||
|
||||
return request;
|
||||
};
|
||||
|
||||
ConductorTelemetryCapability.prototype.getMetadata = function () {
|
||||
return this.wrappedCapability.getMetadata();
|
||||
};
|
||||
|
||||
ConductorTelemetryCapability.prototype.requestData = function (request) {
|
||||
request = request || {};
|
||||
request.start = this.timeConductor.queryStart();
|
||||
request.end = this.timeConductor.queryEnd();
|
||||
request = this.amendRequest(request);
|
||||
return this.wrappedCapability.requestData(request);
|
||||
};
|
||||
|
||||
ConductorTelemetryCapability.prototype.subscribe = function (callback, request) {
|
||||
request = this.amendRequest(request);
|
||||
return this.wrappedCapability.subscribe(callback, request);
|
||||
};
|
||||
|
||||
|
@ -120,7 +120,7 @@ define(
|
||||
handle.getDatum(telemetryObject);
|
||||
|
||||
if (telemetryObject &&
|
||||
handle.getDomainValue(telemetryObject) < maxDomainValue) {
|
||||
(handle.getDomainValue(telemetryObject) < maxDomainValue)) {
|
||||
setDisplayedValue(
|
||||
telemetryObject,
|
||||
handle.getRangeValue(telemetryObject),
|
||||
@ -233,7 +233,7 @@ define(
|
||||
}
|
||||
|
||||
// Trigger a new query for telemetry data
|
||||
function updateDisplayBounds(bounds) {
|
||||
function updateDisplayBounds(event, bounds) {
|
||||
maxDomainValue = bounds.end;
|
||||
if (handle) {
|
||||
handle.request(
|
||||
|
Loading…
x
Reference in New Issue
Block a user