mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 01:42:31 +00:00
[Plot] Requery on event
Requery on a query change event from a time conductor, WTD-1515
This commit is contained in:
parent
77d11e1bcf
commit
600ff1a3ee
@ -65,6 +65,7 @@ define(
|
||||
subPlotFactory = new SubPlotFactory(telemetryFormatter),
|
||||
cachedObjects = [],
|
||||
updater,
|
||||
lastBounds,
|
||||
handle;
|
||||
|
||||
// Populate the scope with axis information (specifically, options
|
||||
@ -139,13 +140,14 @@ define(
|
||||
}
|
||||
|
||||
// Change the displayable bounds
|
||||
function setBasePanZoom(event, bounds) {
|
||||
function setBasePanZoom(unused, bounds) {
|
||||
var start = bounds.start,
|
||||
end = bounds.end;
|
||||
if (updater) {
|
||||
updater.setDomainBounds(start, end);
|
||||
self.update();
|
||||
}
|
||||
lastBounds = bounds;
|
||||
}
|
||||
|
||||
// Create a new subscription; telemetrySubscriber gets
|
||||
@ -175,6 +177,18 @@ define(
|
||||
}
|
||||
}
|
||||
|
||||
// Initiate a new query for data because query bounds changed
|
||||
function requery() {
|
||||
if (handle) {
|
||||
recreateUpdater();
|
||||
requestTelemetry();
|
||||
// Keep any externally-provided bounds
|
||||
if (lastBounds) {
|
||||
setBasePanZoom({}, lastBounds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.modeOptions = new PlotModeOptions([], subPlotFactory);
|
||||
this.updateValues = updateValues;
|
||||
|
||||
@ -190,6 +204,9 @@ define(
|
||||
// Respond to external bounds changes
|
||||
$scope.$on("telemetry:display:bounds", setBasePanZoom);
|
||||
|
||||
// Respond to external query range changes
|
||||
$scope.$on("telemetry:query:bounds", throttle(requery, 250));
|
||||
|
||||
// Unsubscribe when the plot is destroyed
|
||||
$scope.$on("$destroy", releaseSubscription);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user