[Timeline] Show units in utilization headers

This commit is contained in:
Victor Woeltjen 2016-05-25 12:21:58 -07:00
parent 23c71b7218
commit a3bcaea7f9

View File

@ -34,16 +34,13 @@ define([], function () {
this.resource = resource;
}
UtilizationColumn.prototype.getUnits = function () {
var instantaneousUnits = this.resource.units;
return {
"Kbps": "Kb",
"Watts": "joules",
}[instantaneousUnits] || "unknown units";
};
UtilizationColumn.prototype.name = function () {
return this.resource.name;
var units = {
"Kbps": "Kb",
"watts": "watt-seconds"
}[this.resource.units] || "unknown units";
return this.resource.name + " (" + units + ")";
};
UtilizationColumn.prototype.value = function (domainObject) {
@ -65,7 +62,7 @@ define([], function () {
return utilizations.map(getCost).reduce(function (a, b) {
return a + b;
}, 0) + " (" + this.getUnits() + ")";
}, 0);
}
return !domainObject.hasCapability('utilization') ?