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