From 9723c650160cf34b9b68f2af76481378718bd38b Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 27 Oct 2015 12:09:50 -0700 Subject: [PATCH] [Time Conductor] Retain domain selection in plot Avoid various cases where domain selection is temporarily overwritten due to transient plot state (e.g. because no telemetry metadata is yet available due to asynchronous retrieval of delegates.) --- platform/features/plot/src/PlotController.js | 30 +++++++++----------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/platform/features/plot/src/PlotController.js b/platform/features/plot/src/PlotController.js index 0fdcf9e3eb..517682f9b4 100644 --- a/platform/features/plot/src/PlotController.js +++ b/platform/features/plot/src/PlotController.js @@ -136,6 +136,13 @@ define( } } + function getUpdater() { + if (!updater) { + recreateUpdater(); + } + return updater; + } + // Handle new telemetry data in this plot function updateValues() { self.pending = false; @@ -143,27 +150,23 @@ define( setupModes(handle.getTelemetryObjects()); setupAxes(handle.getMetadata()); } - if (updater) { - updater.update(); - self.modeOptions.getModeHandler().plotTelemetry(updater); - } - if (self.limitTracker) { - self.limitTracker.update(); - } + getUpdater().update(); + self.modeOptions.getModeHandler().plotTelemetry(updater); + self.limitTracker.update(); self.update(); } // Display new historical data as it becomes available function addHistoricalData(domainObject, series) { self.pending = false; - updater.addHistorical(domainObject, series); + getUpdater().addHistorical(domainObject, series); self.modeOptions.getModeHandler().plotTelemetry(updater); self.update(); } // Issue a new request for historical telemetry function requestTelemetry() { - if (handle && updater) { + if (handle) { handle.request({}, addHistoricalData); } } @@ -171,7 +174,7 @@ define( // Requery for data entirely function replot() { if (handle) { - recreateUpdater(); + updater = undefined; requestTelemetry(); } } @@ -187,12 +190,7 @@ define( updateValues, true // Lossless ); - if (handle) { - setupModes(handle.getTelemetryObjects()); - setupAxes(handle.getMetadata()); - recreateUpdater(); - requestTelemetry(); - } + replot(); } // Release the current subscription (called when scope is destroyed)