From f5806613b9287534383569195e87a8e4b90b6905 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 22 Oct 2016 14:46:14 -0700 Subject: [PATCH] [Time Conductor] support TOI from real-time tables --- .../features/table/res/templates/historical-table.html | 1 - platform/features/table/res/templates/rt-table.html | 4 +++- .../features/table/src/controllers/MCTTableController.js | 8 ++++++-- .../table/src/controllers/RealtimeTableController.js | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/platform/features/table/res/templates/historical-table.html b/platform/features/table/res/templates/historical-table.html index 7b240f3cecb..cef88d0566d 100644 --- a/platform/features/table/res/templates/historical-table.html +++ b/platform/features/table/res/templates/historical-table.html @@ -7,7 +7,6 @@ enableFilter="true" enableSort="true" default-sort="defaultSort" - on-row-click="tableController.onRowClick(event, rowIndex, sortColumn, sortDirection)" class="tabular-holder has-control-bar"> \ No newline at end of file diff --git a/platform/features/table/res/templates/rt-table.html b/platform/features/table/res/templates/rt-table.html index 573eeb89f69..6b10c502e60 100644 --- a/platform/features/table/res/templates/rt-table.html +++ b/platform/features/table/res/templates/rt-table.html @@ -1,10 +1,12 @@ -
+
\ No newline at end of file diff --git a/platform/features/table/src/controllers/MCTTableController.js b/platform/features/table/src/controllers/MCTTableController.js index 97a7fe9b56c..97b74ed6bf3 100644 --- a/platform/features/table/src/controllers/MCTTableController.js +++ b/platform/features/table/src/controllers/MCTTableController.js @@ -621,10 +621,14 @@ define( && this.$scope.displayRows.length > 0) { var formattedTOI = this.toiFormatter.format(newTOI); // array, searchElement, min, max - this.$scope.toiRowIndex = this.binarySearch(this.$scope.displayRows, + var rowIndex = this.binarySearch(this.$scope.displayRows, formattedTOI, 0, this.$scope.displayRows.length - 1); - this.scrollToRow(this.$scope.toiRowIndex); + if (rowIndex > 0 && rowIndex < this.$scope.displayRows.length) { + this.$scope.toiRowIndex = rowIndex; + this.scrollToRow(this.$scope.toiRowIndex); + } } + console.log('toiRowIndex '+ this.$scope.toiRowIndex + ' length: ' + this.$scope.displayRows.length); }; /** diff --git a/platform/features/table/src/controllers/RealtimeTableController.js b/platform/features/table/src/controllers/RealtimeTableController.js index 0b0227dff1a..c6ff7b8aee4 100644 --- a/platform/features/table/src/controllers/RealtimeTableController.js +++ b/platform/features/table/src/controllers/RealtimeTableController.js @@ -35,8 +35,8 @@ define( * @param telemetryFormatter * @constructor */ - function RealtimeTableController($scope, telemetryHandler, telemetryFormatter) { - TableController.call(this, $scope, telemetryHandler, telemetryFormatter); + function RealtimeTableController($scope, telemetryHandler, telemetryFormatter, openmct) { + TableController.call(this, $scope, telemetryHandler, telemetryFormatter, openmct); this.maxRows = 100000; }