mirror of
https://github.com/nasa/openmct.git
synced 2025-05-12 05:23:13 +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;
|
this.resource = resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
UtilizationColumn.prototype.getUnits = function () {
|
|
||||||
var instantaneousUnits = this.resource.units;
|
|
||||||
return {
|
|
||||||
"Kbps": "Kb",
|
|
||||||
"Watts": "joules",
|
|
||||||
}[instantaneousUnits] || "unknown units";
|
|
||||||
};
|
|
||||||
|
|
||||||
UtilizationColumn.prototype.name = function () {
|
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) {
|
UtilizationColumn.prototype.value = function (domainObject) {
|
||||||
@ -65,7 +62,7 @@ define([], function () {
|
|||||||
|
|
||||||
return utilizations.map(getCost).reduce(function (a, b) {
|
return utilizations.map(getCost).reduce(function (a, b) {
|
||||||
return a + b;
|
return a + b;
|
||||||
}, 0) + " (" + this.getUnits() + ")";
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return !domainObject.hasCapability('utilization') ?
|
return !domainObject.hasCapability('utilization') ?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user