mirror of
https://github.com/nasa/openmct.git
synced 2025-06-15 21:58:13 +00:00
[Tables] Fixed issue with historical tables composed of multiple objects
This commit is contained in:
@ -6,7 +6,8 @@
|
|||||||
<table class="filterable"
|
<table class="filterable"
|
||||||
ng-style="overrideRowPositioning && {
|
ng-style="overrideRowPositioning && {
|
||||||
height: totalHeight + 'px',
|
height: totalHeight + 'px',
|
||||||
'table-layout': overrideRowPositioning ? 'fixed' : 'auto'
|
'table-layout': overrideRowPositioning ? 'fixed' : 'auto',
|
||||||
|
'max-width': totalWidth
|
||||||
}">
|
}">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -57,7 +58,7 @@
|
|||||||
'box-sizing': 'border-box'
|
'box-sizing': 'border-box'
|
||||||
}"
|
}"
|
||||||
class="{{visibleRow.contents[header].cssClass}}">
|
class="{{visibleRow.contents[header].cssClass}}">
|
||||||
{{ visibleRow.contents[header].text }}
|
{{ visibleRow.contents[header].text }}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -238,12 +238,16 @@ define(
|
|||||||
column = firstRow.find('td'),
|
column = firstRow.find('td'),
|
||||||
headerHeight = thead.prop('offsetHeight'),
|
headerHeight = thead.prop('offsetHeight'),
|
||||||
rowHeight = 20,
|
rowHeight = 20,
|
||||||
|
columnWidth,
|
||||||
|
tableWidth = 0,
|
||||||
overallHeight = headerHeight + (rowHeight * (this.$scope.displayRows ? this.$scope.displayRows.length - 1 : 0));
|
overallHeight = headerHeight + (rowHeight * (this.$scope.displayRows ? this.$scope.displayRows.length - 1 : 0));
|
||||||
|
|
||||||
this.$scope.columnWidths = [];
|
this.$scope.columnWidths = [];
|
||||||
|
|
||||||
while (column.length) {
|
while (column.length) {
|
||||||
|
columnWidth = column.prop('offsetWidth');
|
||||||
this.$scope.columnWidths.push(column.prop('offsetWidth'));
|
this.$scope.columnWidths.push(column.prop('offsetWidth'));
|
||||||
|
tableWidth += columnWidth;
|
||||||
column = column.next();
|
column = column.next();
|
||||||
}
|
}
|
||||||
this.$scope.headerHeight = headerHeight;
|
this.$scope.headerHeight = headerHeight;
|
||||||
@ -251,6 +255,11 @@ define(
|
|||||||
this.$scope.totalHeight = overallHeight;
|
this.$scope.totalHeight = overallHeight;
|
||||||
this.setVisibleRows();
|
this.setVisibleRows();
|
||||||
this.$scope.overrideRowPositioning = true;
|
this.$scope.overrideRowPositioning = true;
|
||||||
|
if (tableWidth > 0) {
|
||||||
|
this.$scope.totalWidth = tableWidth + 'px';
|
||||||
|
} else {
|
||||||
|
this.$scope.totalWidth = 'none';
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -106,6 +106,8 @@ define(
|
|||||||
only).
|
only).
|
||||||
*/
|
*/
|
||||||
TelemetryTableController.prototype.subscribe = function() {
|
TelemetryTableController.prototype.subscribe = function() {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
if (this.handle) {
|
if (this.handle) {
|
||||||
this.handle.unsubscribe();
|
this.handle.unsubscribe();
|
||||||
}
|
}
|
||||||
@ -120,7 +122,22 @@ define(
|
|||||||
true // Lossless
|
true // Lossless
|
||||||
);
|
);
|
||||||
|
|
||||||
this.handle.request({}, this.addHistoricalData.bind(this));
|
function getHistoricalData(){
|
||||||
|
var rowData = [];
|
||||||
|
|
||||||
|
self.handle.getTelemetryObjects().forEach(function(telemetryObject){
|
||||||
|
var series = self.handle.getSeries(telemetryObject) || {},
|
||||||
|
pointCount = series.getPointCount ? series.getPointCount() : 0,
|
||||||
|
i = 0;
|
||||||
|
|
||||||
|
for (; i < pointCount; i++) {
|
||||||
|
rowData.push(self.table.getRowValues(telemetryObject, self.handle.makeDatum(telemetryObject, series, i)));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
self.$scope.rows = rowData;
|
||||||
|
}
|
||||||
|
this.handle.request({}).then(getHistoricalData);
|
||||||
|
|
||||||
this.setup();
|
this.setup();
|
||||||
};
|
};
|
||||||
@ -134,10 +151,8 @@ define(
|
|||||||
newRows = [];
|
newRows = [];
|
||||||
|
|
||||||
for (i=0; i < series.getPointCount(); i++) {
|
for (i=0; i < series.getPointCount(); i++) {
|
||||||
newRows.push(this.table.getRowValues(domainObject, this.handle.makeDatum(domainObject, series, i)));
|
this.$scope.rows.push(this.table.getRowValues(domainObject, this.handle.makeDatum(domainObject, series, i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$scope.rows = newRows;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user