[Plot] Allow lookup of alternate ranges

This commit is contained in:
Victor Woeltjen 2015-11-10 16:02:18 -08:00
parent ae7a1618e8
commit a88fadcb49

View File

@ -287,9 +287,12 @@ define(
* @param {DomainObject} domainObject the object of interest
* @returns the most recent domain value observed
*/
TelemetrySubscription.prototype.getDomainValue = function (domainObject) {
var id = domainObject.getId();
return (this.latestValues[id] || {}).domain;
TelemetrySubscription.prototype.getDomainValue = function (domainObject, key) {
var id = domainObject.getId(),
latestValue = this.latestValues[id];
return latestValue && (key ?
latestValue.datum[key] :
latestValue.domain);
};
/**
@ -304,9 +307,12 @@ define(
* @param {DomainObject} domainObject the object of interest
* @returns the most recent range value observed
*/
TelemetrySubscription.prototype.getRangeValue = function (domainObject) {
var id = domainObject.getId();
return (this.latestValues[id] || {}).range;
TelemetrySubscription.prototype.getRangeValue = function (domainObject, key) {
var id = domainObject.getId(),
latestValue = this.latestValues[id];
return latestValue && (key ?
latestValue.datum[key] :
latestValue.range);
};
/**