mirror of
https://github.com/nasa/openmct.git
synced 2025-04-07 19:34:25 +00:00
[Telemetry] include type telemetry metadata
Read telemetry metadata from type and include in telemetry. Allows telemetry service to work with SWG.
This commit is contained in:
parent
215e9b26a8
commit
799c418124
@ -257,9 +257,12 @@ define([
|
||||
*/
|
||||
TelemetryAPI.prototype.getMetadata = function (domainObject) {
|
||||
if (!this.metadataCache.has(domainObject)) {
|
||||
if (!this.typeService) {
|
||||
this.typeService = this.MCT.$injector.get('typeService');
|
||||
}
|
||||
this.metadataCache.set(
|
||||
domainObject,
|
||||
new TelemetryMetadataManager(domainObject)
|
||||
new TelemetryMetadataManager(domainObject, this.typeService)
|
||||
);
|
||||
}
|
||||
return this.metadataCache.get(domainObject);
|
||||
|
@ -84,12 +84,16 @@ define([
|
||||
* Wraps old format metadata to new format metadata.
|
||||
* Provides methods for interrogating telemetry metadata.
|
||||
*/
|
||||
function TelemetryMetadataManager(domainObject) {
|
||||
function TelemetryMetadataManager(domainObject, typeService) {
|
||||
this.metadata = domainObject.telemetry || {};
|
||||
|
||||
if (this.metadata.values) {
|
||||
this.valueMetadatas = this.metadata.values;
|
||||
} else {
|
||||
var typeMetadata = typeService
|
||||
.getType(domainObject.type).typeDef.telemetry;
|
||||
|
||||
_.extend(this.metadata, typeMetadata);
|
||||
this.valueMetadatas = valueMetadatasFromOldFormat(this.metadata);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user