mirror of
https://github.com/nasa/openmct.git
synced 2025-04-20 17:11:11 +00:00
[Timeline] Include units for utilizations
This commit is contained in:
parent
463f7ccf65
commit
23c71b7218
@ -557,8 +557,7 @@ define([
|
||||
{
|
||||
"key": "comms",
|
||||
"name": "Comms",
|
||||
"units": "Kbps",
|
||||
"foo": "Kb"
|
||||
"units": "Kbps"
|
||||
},
|
||||
{
|
||||
"key": "battery",
|
||||
|
@ -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') ?
|
||||
|
Loading…
x
Reference in New Issue
Block a user