From 510597a51a7b0a7c7ab9f4e5b5fbe64581f90d56 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Thu, 25 Jun 2015 12:56:22 -0700 Subject: [PATCH] [Scrolling List] Show limits in RT scrolling list Show limits in a real-time scrolling list view, WTD-1317. --- .../rtscrolling/res/templates/rtscrolling.html | 3 ++- .../features/rtscrolling/src/RangeColumn.js | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/platform/features/rtscrolling/res/templates/rtscrolling.html b/platform/features/rtscrolling/res/templates/rtscrolling.html index 94d6343004..213d1b146b 100644 --- a/platform/features/rtscrolling/res/templates/rtscrolling.html +++ b/platform/features/rtscrolling/res/templates/rtscrolling.html @@ -38,7 +38,8 @@ - + {{cell.text}} diff --git a/platform/features/rtscrolling/src/RangeColumn.js b/platform/features/rtscrolling/src/RangeColumn.js index 255291ad2b..867cc0798c 100644 --- a/platform/features/rtscrolling/src/RangeColumn.js +++ b/platform/features/rtscrolling/src/RangeColumn.js @@ -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 }; } };