Skip to content

Commit f580661

Browse files
committed
[Time Conductor] support TOI from real-time tables
1 parent 029d2b3 commit f580661

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

platform/features/table/res/templates/historical-table.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
enableFilter="true"
88
enableSort="true"
99
default-sort="defaultSort"
10-
on-row-click="tableController.onRowClick(event, rowIndex, sortColumn, sortDirection)"
1110
class="tabular-holder has-control-bar">
1211
</mct-table>
1312
</div>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
<div ng-controller="RealtimeTableController">
1+
<div ng-controller="RealtimeTableController as tableController">
22
<mct-table
33
headers="headers"
44
rows="rows"
5+
time-columns="tableController.timeColumns"
56
enableFilter="true"
67
enableSort="true"
78
class="tabular-holder has-control-bar"
9+
default-sort="defaultSort"
810
auto-scroll="true">
911
</mct-table>
1012
</div>

platform/features/table/src/controllers/MCTTableController.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,10 +621,14 @@ define(
621621
&& this.$scope.displayRows.length > 0) {
622622
var formattedTOI = this.toiFormatter.format(newTOI);
623623
// array, searchElement, min, max
624-
this.$scope.toiRowIndex = this.binarySearch(this.$scope.displayRows,
624+
var rowIndex = this.binarySearch(this.$scope.displayRows,
625625
formattedTOI, 0, this.$scope.displayRows.length - 1);
626-
this.scrollToRow(this.$scope.toiRowIndex);
626+
if (rowIndex > 0 && rowIndex < this.$scope.displayRows.length) {
627+
this.$scope.toiRowIndex = rowIndex;
628+
this.scrollToRow(this.$scope.toiRowIndex);
629+
}
627630
}
631+
console.log('toiRowIndex '+ this.$scope.toiRowIndex + ' length: ' + this.$scope.displayRows.length);
628632
};
629633

630634
/**

platform/features/table/src/controllers/RealtimeTableController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ define(
3535
* @param telemetryFormatter
3636
* @constructor
3737
*/
38-
function RealtimeTableController($scope, telemetryHandler, telemetryFormatter) {
39-
TableController.call(this, $scope, telemetryHandler, telemetryFormatter);
38+
function RealtimeTableController($scope, telemetryHandler, telemetryFormatter, openmct) {
39+
TableController.call(this, $scope, telemetryHandler, telemetryFormatter, openmct);
4040

4141
this.maxRows = 100000;
4242
}

0 commit comments

Comments
 (0)