mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 08:39:59 +00:00
[Timeline] Include units for utilizations
This commit is contained in:
@ -557,8 +557,7 @@ define([
|
|||||||
{
|
{
|
||||||
"key": "comms",
|
"key": "comms",
|
||||||
"name": "Comms",
|
"name": "Comms",
|
||||||
"units": "Kbps",
|
"units": "Kbps"
|
||||||
"foo": "Kb"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "battery",
|
"key": "battery",
|
||||||
|
@ -34,6 +34,14 @@ 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;
|
return this.resource.name;
|
||||||
};
|
};
|
||||||
@ -57,7 +65,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);
|
}, 0) + " (" + this.getUnits() + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
return !domainObject.hasCapability('utilization') ?
|
return !domainObject.hasCapability('utilization') ?
|
||||||
|
Reference in New Issue
Block a user