[Scrolling List] Show limits in RT scrolling list

Show limits in a real-time scrolling list view,
WTD-1317.
This commit is contained in:
Victor Woeltjen 2015-06-25 12:56:22 -07:00
parent dddc2f976e
commit 510597a51a
2 changed files with 19 additions and 2 deletions

View File

@ -38,7 +38,8 @@
</thead>
<tbody>
<tr ng-repeat="row in rtscroll.rows()">
<td ng-repeat="cell in row">
<td ng-repeat="cell in row"
ng-class="cell.cssClass">
{{cell.text}}
</td>
</tr>

View File

@ -41,6 +41,13 @@ define(
* formatting service, for making values human-readable.
*/
function RangeColumn() {
function findRange(domainObject) {
var telemetry = domainObject.getCapability('telemetry'),
metadata = telemetry ? telemetry.getMetadata() : {},
ranges = metadata.ranges || [{}];
return ranges[0].key;
}
return {
/**
* Get the title to display in this column's header.
@ -55,8 +62,17 @@ define(
* @returns {string} the text to display
*/
getValue: function (domainObject, handle) {
var range = findRange(domainObject),
limit = domainObject.getCapability('limit'),
value = handle.getRangeValue(domainObject),
alarm = limit && limit.evaluate(
handle.getDatum(domainObject),
range
);
return {
text: handle.getRangeValue(domainObject)
cssClass: alarm && alarm.cssClass,
text: value
};
}
};