mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 06:08:11 +00:00
[Time Controller] Simplify retrieval of datum objects
...for historical data. Supports WTD-1515
This commit is contained in:
@ -106,10 +106,24 @@ define(
|
||||
.then(issueRequests);
|
||||
};
|
||||
|
||||
self.getDatum = function (telemetryObject, series, index) {
|
||||
return arguments.length > 1 ?
|
||||
/**
|
||||
* Get the latest telemetry datum for this domain object. This
|
||||
* will be from real-time telemetry, unless an index is specified,
|
||||
* in which case it will be pulled from the historical telemetry
|
||||
* series at the specified index.
|
||||
*
|
||||
* @param {DomainObject} domainObject the object of interest
|
||||
* @param {number} [index] the index of the data of interest
|
||||
* @returns {TelemetryDatum} the most recent datum
|
||||
*/
|
||||
self.getDatum = function (telemetryObject, index) {
|
||||
return typeof index !== 'number' ?
|
||||
subscription.getDatum(telemetryObject) :
|
||||
subscription.makeDatum(telemetryObject, series, index);
|
||||
subscription.makeDatum(
|
||||
telemetryObject,
|
||||
this.getSeries(telemetryObject),
|
||||
index
|
||||
);
|
||||
};
|
||||
|
||||
return self;
|
||||
|
Reference in New Issue
Block a user