mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 15:43:48 +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:
@ -196,6 +196,21 @@ define([
|
|||||||
return this.requestProviders.filter(supportsDomainObject)[0];
|
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.
|
* Request historical telemetry for a domain object.
|
||||||
* The `options` argument allows you to specify filters
|
* The `options` argument allows you to specify filters
|
||||||
@ -212,6 +227,7 @@ define([
|
|||||||
* telemetry data
|
* telemetry data
|
||||||
*/
|
*/
|
||||||
TelemetryAPI.prototype.request = function (domainObject, options) {
|
TelemetryAPI.prototype.request = function (domainObject, options) {
|
||||||
|
this.standardizeRequestOptions(options);
|
||||||
var provider = this.findRequestProvider.apply(this, arguments);
|
var provider = this.findRequestProvider.apply(this, arguments);
|
||||||
return provider.request.apply(provider, arguments);
|
return provider.request.apply(provider, arguments);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user