diff --git a/platform/features/conductor/src/ConductorRepresenter.js b/platform/features/conductor/src/ConductorRepresenter.js index 2583c50b14..f0a32c69a0 100644 --- a/platform/features/conductor/src/ConductorRepresenter.js +++ b/platform/features/conductor/src/ConductorRepresenter.js @@ -92,6 +92,8 @@ define( conductorScope.$watch('conductor.outer[1]', updateConductorOuter); conductorScope.$watch('conductor.inner[0]', updateConductorInner); conductorScope.$watch('conductor.inner[1]', updateConductorInner); + + repScope.$on('telemetry:view', updateConductorInner); } // Handle a specific representation of a specific domain object diff --git a/platform/features/plot/src/PlotController.js b/platform/features/plot/src/PlotController.js index a5772b8411..3b846d33b8 100644 --- a/platform/features/plot/src/PlotController.js +++ b/platform/features/plot/src/PlotController.js @@ -95,6 +95,17 @@ define( } } + // Change the displayable bounds + function setBasePanZoom(unused, bounds) { + var start = bounds.start, + end = bounds.end; + if (updater) { + updater.setDomainBounds(start, end); + self.update(); + } + lastBounds = bounds; + } + // Reinstantiate the plot updater (e.g. because we have a // new subscription.) This will clear the plot. function recreateUpdater() { @@ -108,6 +119,10 @@ define( handle, ($scope.axes[1].active || {}).key ); + // Keep any externally-provided bounds + if (lastBounds) { + setBasePanZoom({}, lastBounds); + } } // Handle new telemetry data in this plot @@ -139,17 +154,6 @@ define( } } - // Change the displayable 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 // to do the meaningful work here. function subscribe(domainObject) { @@ -182,10 +186,6 @@ define( if (handle) { recreateUpdater(); requestTelemetry(); - // Keep any externally-provided bounds - if (lastBounds) { - setBasePanZoom({}, lastBounds); - } } } @@ -210,6 +210,8 @@ define( // Unsubscribe when the plot is destroyed $scope.$on("$destroy", releaseSubscription); + // Notify any external observers that a new telemetry view is here + $scope.$emit("telemetry:view"); } /** diff --git a/platform/features/plot/src/elements/PlotUpdater.js b/platform/features/plot/src/elements/PlotUpdater.js index 7701f02aa5..d4b4ad3eec 100644 --- a/platform/features/plot/src/elements/PlotUpdater.js +++ b/platform/features/plot/src/elements/PlotUpdater.js @@ -307,7 +307,8 @@ define( // Suppress follow behavior if we have windowed in on the past this.hasSpecificDomainBounds = true; - this.following = end >= this.domainExtrema[1]; + this.following = + !this.domainExtrema || (end >= this.domainExtrema[1]); }; /**