Merge pull request #1698 from nasa/plot-metadata-1684

[Telemetry] Provide legacy domains/ranges
This commit is contained in:
Victor Woeltjen 2017-09-06 08:31:47 -07:00 committed by GitHub
commit 7290601a37
2 changed files with 29 additions and 6 deletions

View File

@ -138,6 +138,11 @@ define(
typeRequest = (type && type.getDefinition().telemetry) || {},
modelTelemetry = domainObject.getModel().telemetry,
fullRequest = Object.create(typeRequest),
newObject = objectUtils.toNewFormat(
domainObject.getModel(),
domainObject.getId()
),
metadata = this.openmct.telemetry.getMetadata(newObject),
bounds,
timeSystem;
@ -173,6 +178,14 @@ define(
}
}
if (!fullRequest.ranges) {
fullRequest.ranges = metadata.valuesForHints(['range']);
}
if (!fullRequest.domains) {
fullRequest.domains = metadata.valuesForHints(['domain']);
}
return fullRequest;
};

View File

@ -91,8 +91,10 @@ define(
"findSubscriptionProvider"
]);
mockTelemetryAPI.getMetadata.andReturn({
valuesForHints: function () {
return [{}];
valuesForHints: function (hint) {
var metadatum = {};
metadatum[hint] = "foo";
return [metadatum];
}
});
@ -147,7 +149,9 @@ define(
source: "testSource", // from model
key: "testKey", // from model
start: 42, // from argument
domain: 'mockTimeSystem'
domain: 'mockTimeSystem',
domains: [{ domain: "foo" }],
ranges: [{ range: "foo" }]
}]);
});
@ -167,7 +171,9 @@ define(
key: "testKey",
start: 0,
end: 1,
domain: 'mockTimeSystem'
domain: 'mockTimeSystem',
domains: [{ domain: "foo" }],
ranges: [{ range: "foo" }]
});
});
@ -184,7 +190,9 @@ define(
key: "testId", // from domain object
start: 0,
end: 1,
domain: 'mockTimeSystem'
domain: 'mockTimeSystem',
domains: [{ domain: "foo" }],
ranges: [{ range: "foo" }]
});
});
@ -266,7 +274,9 @@ define(
key: "testKey",
start: 0,
end: 1,
domain: 'mockTimeSystem'
domain: 'mockTimeSystem',
domains: [{ domain: "foo" }],
ranges: [{ range: "foo" }]
}]
);