mirror of
https://github.com/nasa/openmct.git
synced 2025-05-09 20:12:50 +00:00
only dupe check when needed
Only enable datum dupe checking in collection after data has been received. This works under the assumption that a single telemetry request will not contain duplicate elements, thus, it is not necessary to check for dupes on the initial request. Improves performance when rows are sorted by a column that has duplicate row-values.
This commit is contained in:
parent
284dec4903
commit
2d352ac574
@ -32,6 +32,7 @@ define(
|
|||||||
*/
|
*/
|
||||||
function TelemetryCollection() {
|
function TelemetryCollection() {
|
||||||
EventEmitter.call(this, arguments);
|
EventEmitter.call(this, arguments);
|
||||||
|
this.dupeCheck = false;
|
||||||
this.telemetry = [];
|
this.telemetry = [];
|
||||||
this.highBuffer = [];
|
this.highBuffer = [];
|
||||||
this.sortField = undefined;
|
this.sortField = undefined;
|
||||||
@ -161,7 +162,7 @@ define(
|
|||||||
var startIx = _.sortedIndex(array, item, this.sortField);
|
var startIx = _.sortedIndex(array, item, this.sortField);
|
||||||
var endIx;
|
var endIx;
|
||||||
|
|
||||||
if (startIx !== array.length) {
|
if (this.dupeCheck && startIx !== array.length) {
|
||||||
endIx = _.sortedLastIndex(array, item, this.sortField);
|
endIx = _.sortedLastIndex(array, item, this.sortField);
|
||||||
|
|
||||||
// Create an array of potential dupes, based on having the
|
// Create an array of potential dupes, based on having the
|
||||||
|
@ -292,6 +292,7 @@ define(
|
|||||||
*/
|
*/
|
||||||
function finishProcessing() {
|
function finishProcessing() {
|
||||||
telemetryCollection.add(rowData);
|
telemetryCollection.add(rowData);
|
||||||
|
telemetryCollection.dupeCheck = true;
|
||||||
scope.rows = telemetryCollection.telemetry;
|
scope.rows = telemetryCollection.telemetry;
|
||||||
scope.loading = false;
|
scope.loading = false;
|
||||||
|
|
||||||
@ -377,6 +378,7 @@ define(
|
|||||||
function newData(domainObject, datum) {
|
function newData(domainObject, datum) {
|
||||||
limitEvaluator = telemetryApi.limitEvaluator(domainObject);
|
limitEvaluator = telemetryApi.limitEvaluator(domainObject);
|
||||||
added = telemetryCollection.add([table.getRowValues(limitEvaluator, datum)]);
|
added = telemetryCollection.add([table.getRowValues(limitEvaluator, datum)]);
|
||||||
|
this.telemetry.dupeCheck = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
objects.forEach(function (object) {
|
objects.forEach(function (object) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user