mirror of
https://github.com/nasa/openmct.git
synced 2025-06-11 11:51:40 +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) {
|
function SinewaveTelemetrySeries(request) {
|
||||||
var latestObservedTime = Math.floor(Date.now() / 1000),
|
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,
|
period = request.period || 30,
|
||||||
generatorData = {},
|
generatorData = {},
|
||||||
offset = (request.start !== undefined) ?
|
offset = (request.start !== undefined) ?
|
||||||
Math.floor(request.start / 1000) - firstObservedTime :
|
Math.floor(request.start / 1000) - firstObservedTime :
|
||||||
0;
|
0;
|
||||||
|
|
||||||
|
if (request.size !== undefined) {
|
||||||
|
offset = Math.max(offset, count - request.size);
|
||||||
|
}
|
||||||
|
|
||||||
generatorData.getPointCount = function () {
|
generatorData.getPointCount = function () {
|
||||||
return count - offset;
|
return count - offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
generatorData.getDomainValue = function (i, domain) {
|
generatorData.getDomainValue = function (i, domain) {
|
||||||
return (i + offset) * 1000 +
|
return (i + offset) * 1000 +
|
||||||
(domain !== 'delta' ?
|
(domain !== 'delta' ? (firstObservedTime * 1000) : 0);
|
||||||
(firstObservedTime * 1000) : 0);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
generatorData.getRangeValue = function (i, range) {
|
generatorData.getRangeValue = function (i, range) {
|
||||||
|
@ -44,18 +44,35 @@ define(
|
|||||||
this.wrappedCapability = telemetryCapability;
|
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 () {
|
ConductorTelemetryCapability.prototype.getMetadata = function () {
|
||||||
return this.wrappedCapability.getMetadata();
|
return this.wrappedCapability.getMetadata();
|
||||||
};
|
};
|
||||||
|
|
||||||
ConductorTelemetryCapability.prototype.requestData = function (request) {
|
ConductorTelemetryCapability.prototype.requestData = function (request) {
|
||||||
request = request || {};
|
request = this.amendRequest(request);
|
||||||
request.start = this.timeConductor.queryStart();
|
|
||||||
request.end = this.timeConductor.queryEnd();
|
|
||||||
return this.wrappedCapability.requestData(request);
|
return this.wrappedCapability.requestData(request);
|
||||||
};
|
};
|
||||||
|
|
||||||
ConductorTelemetryCapability.prototype.subscribe = function (callback, request) {
|
ConductorTelemetryCapability.prototype.subscribe = function (callback, request) {
|
||||||
|
request = this.amendRequest(request);
|
||||||
return this.wrappedCapability.subscribe(callback, request);
|
return this.wrappedCapability.subscribe(callback, request);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ define(
|
|||||||
handle.getDatum(telemetryObject);
|
handle.getDatum(telemetryObject);
|
||||||
|
|
||||||
if (telemetryObject &&
|
if (telemetryObject &&
|
||||||
handle.getDomainValue(telemetryObject) < maxDomainValue) {
|
(handle.getDomainValue(telemetryObject) < maxDomainValue)) {
|
||||||
setDisplayedValue(
|
setDisplayedValue(
|
||||||
telemetryObject,
|
telemetryObject,
|
||||||
handle.getRangeValue(telemetryObject),
|
handle.getRangeValue(telemetryObject),
|
||||||
@ -233,7 +233,7 @@ define(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Trigger a new query for telemetry data
|
// Trigger a new query for telemetry data
|
||||||
function updateDisplayBounds(bounds) {
|
function updateDisplayBounds(event, bounds) {
|
||||||
maxDomainValue = bounds.end;
|
maxDomainValue = bounds.end;
|
||||||
if (handle) {
|
if (handle) {
|
||||||
handle.request(
|
handle.request(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user