mirror of
https://github.com/nasa/openmct.git
synced 2025-01-31 08:25:31 +00:00
[Telem] ensure request has minimum fields
Ensure telemetry request options always have a certain number of fields-- start, end, and domain. This allows telemetry providers to implement necessary filtering for these types of requests.
This commit is contained in:
parent
6481ddbd7f
commit
6310be623a
@ -196,6 +196,21 @@ define([
|
||||
return this.requestProviders.filter(supportsDomainObject)[0];
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
TelemetryAPI.prototype.standardizeRequestOptions = function (options) {
|
||||
if (!options.hasOwnProperty('start')) {
|
||||
options.start = this.MCT.time.bounds().start;
|
||||
}
|
||||
if (!options.hasOwnProperty('end')) {
|
||||
options.end = this.MCT.time.bounds().end;
|
||||
}
|
||||
if (!options.hasOwnProperty('domain')) {
|
||||
options.domain = this.MCT.time.timeSystem().key;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Request historical telemetry for a domain object.
|
||||
* The `options` argument allows you to specify filters
|
||||
@ -212,6 +227,7 @@ define([
|
||||
* telemetry data
|
||||
*/
|
||||
TelemetryAPI.prototype.request = function (domainObject, options) {
|
||||
this.standardizeRequestOptions(options);
|
||||
var provider = this.findRequestProvider.apply(this, arguments);
|
||||
return provider.request.apply(provider, arguments);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user