mirror of
https://github.com/nasa/openmct.git
synced 2024-12-23 23:12:23 +00:00
[Timeline] Show units in utilization headers
This commit is contained in:
parent
23c71b7218
commit
a3bcaea7f9
@ -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') ?
|
||||
|
Loading…
Reference in New Issue
Block a user