Add time context to telemetry requests (#5887)

* add time context to telemetry requests

* change to empty array

* refactor telemetry api to use time context

* removed unused function

* add tests

* add test, rename function

* make function public
This commit is contained in:
Scott Bell
2022-10-21 20:25:24 +02:00
committed by GitHub
parent bd1e869f6a
commit 9e23f79bc8
6 changed files with 181 additions and 170 deletions

View File

@ -282,12 +282,15 @@ export default {
this.limitEvaluator = this.openmct.telemetry.limitEvaluator(this.domainObject);
this.formats = this.openmct.telemetry.getFormatMap(this.metadata);
this.timeContext = this.openmct.time.getContextForView(this.objectPath);
const valueMetadata = this.metadata ? this.metadata.value(this.item.value) : {};
this.customStringformatter = this.openmct.telemetry.customStringFormatter(valueMetadata, this.item.format);
this.telemetryCollection = this.openmct.telemetry.requestCollection(this.domainObject, {
size: 1,
strategy: 'latest'
strategy: 'latest',
timeContext: this.timeContext
});
this.telemetryCollection.on('add', this.setLatestValues);
this.telemetryCollection.on('clear', this.refreshData);