mirror of
https://github.com/nasa/openmct.git
synced 2025-06-20 16:10:23 +00:00
[Plot] Prevent duplicate query on bounds change
Bounds change triggers a clearing of plot history, which triggers a user interaction change, which was triggering a second query. This change sets a flag to prevent the requery from the user interaction on bounds change. This flag could potentially be reused elsewhere, e.g. if we wanted to prevent requery when not utilizing a minmax data source. fixes #2126
This commit is contained in:
@ -181,7 +181,9 @@ define([
|
|||||||
};
|
};
|
||||||
this.config.xAxis.set('range', newRange);
|
this.config.xAxis.set('range', newRange);
|
||||||
if (!isTick) {
|
if (!isTick) {
|
||||||
|
this.skipReloadOnInteraction = true;
|
||||||
this.$scope.$broadcast('plot:clearHistory');
|
this.$scope.$broadcast('plot:clearHistory');
|
||||||
|
this.skipReloadOnInteraction = false;
|
||||||
this.loadMoreData(newRange, true);
|
this.loadMoreData(newRange, true);
|
||||||
} else {
|
} else {
|
||||||
// Drop any data that is more than 1x (max-min) before min.
|
// Drop any data that is more than 1x (max-min) before min.
|
||||||
@ -234,7 +236,9 @@ define([
|
|||||||
var xDisplayRange = this.config.xAxis.get('displayRange');
|
var xDisplayRange = this.config.xAxis.get('displayRange');
|
||||||
var xRange = this.config.xAxis.get('range');
|
var xRange = this.config.xAxis.get('range');
|
||||||
|
|
||||||
|
if (!this.skipReloadOnInteraction) {
|
||||||
this.loadMoreData(xDisplayRange);
|
this.loadMoreData(xDisplayRange);
|
||||||
|
}
|
||||||
|
|
||||||
this.synchronized(xRange.min === xDisplayRange.min &&
|
this.synchronized(xRange.min === xDisplayRange.min &&
|
||||||
xRange.max === xDisplayRange.max);
|
xRange.max === xDisplayRange.max);
|
||||||
|
Reference in New Issue
Block a user