diff --git a/platform/features/timeline/bundle.js b/platform/features/timeline/bundle.js index b8754f4916..4663a37fae 100644 --- a/platform/features/timeline/bundle.js +++ b/platform/features/timeline/bundle.js @@ -557,8 +557,7 @@ define([ { "key": "comms", "name": "Comms", - "units": "Kbps", - "foo": "Kb" + "units": "Kbps" }, { "key": "battery", diff --git a/platform/features/timeline/src/actions/UtilizationColumn.js b/platform/features/timeline/src/actions/UtilizationColumn.js index e9e88a5896..7da7b6c890 100644 --- a/platform/features/timeline/src/actions/UtilizationColumn.js +++ b/platform/features/timeline/src/actions/UtilizationColumn.js @@ -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') ?