[Timeline] Include units for utilizations

This commit is contained in:
Victor Woeltjen 2016-05-25 12:12:11 -07:00
parent 463f7ccf65
commit 23c71b7218
2 changed files with 10 additions and 3 deletions

View File

@ -557,8 +557,7 @@ define([
{
"key": "comms",
"name": "Comms",
"units": "Kbps",
"foo": "Kb"
"units": "Kbps"
},
{
"key": "battery",

View File

@ -34,6 +34,14 @@ 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;
};
@ -57,7 +65,7 @@ define([], function () {
return utilizations.map(getCost).reduce(function (a, b) {
return a + b;
}, 0);
}, 0) + " (" + this.getUnits() + ")";
}
return !domainObject.hasCapability('utilization') ?