From 7be7844824136f2e342c9df3728467bfd598218d Mon Sep 17 00:00:00 2001 From: Sarah Hale Date: Mon, 22 Jun 2015 13:40:55 -0700 Subject: [PATCH] [Events] Reversed viewing order When viewing an event message generator new messages are now added to the bottom of the display, rather than being added to the top and pushing the other messages down by one. #18. --- example/eventGenerator/src/EventTelemetry.js | 4 +++- platform/features/events/src/EventListController.js | 6 ++++-- platform/features/events/src/EventListPopulator.js | 2 +- platform/telemetry/src/TelemetryController.js | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/example/eventGenerator/src/EventTelemetry.js b/example/eventGenerator/src/EventTelemetry.js index 317799815e..62dd3531d3 100644 --- a/example/eventGenerator/src/EventTelemetry.js +++ b/example/eventGenerator/src/EventTelemetry.js @@ -90,11 +90,13 @@ define( var ind = i%messages.length; return "TEMP " + i.toString() + "-" + messages[ind][2] + "[" + domainDelta.toString() + "]"; }; - + + generatorData.getSeverityValue = function (i) { var ind = i%messages.length; return messages[ind][0]; }; + return generatorData; } diff --git a/platform/features/events/src/EventListController.js b/platform/features/events/src/EventListController.js index d2b54169b5..052e4571c2 100644 --- a/platform/features/events/src/EventListController.js +++ b/platform/features/events/src/EventListController.js @@ -38,8 +38,7 @@ define( */ function EventListController($scope, formatter) { var populator; - - + // Get a set of populated, ready-to-display rows for the // latest data values. function getRows(telemetry) { @@ -53,6 +52,9 @@ define( function updateRows() { var telemetry = $scope.telemetry; $scope.rows = telemetry ? getRows(telemetry) : []; + // We want to display the rows in reverse order + // i.e. from the top to the bottom of the page + $scope.rows = $scope.rows.reverse(); } // Set up columns based on telemetry metadata. This will diff --git a/platform/features/events/src/EventListPopulator.js b/platform/features/events/src/EventListPopulator.js index f2a5c1f473..af6d3e9ae6 100644 --- a/platform/features/events/src/EventListPopulator.js +++ b/platform/features/events/src/EventListPopulator.js @@ -38,7 +38,7 @@ define( * Look up the most recent values from a set of data objects. * Returns an array of objects in the order in which data * should be displayed; each element is an object with - * two properties: + * two properties: * * * objectIndex: The index of the domain object associated * with the data point to be displayed in that diff --git a/platform/telemetry/src/TelemetryController.js b/platform/telemetry/src/TelemetryController.js index 10e83ab316..504ec2ec4a 100644 --- a/platform/telemetry/src/TelemetryController.js +++ b/platform/telemetry/src/TelemetryController.js @@ -342,7 +342,7 @@ define( * the second form, it returns an array ordered in * same manner as `getMetadata()` or * `getTelemetryObjects()`; that is, the telemetry - * response at agiven index will correspond to the + * response at a given index will correspond to the * telemetry-providing domain object at the same index. * @returns {Array} an array of responses */